// RUN: %batch-code-completion -source-filename %s -module-name CompleteDocTest -code-completion-comments -code-completion-sort-by-name
protocol P1 {
/// requirement1 doc comment
///
/// more description
var requirement1: String { get }
func requirement2()
/// requirement3 comment in P1
func requirement3(x: Int)
}
/// struct S
///
/// More info on struct S
struct S1: P1 {
/// instanceVar1 description
var instanceVar1: String = "OK"
/// instanceVar2 description
///
/// Euler-Mascheroni constant
var instanceVar2: Double = 0.5772156649
/// struct instance func comment
///
/// Does stuff with the instance.
func instanceFunc1() {}
/// struct instance func comment
///
/// Does stuff with the instance.
///
/// - Parameters:
/// - x: what is x?
func instanceFunc2(x: String) {}
/// subscript on struct S
///
/// - Parameters:
/// - index: an index into S1
subscript(index: Int) {}
var requirement1: String = "name"
func requirement2() {}
/// requirement3 comment in S1
func requirement3() {}
}
extension S1 {
/// doc for extendedFunc1
func extendedFunc1(x: Int, y: Int) -> Int {
return x + y * 2
}
func extendedFunc2() {}
}
func testWithDot() {
S1().#^MEMBER_DOT^#
}
// MEMBER_DOT: Begin completions, 11 items
// MEMBER_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: extendedFunc1({#x: Int#}, {#y: Int#})[#Int#]; name=extendedFunc1(x:y:);
// MEMBER_DOT-SAME: briefcomment=doc for extendedFunc1;
// MEMBER_DOT-SAME: xmlcomment=extendedFunc1(x:y:)s:15CompleteDocTest2S1V13extendedFunc11x1yS2i_SitFfunc extendedFunc1(x: Int, y: Int) -> Intdoc for extendedFunc1;
// MEMBER_DOT-SAME: rawcomment=doc for extendedFunc1
// MEMBER_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: extendedFunc2()[#Void#]; name=extendedFunc2(){{$}}
// MEMBER_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc1()[#Void#]; name=instanceFunc1();
// MEMBER_DOT-SAME: briefcomment=struct instance func comment;
// MEMBER_DOT-SAME: xmlcomment=instanceFunc1()s:15CompleteDocTest2S1V13instanceFunc1yyFfunc instanceFunc1()struct instance func commentDoes stuff with the instance.;
// MEMBER_DOT-SAME: rawcomment=struct instance func comment
// MEMBER_DOT-EMPTY:
// MEMBER_DOT-NEXT: Does stuff with the instance.
// MEMBER_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: instanceFunc2({#x: String#})[#Void#]; name=instanceFunc2(x:);
// MEMBER_DOT-SAME: briefcomment=struct instance func comment;
// MEMBER_DOT-SAME: xmlcomment=instanceFunc2(x:)s:15CompleteDocTest2S1V13instanceFunc21xySS_tFfunc instanceFunc2(x: String)struct instance func commentxinwhat is x?Does stuff with the instance.;
// MEMBER_DOT-SAME: rawcomment=struct instance func comment
// MEMBER_DOT-EMPTY:
// MEMBER_DOT-NEXT: Does stuff with the instance.
// MEMBER_DOT-EMPTY:
// MEMBER_DOT-NEXT: - Parameters:
// MEMBER_DOT-NEXT: - x: what is x?
// MEMBER_DOT-NEXT: Decl[InstanceVar]/CurrNominal: instanceVar1[#String#]; name=instanceVar1;
// MEMBER_DOT-SAME: briefcomment=instanceVar1 description;
// MEMBER_DOT-SAME: xmlcomment=instanceVar1s:15CompleteDocTest2S1V12instanceVar1SSvpvar instanceVar1: StringinstanceVar1 description;
// MEMBER_DOT-SAME: rawcomment=instanceVar1 description
// MEMBER_DOT-NEXT: Decl[InstanceVar]/CurrNominal: instanceVar2[#Double#]; name=instanceVar2;
// MEMBER_DOT-SAME: briefcomment=instanceVar2 description;
// MEMBER_DOT-SAME: xmlcomment=instanceVar2s:15CompleteDocTest2S1V12instanceVar2Sdvpvar instanceVar2: DoubleinstanceVar2 descriptionEuler-Mascheroni constant;
// MEMBER_DOT-SAME: rawcomment=instanceVar2 description
// MEMBER_DOT-EMPTY:
// MEMBER_DOT-NEXT: Euler-Mascheroni constant
// MEMBER_DOT-NEXT: Decl[InstanceVar]/CurrNominal: requirement1[#String#]; name=requirement1;
// MEMBER_DOT-SAME: briefcomment=requirement1 doc comment;
// MEMBER_DOT-SAME: xmlcomment=requirement1s:15CompleteDocTest2P1P12requirement1SSvpvar requirement1: String { get }requirement1 doc commentmore descriptionThis documentation comment was inherited from P1.;
// MEMBER_DOT-SAME: rawcomment=requirement1 doc comment
// MEMBER_DOT-EMPTY:
// MEMBER_DOT-NEXT: more description
// MEMBER_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: requirement2()[#Void#]; name=requirement2(){{$}}
// MEMBER_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: requirement3()[#Void#]; name=requirement3();
// MEMBER_DOT-SAME: briefcomment=requirement3 comment in S1;
// MEMBER_DOT-SAME: xmlcomment=requirement3()s:15CompleteDocTest2S1V12requirement3yyFfunc requirement3()requirement3 comment in S1;
// MEMBER_DOT-SAME: rawcomment=requirement3 comment in S1
// MEMBER_DOT-NEXT: Decl[InstanceMethod]/Super: requirement3({#x: Int#})[#Void#]; name=requirement3(x:);
// MEMBER_DOT-SAME: briefcomment=requirement3 comment in P1;
// MEMBER_DOT-SAME: xmlcomment=requirement3(x:)s:15CompleteDocTest2P1P12requirement31xySi_tFfunc requirement3(x: Int)requirement3 comment in P1;
// MEMBER_DOT-SAME: rawcomment=requirement3 comment in P1
// MEMBER_DOT-NEXT: Keyword[self]/CurrNominal: self[#S1#]; name=self{{$}}
func testWithNoDot() {
S1()#^MEMBER_NO_DOT^#
}
// MEMBER_NO_DOT: Begin completions, 12 items
// MEMBER_NO_DOT-NEXT: Decl[Subscript]/CurrNominal: [{#(index): Int#}][#<>#]; name=[:];
// MEMBER_NO_DOT-SAME: briefcomment=subscript on struct S;
// MEMBER_NO_DOT-SAME: xmlcomment=subscript(_:)s:15CompleteDocTest2S1VyXeXecipsubscript(index: Int) -> <<error type>> { get }subscript on struct Sindexinan index into S1;
// MEMBER_NO_DOT-SAME: rawcomment=subscript on struct S
// MEMBER_NO_DOT-EMPTY:
// MEMBER_NO_DOT-NEXT: - Parameters:
// MEMBER_NO_DOT-NEXT: - index: an index into S1
// MEMBER_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .extendedFunc1({#x: Int#}, {#y: Int#})[#Int#]; name=extendedFunc1(x:y:);
// MEMBER_NO_DOT-SAME: briefcomment=doc for extendedFunc1;
// MEMBER_NO_DOT-SAME: xmlcomment=extendedFunc1(x:y:)s:15CompleteDocTest2S1V13extendedFunc11x1yS2i_SitFfunc extendedFunc1(x: Int, y: Int) -> Intdoc for extendedFunc1;
// MEMBER_NO_DOT-SAME: rawcomment=doc for extendedFunc1
// MEMBER_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .extendedFunc2()[#Void#]; name=extendedFunc2()
// MEMBER_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc1()[#Void#]; name=instanceFunc1();
// MEMBER_NO_DOT-SAME: briefcomment=struct instance func comment;
// MEMBER_NO_DOT-SAME: xmlcomment=instanceFunc1()s:15CompleteDocTest2S1V13instanceFunc1yyFfunc instanceFunc1()struct instance func commentDoes stuff with the instance.;
// MEMBER_NO_DOT-SAME: rawcomment=struct instance func comment
// MEMBER_NO_DOT-EMPTY:
// MEMBER_NO_DOT-NEXT: Does stuff with the instance.
// MEMBER_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .instanceFunc2({#x: String#})[#Void#]; name=instanceFunc2(x:);
// MEMBER_NO_DOT-SAME: briefcomment=struct instance func comment;
// MEMBER_NO_DOT-SAME: xmlcomment=instanceFunc2(x:)s:15CompleteDocTest2S1V13instanceFunc21xySS_tFfunc instanceFunc2(x: String)struct instance func commentxinwhat is x?Does stuff with the instance.;
// MEMBER_NO_DOT-SAME: rawcomment=struct instance func comment
// MEMBER_NO_DOT-EMPTY:
// MEMBER_NO_DOT-NEXT: Does stuff with the instance.
// MEMBER_NO_DOT-EMPTY:
// MEMBER_NO_DOT-NEXT: - Parameters:
// MEMBER_NO_DOT-NEXT: - x: what is x?
// MEMBER_NO_DOT-NEXT: Decl[InstanceVar]/CurrNominal: .instanceVar1[#String#]; name=instanceVar1;
// MEMBER_NO_DOT-SAME: briefcomment=instanceVar1 description;
// MEMBER_NO_DOT-SAME: xmlcomment=instanceVar1s:15CompleteDocTest2S1V12instanceVar1SSvpvar instanceVar1: StringinstanceVar1 description;
// MEMBER_NO_DOT-SAME: rawcomment=instanceVar1 description
// MEMBER_NO_DOT-NEXT: Decl[InstanceVar]/CurrNominal: .instanceVar2[#Double#]; name=instanceVar2;
// MEMBER_NO_DOT-SAME: briefcomment=instanceVar2 description;
// MEMBER_NO_DOT-SAME: xmlcomment=instanceVar2s:15CompleteDocTest2S1V12instanceVar2Sdvpvar instanceVar2: DoubleinstanceVar2 descriptionEuler-Mascheroni constant;
// MEMBER_NO_DOT-SAME: rawcomment=instanceVar2 description
// MEMBER_NO_DOT-EMPTY:
// MEMBER_NO_DOT-NEXT: Euler-Mascheroni constant
// MEMBER_NO_DOT-NEXT: Decl[InstanceVar]/CurrNominal: .requirement1[#String#]; name=requirement1;
// MEMBER_NO_DOT-SAME: briefcomment=requirement1 doc comment;
// MEMBER_NO_DOT-SAME: xmlcomment=requirement1s:15CompleteDocTest2P1P12requirement1SSvpvar requirement1: String { get }requirement1 doc commentmore descriptionThis documentation comment was inherited from P1.;
// MEMBER_NO_DOT-SAME: rawcomment=requirement1 doc comment
// MEMBER_NO_DOT-EMPTY:
// MEMBER_NO_DOT-NEXT: more description
// MEMBER_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .requirement2()[#Void#]; name=requirement2()
// MEMBER_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .requirement3()[#Void#]; name=requirement3();
// MEMBER_NO_DOT-SAME: briefcomment=requirement3 comment in S1;
// MEMBER_NO_DOT-SAME: xmlcomment=requirement3()s:15CompleteDocTest2S1V12requirement3yyFfunc requirement3()requirement3 comment in S1;
// MEMBER_NO_DOT-SAME: rawcomment=requirement3 comment in S1
// MEMBER_NO_DOT-NEXT: Decl[InstanceMethod]/Super: .requirement3({#x: Int#})[#Void#]; name=requirement3(x:);
// MEMBER_NO_DOT-SAME: briefcomment=requirement3 comment in P1;
// MEMBER_NO_DOT-SAME: xmlcomment=requirement3(x:)s:15CompleteDocTest2P1P12requirement31xySi_tFfunc requirement3(x: Int)requirement3 comment in P1;
// MEMBER_NO_DOT-SAME: rawcomment=requirement3 comment in P1
// MEMBER_NO_DOT-NEXT: Keyword[self]/CurrNominal: .self[#S1#]; name=self