Skip to content

[SourceKit] Print compilerargs and sourcetext keys last #72003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,84 +3,84 @@
{
key.kind: source.lang.swift.decl.function.subscript,
key.name: "[:]",
key.sourcetext: "[<#T##param: Int##Int#>]",
key.description: "[<callarg><callarg.label>_</callarg.label> <callarg.param>param</callarg.param>: <callarg.type><typeid.sys>Int</typeid.sys></callarg.type></callarg>]",
key.typename: "<typeid.sys>Int</typeid.sys>",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0,
key.associated_usrs: "s:29complete_annotateddescription8MyStructVyS2icip",
key.modulename: "complete_annotateddescription"
key.modulename: "complete_annotateddescription",
key.sourcetext: "[<#T##param: Int##Int#>]"
},
{
key.kind: source.lang.swift.decl.function.subscript,
key.name: "[label:]",
key.sourcetext: "[label: <#T##Int#>]",
key.description: "[<callarg><callarg.label>label</callarg.label> <callarg.param>param</callarg.param>: <callarg.type><typeid.sys>Int</typeid.sys></callarg.type></callarg>]",
key.typename: "<typeid.sys>Int</typeid.sys>",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0,
key.associated_usrs: "s:29complete_annotateddescription8MyStructV5labelS2i_tcip",
key.modulename: "complete_annotateddescription"
key.modulename: "complete_annotateddescription",
key.sourcetext: "[label: <#T##Int#>]"
},
{
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "labelName(label:)",
key.sourcetext: ".labelName(label: <#T##(@autoclosure () -> Int) -> Int#>)",
key.description: "<name>labelName</name>(<callarg><callarg.label>label</callarg.label>: <callarg.type>(<attribute>@autoclosure</attribute> () -&gt; <typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Int</typeid.sys></callarg.type></callarg>)",
key.typename: "<typeid.sys>Void</typeid.sys>",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0,
key.associated_usrs: "s:29complete_annotateddescription8MyStructV9labelName0E0yS2iyXKXE_tF",
key.modulename: "complete_annotateddescription"
key.modulename: "complete_annotateddescription",
key.sourcetext: ".labelName(label: <#T##(@autoclosure () -> Int) -> Int#>)"
},
{
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "labelNameParamName(label:)",
key.sourcetext: ".labelNameParamName(label: <#T##(inout Int) throws -> MyStruct#>)",
key.description: "<name>labelNameParamName</name>(<callarg><callarg.label>label</callarg.label> <callarg.param>param</callarg.param>: <callarg.type>(<keyword>inout</keyword> <typeid.sys>Int</typeid.sys>) <keyword>throws</keyword> -&gt; <typeid.user>MyStruct</typeid.user></callarg.type></callarg>) <keyword>rethrows</keyword>",
key.typename: "<typeid.sys>Void</typeid.sys>",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0,
key.associated_usrs: "s:29complete_annotateddescription8MyStructV014labelNameParamF00E0yACSizKXE_tKF",
key.modulename: "complete_annotateddescription"
key.modulename: "complete_annotateddescription",
key.sourcetext: ".labelNameParamName(label: <#T##(inout Int) throws -> MyStruct#>)"
},
{
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "paramName(:)",
key.sourcetext: ".paramName(<#T##param: Int##Int#>)",
key.description: "<name>paramName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>param</callarg.param>: <callarg.type><typeid.sys>Int</typeid.sys></callarg.type></callarg>)",
key.typename: "<typeid.sys>Void</typeid.sys>",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0,
key.associated_usrs: "s:29complete_annotateddescription8MyStructV9paramNameyySiF",
key.modulename: "complete_annotateddescription"
key.modulename: "complete_annotateddescription",
key.sourcetext: ".paramName(<#T##param: Int##Int#>)"
},
{
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "sameName(label:)",
key.sourcetext: ".sameName(label: <#T##Int#>)",
key.description: "<name>sameName</name>(<callarg><callarg.label>label</callarg.label>: <callarg.type><typeid.sys>Int</typeid.sys></callarg.type></callarg>)",
key.typename: "<typeid.sys>Void</typeid.sys>",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0,
key.associated_usrs: "s:29complete_annotateddescription8MyStructV8sameName5labelySi_tF",
key.modulename: "complete_annotateddescription"
key.modulename: "complete_annotateddescription",
key.sourcetext: ".sameName(label: <#T##Int#>)"
},
{
key.kind: source.lang.swift.keyword,
key.name: "self",
key.sourcetext: ".self",
key.description: "<keyword>self</keyword>",
key.typename: "<typeid.user>MyStruct</typeid.user>",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0
key.num_bytes_to_erase: 0,
key.sourcetext: ".self"
}
],
key.annotated.typename: 1
Expand All @@ -90,82 +90,82 @@
{
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init()",
key.sourcetext: "init()",
key.description: "<name>init</name>()",
key.typename: "<typeid.user>MyStruct</typeid.user>",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0,
key.associated_usrs: "s:29complete_annotateddescription8MyStructVACycfc",
key.modulename: "complete_annotateddescription"
key.modulename: "complete_annotateddescription",
key.sourcetext: "init()"
},
{
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "labelName(:)",
key.sourcetext: "labelName(<#T##self: MyStruct##MyStruct#>)",
key.description: "<name>labelName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>self</callarg.param>: <callarg.type><typeid.user>MyStruct</typeid.user></callarg.type></callarg>)",
key.typename: "(label: (<attribute>@autoclosure</attribute> () -&gt; <typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Void</typeid.sys>",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0,
key.associated_usrs: "s:29complete_annotateddescription8MyStructV9labelName0E0yS2iyXKXE_tF",
key.modulename: "complete_annotateddescription"
key.modulename: "complete_annotateddescription",
key.sourcetext: "labelName(<#T##self: MyStruct##MyStruct#>)"
},
{
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "labelNameParamName(:)",
key.sourcetext: "labelNameParamName(<#T##self: MyStruct##MyStruct#>)",
key.description: "<name>labelNameParamName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>self</callarg.param>: <callarg.type><typeid.user>MyStruct</typeid.user></callarg.type></callarg>)",
key.typename: "(label: (<keyword>inout</keyword> <typeid.sys>Int</typeid.sys>) <keyword>throws</keyword> -&gt; <typeid.user>MyStruct</typeid.user>) -&gt; <typeid.sys>Void</typeid.sys>",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0,
key.associated_usrs: "s:29complete_annotateddescription8MyStructV014labelNameParamF00E0yACSizKXE_tKF",
key.modulename: "complete_annotateddescription"
key.modulename: "complete_annotateddescription",
key.sourcetext: "labelNameParamName(<#T##self: MyStruct##MyStruct#>)"
},
{
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "paramName(:)",
key.sourcetext: "paramName(<#T##self: MyStruct##MyStruct#>)",
key.description: "<name>paramName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>self</callarg.param>: <callarg.type><typeid.user>MyStruct</typeid.user></callarg.type></callarg>)",
key.typename: "(<typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Void</typeid.sys>",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0,
key.associated_usrs: "s:29complete_annotateddescription8MyStructV9paramNameyySiF",
key.modulename: "complete_annotateddescription"
key.modulename: "complete_annotateddescription",
key.sourcetext: "paramName(<#T##self: MyStruct##MyStruct#>)"
},
{
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "sameName(:)",
key.sourcetext: "sameName(<#T##self: MyStruct##MyStruct#>)",
key.description: "<name>sameName</name>(<callarg><callarg.label>_</callarg.label> <callarg.param>self</callarg.param>: <callarg.type><typeid.user>MyStruct</typeid.user></callarg.type></callarg>)",
key.typename: "(label: <typeid.sys>Int</typeid.sys>) -&gt; <typeid.sys>Void</typeid.sys>",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0,
key.associated_usrs: "s:29complete_annotateddescription8MyStructV8sameName5labelySi_tF",
key.modulename: "complete_annotateddescription"
key.modulename: "complete_annotateddescription",
key.sourcetext: "sameName(<#T##self: MyStruct##MyStruct#>)"
},
{
key.kind: source.lang.swift.keyword,
key.name: "self",
key.sourcetext: "self",
key.description: "<keyword>self</keyword>",
key.typename: "<typeid.user>MyStruct</typeid.user>.Type",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0
key.num_bytes_to_erase: 0,
key.sourcetext: "self"
},
{
key.kind: source.lang.swift.keyword,
key.name: "Type",
key.sourcetext: "Type",
key.description: "<keyword>Type</keyword>",
key.typename: "<typeid.user>MyStruct</typeid.user>.Type",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0
key.num_bytes_to_erase: 0,
key.sourcetext: "Type"
}
],
key.reusingastcontext: 1,
Expand Down
2 changes: 1 addition & 1 deletion test/SourceKit/CodeComplete/complete_big_array.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %sourcekitd-test -req=complete -pos=45:1 %S/../Inputs/big_array.swift -- %S/../Inputs/big_array.swift | %FileCheck %s
// CHECK: key.kind: source.lang.swift.decl.var.global
// CHECK: key.name: "gCubeVertexData"
// CHECK: key.sourcetext: "gCubeVertexData"
// CHECK: key.description: "gCubeVertexData"
// CHECK: key.typename: "[Float]"
// CHECK: key.sourcetext: "gCubeVertexData"
4 changes: 2 additions & 2 deletions test/SourceKit/CodeComplete/complete_cache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ func test2() {
for i in 1...#^VOID_2,fooFunc^# {}
}
// VOID_1: key.name: "fooFuncNoreturn1()",
// VOID_1-NEXT: key.sourcetext:
// VOID_1-NEXT: key.description:
// VOID_1-NEXT: key.typename: "Never",
// VOID_1-NEXT: key.context: source.codecompletion.context.othermodule,
// VOID_1-NEXT: key.moduleimportdepth: 1,
// VOID_1-NEXT: key.num_bytes_to_erase: 0,
// VOID_1-NEXT: key.substructure:
// VOID_1: key.sourcetext:

