Files
swift-mirror/test/SourceKit/CodeComplete/complete_call_pattern.swift
Ben Langmuir 36d7acd1fa [code-complete] Set call-arg-heuristics flag in SourceKit
In the new code-completion path, expose an option to control this
behaviour; in the old path turn it off.

rdar://31113161
2017-12-18 13:20:24 -08:00

21 lines
881 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 -check-prefix=CALL_PATTERN
// CALL_PATTERN: key.kind: source.lang.swift.decl.function.constructor
// RUN: %sourcekitd-test -req=complete.open -pos=7:11 %s -- %s | %FileCheck %s -check-prefix=NO_PATTERN
// NO_PATTERN-NOT: key.kind: source.lang.swift.decl.function.constructor
// RUN: %sourcekitd-test -req=complete.open -req-opts=callpatternheuristics=1 -pos=7:11 %s -- %s | %FileCheck %s -check-prefix=NO_PATTERN
// NO_PATTERN-NOT: key.kind: source.lang.swift.decl.function.constructor
// RUN: %sourcekitd-test -req=complete.open -req-opts=callpatternheuristics=0 -pos=7:11 %s -- %s | %FileCheck %s -check-prefix=CALL_PATTERN
// NO_PATTERN-NOT: key.kind: source.lang.swift.decl.function.constructor