forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomplete_pound_decl.swift
54 lines (42 loc) · 1.87 KB
/
complete_pound_decl.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Testing #if condition does not disturb code completion
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=POUND_IF_MEMATTR | %FileCheck %s -check-prefix=ATTR
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=POUND_IF_MEMBER | %FileCheck %s -check-prefix=MEMBER
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=POUND_ELSE_MEMBER | %FileCheck %s -check-prefix=MEMBER
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=POUND_ELSE_MEMATTR | %FileCheck %s -check-prefix=ATTR
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=POUND_IF_GBLATTR | %FileCheck %s -check-prefix=ATTR
// FIXME: SR-2364 the following line triggers an assertion
// RUN_DISABLED: not --crash %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=POUND_IF_GBLNAME
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=POUND_ELIF_GBLNAME | %FileCheck %s -check-prefix=GLOBAL
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=POUND_ELIF_GBLATTR | %FileCheck %s -check-prefix=ATTR
// MEMBER: Begin completions
// MEMBER: override func foo() {|}; name=foo()
// MEMBER: End completions
// ATTR: Begin completions
// ATTR: available[#Func Attribute#]; name=available
// ATTR: End completions
// GLOBAL: Begin completions
// GLOBAL: Foo[#Foo#]; name=Foo
// GLOBAL: End completions
class Foo {
func foo() {}
}
class Bar : Foo {
#if true
@#^POUND_IF_MEMATTR^#
func f1() {}
#^POUND_IF_MEMBER^#
#else
#^POUND_ELSE_MEMBER^#
@#^POUND_ELSE_MEMATTR^#
func f1() {}
#endif
}
#if true
@#^POUND_IF_GBLATTR^#
func bar() {}
#^POUND_IF_GBLNAME^#
#elseif false
#^POUND_ELIF_GBLNAME^#
@#^POUND_ELIF_GBLATTR^#
func bar() {}
#endif