Files
swift-mirror/test/SourceKit/CodeComplete/complete_name.swift
Ben Langmuir b4ce34aba9 [CodeCompletion] Remove ... and & from function filter names
The filter name of a function should match the spelling of the function
name according to the language except that we don't insert _ for unnamed
parameters because underscores are legal inside identifiers and we don't
want to introduce spurious matches (also, we keep the () on a
parameterless function for disambiguation).

rdar://problem/26118915
2016-05-10 11:13:45 -07:00

21 lines
595 B
Swift

// RUN: %complete-test -raw -tok=INIT_NAME %s | FileCheck %s -check-prefix=INIT_NAME
// RUN: %complete-test -raw -tok=METHOD_NAME %s | FileCheck %s -check-prefix=METHOD_NAME
struct S {
init(a: Int, b: Int, _ c: Int) {}
init(_ a: Int, _ b: Int) {}
func foo1(_ a: Int, _ b: Int, _ c: Int, _ d: Int..., _ e: inout Int) {}
func foo2(a a: Int, b: Int, c: Int, d: Int..., e: inout Int) {}
}
func test01() {
S(#^INIT_NAME^#)
}
// INIT_NAME: key.name: "a:b::)"
func test02(_ x: S) {
x.#^METHOD_NAME^#
}
// METHOD_NAME: key.name: "foo1(:::::)"
// METHOD_NAME: key.name: "foo2(a:b:c:d:e:)"