// VOID_1: key.name: "fooHelperSubFunc1(:)",
// VOID_1-NEXT: key.sourcetext:
// VOID_1-NEXT: key.description:
// VOID_1-NEXT: key.typename: "Int32",
// VOID_1-NEXT: key.context: source.codecompletion.context.othermodule,
// VOID_1-NEXT: key.moduleimportdepth: 2,
// VOID_1-NEXT: key.num_bytes_to_erase: 0,
// VOID_1-NEXT: key.substructure:
// VOID_1: key.sourcetext:

func test3() {
#^VOID_3,fooFunc^# {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
{
key.kind: source.lang.swift.decl.function.constructor,
key.name: "arg1:arg2:",
key.sourcetext: "arg1: <#T##Int#>, arg2: <#T##Int#>",
key.description: "(arg1: Int, arg2: Int)",
key.typename: "Foo",
key.context: source.codecompletion.context.thisclass,
key.typerelation: source.codecompletion.typerelation.unknown,
key.num_bytes_to_erase: 0,
key.associated_usrs: "s:20complete_constructor3FooC4arg14arg2ACSi_Sitcfc",
key.modulename: "complete_constructor"
key.modulename: "complete_constructor",
key.sourcetext: "arg1: <#T##Int#>, arg2: <#T##Int#>"
}
]
}
8 changes: 4 additions & 4 deletions test/SourceKit/CodeComplete/complete_docbrief_1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,26 @@ func test() {
// CHECK-NEXT: {
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
// CHECK-NEXT: key.name: "bar()",
// CHECK-NEXT: key.sourcetext: "bar()",
// CHECK-NEXT: key.description: "bar()",
// CHECK-NEXT: key.typename: "Void",
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.bar",
// CHECK-NEXT: key.context: source.codecompletion.context.superclass,
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
// CHECK-NEXT: key.num_bytes_to_erase: 0,
// CHECK-NEXT: key.associated_usrs: "s:12DocBriefTest1PPAAE3baryyF",
// CHECK-NEXT: key.modulename: "DocBriefTest"
// CHECK-NEXT: key.modulename: "DocBriefTest",
// CHECK-NEXT: key.sourcetext: "bar()"
// CHECK-NEXT: },
// CHECK-NEXT: {
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
// CHECK-NEXT: key.name: "foo()",
// CHECK-NEXT: key.sourcetext: "foo()",
// CHECK-NEXT: key.description: "foo()",
// CHECK-NEXT: key.typename: "Void",
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
// CHECK-NEXT: key.context: source.codecompletion.context.thisclass,
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
// CHECK-NEXT: key.num_bytes_to_erase: 0,
// CHECK-NEXT: key.associated_usrs: "s:12DocBriefTest1SV3fooyyF s:12DocBriefTest1PP3fooyyF",
// CHECK-NEXT: key.modulename: "DocBriefTest"
// CHECK-NEXT: key.modulename: "DocBriefTest",
// CHECK-NEXT: key.sourcetext: "foo()"
// CHECK-NEXT: }
4 changes: 2 additions & 2 deletions test/SourceKit/CodeComplete/complete_docbrief_2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ func test() {
// CHECK-NEXT: {
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
// CHECK-NEXT: key.name: "foo()",
// CHECK-NEXT: key.sourcetext: "foo()",
// CHECK-NEXT: key.description: "foo()",
// CHECK-NEXT: key.typename: "Void",
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
// CHECK-NEXT: key.context: source.codecompletion.context.thisclass,
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
// CHECK-NEXT: key.num_bytes_to_erase: 0,
// CHECK-NEXT: key.associated_usrs: "s:12DocBriefUser1SV3fooyyF s:12DocBriefTest1PP3fooyyF",
// CHECK-NEXT: key.modulename: "DocBriefUser"
// CHECK-NEXT: key.modulename: "DocBriefUser",
// CHECK-NEXT: key.sourcetext: "foo()"
// CHECK-NEXT: }
}
4 changes: 2 additions & 2 deletions test/SourceKit/CodeComplete/complete_docbrief_3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ func test() {
// CHECK-NEXT: {
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
// CHECK-NEXT: key.name: "foo()",
// CHECK-NEXT: key.sourcetext: "foo()",
// CHECK-NEXT: key.description: "foo()",
// CHECK-NEXT: key.typename: "Void",
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
// CHECK-NEXT: key.context: source.codecompletion.context.thisclass,
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
// CHECK-NEXT: key.num_bytes_to_erase: 0,
// CHECK-NEXT: key.associated_usrs: "s:12DocBriefTest1SV3fooyyF s:12DocBriefTest1PP3fooyyF",
// CHECK-NEXT: key.modulename: "DocBriefTest"
// CHECK-NEXT: key.modulename: "DocBriefTest",
// CHECK-NEXT: key.sourcetext: "foo()"
// CHECK-NEXT: }
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ func test() {
// CHECK-NEXT: {
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
// CHECK-NEXT: key.name: "foo()",
// CHECK-NEXT: key.sourcetext: "foo()",
// CHECK-NEXT: key.description: "foo()",
// CHECK-NEXT: key.typename: "Void",
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
// CHECK: key.sourcetext: "foo()"
// CHECK: }
}
2 changes: 1 addition & 1 deletion test/SourceKit/CodeComplete/complete_docbrief_spi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func test() {
// CHECK-NEXT: {
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
// CHECK-NEXT: key.name: "foo()",
// CHECK-NEXT: key.sourcetext: "foo()",
// CHECK-NEXT: key.description: "foo()",
// CHECK-NEXT: key.typename: "Void",
// CHECK-NEXT: key.doc.brief: "This is a doc comment of P.foo",
// CHECK: key.sourcetext: "foo()"
// CHECK: }
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import Foo
// RUN: %sourcekitd-test -req=complete -pos=2:1 %s -- -F %S/../Inputs/libIDE-mock-sdk %s | %FileCheck %s

// CHECK-LABEL: key.name: "fooIntVar",
// CHECK-NEXT: key.sourcetext: "fooIntVar",
// CHECK-NEXT: key.description: "fooIntVar",
// CHECK-NEXT: key.typename: "Int32",
// CHECK-NEXT: key.doc.brief: "Aaa. fooIntVar. Bbb.",
// CHECK-NEXT: key.context: source.codecompletion.context.othermodule,
// CHECK-NEXT: key.typerelation: source.codecompletion.typerelation.unknown,
// CHECK-NEXT: key.num_bytes_to_erase: 0,
// CHECK-NEXT: key.associated_usrs: "c:@fooIntVar",
// CHECK-NEXT: key.modulename: "Foo"
// CHECK-NEXT: key.modulename: "Foo",
// CHECK-NEXT: key.sourcetext: "fooIntVar"
// CHECK-NEXT: },

Loading