Files
swift-mirror/test/SourceKit/CodeComplete/complete_docbrief_2.swift
Alex Hoppen 7ce41252e7 [SourceKit] Print compilerargs and sourcetext keys last
That way, when the request gets truncated by os_log in sourcekit-lsp, we see most of the request. Most likely the sourcetext and the compiler args wouldn't have made it into the log message completely anyway.

rdar://121322828
2024-02-29 20:45:55 -08:00

46 lines
1.5 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/Modules)
// RUN: split-file --leading-lines %s %t
// RUN: %target-swift-frontend \
// RUN: -emit-module \
// RUN: -module-name DocBriefTest \
// RUN: -emit-module-path %t/Modules/DocBriefTest.swiftmodule \
// RUN: -emit-module-doc-path %t/Modules/DocBriefTest.swiftdoc \
// RUN: %t/Module.swift
//--- Module.swift
public protocol P {
/// This is a doc comment of P.foo
///
/// Do whatever.
func foo()
}
//--- User.swift
import DocBriefTest
struct S: P {
func foo() {}
}
func test() {
// RUN: %sourcekitd-test -req=complete -pos=%(line+1):7 %t/User.swift -- %t/User.swift -I %t/Modules -target %target-triple -module-name DocBriefUser | %FileCheck %s -check-prefix=CHECK
S().
// CHECK: {
// CHECK: key.results: [
// CHECK-NEXT: {
// CHECK-NEXT: key.kind: source.lang.swift.decl.function.method.instance,
// CHECK-NEXT: key.name: "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.sourcetext: "foo()"
// CHECK-NEXT: }
}