Files
swift-mirror/test/SourceKit/CodeComplete/complete_call_pattern.swift
Alex Hoppen 17520dcf6d [CodeCompletion] Always suggest call pattern for nested function calls
When completing in cases like `bar(arg: foo(|, option: 1)`, we don’t know if `option` belongs to the call to `foo` or `bar`. Be defensive and also suggest the signature.
2024-02-21 18:53:07 -08:00

15 lines
355 B
Swift

struct S {
init(foo: Int) {}
}
func takeS(_: S, other: Int) {}
func test() {
takeS(S(, other: 2)
}
// RUN: %sourcekitd-test -req=complete -pos=7:11 %s -- %s | %FileCheck %s
// RUN: %sourcekitd-test -req=complete.open -pos=7:11 %s -- %s | %FileCheck %s
// CHECK: key.kind: source.lang.swift.decl.function.constructor
// CHECK-NEXT: key.name: "foo:"