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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ATTRIBUTE_LIST_1 | %FileCheck %s -check-prefix=ATTRIBUTE_LIST
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ATTRIBUTE_LIST_2 | %FileCheck %s -check-prefix=ATTRIBUTE_LIST
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ATTRIBUTE_LIST_3 | %FileCheck %s -check-prefix=ATTRIBUTE_LIST
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ATTRIBUTE_LIST_4 | %FileCheck %s -check-prefix=ATTRIBUTE_LIST
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PRECEDENCE_GROUP_1 | %FileCheck %s -check-prefix=PRECEDENCE_GROUP
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PRECEDENCE_GROUP_2 | %FileCheck %s -check-prefix=PRECEDENCE_GROUP
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PRECEDENCE_GROUP_3 | %FileCheck %s -check-prefix=PRECEDENCE_GROUP
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PRECEDENCE_GROUP_4 | %FileCheck %s -check-prefix=PRECEDENCE_GROUP
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PRECEDENCE_GROUP_5 | %FileCheck %s -check-prefix=PRECEDENCE_GROUP
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PRECEDENCE_GROUP_1 %S/Inputs/precedencegroup_multifile.swift | %FileCheck %s -check-prefix=PRECEDENCE_GROUP_MULTIFILE
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PRECEDENCE_GROUP_CURRFILE | %FileCheck %s -check-prefix=PRECEDENCE_GROUP_CURRFILE
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ASSOCIATIVITY_1 | %FileCheck %s -check-prefix=ASSOCIATIVITY
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ASSOCIATIVITY_2 | %FileCheck %s -check-prefix=ASSOCIATIVITY
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ASSIGNMENT_1 | %FileCheck %s -check-prefix=ASSIGNMENT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ASSIGNMENT_2 | %FileCheck %s -check-prefix=ASSIGNMENT
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GLOBAL_EXPR | %FileCheck %s -check-prefix=PRECEDENCE_GROUP_NEGATIVE
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GLOBAL_TYPE | %FileCheck %s -check-prefix=PRECEDENCE_GROUP_NEGATIVE
infix operator +++: #^PRECEDENCE_GROUP_1^#
precedencegroup MyPrecedence1 {
#^ATTRIBUTE_LIST_1^#
}
precedencegroup MyPrecedence2 {
associativity: left #^ATTRIBUTE_LIST_2^#
}
precedencegroup MyPrecedence3 {
higherThan: AdditionPrecedence
lowerThan: MultiplicationPrecedence
#^ATTRIBUTE_LIST_3^#
}
precedencegroup MyPrecedence4 {
assignment: true
#^ATTRIBUTE_LIST_4^#
higherThan: AdditionPrecedence
associativity: right
lowerThan: MultiplicationPrecedence
}
precedencegroup MyPrecedence5 {
associativity: #^ASSOCIATIVITY_1^#
assignment: false
}
precedencegroup MyPrecedence6 {
associativity: left
lowerThan: #^PRECEDENCE_GROUP_2^#
higherThan: AdditionPrecedence
}
precedencegroup MyPrecedence7 {
associativity: none
assignment: false
lowerThan: AdditionPrecedence
higherThan: #^PRECEDENCE_GROUP_3^#
}
precedencegroup MyPrecedence8 {
associativity: right
assignment: #^ASSIGNMENT_1^#
}
precedencegroup MyPrecedence9 {
higherThan: AdditionPrecedence, #^PRECEDENCE_GROUP_4^#
}
// Test that we have completions despite successive attributes being invalid
precedencegroup MyPrecedence10 {
associativity: #^ASSOCIATIVITY_2^#
assignment: 5
higherTh:
}
precedencegroup MyPrecedence11 {
assignment: #^ASSIGNMENT_2^#
lower:
associativity: true
}
precedencegroup MyPrecedence12 {
higherThan: #^PRECEDENCE_GROUP_5^#
associativity: 3
lowerTh:
}
infix operator ---: #^PRECEDENCE_GROUP_CURRFILE^#
func testExpr() {
_ = #^GLOBAL_EXPR^#
}
func testType() {
let _: #^GLOBAL_TYPE^#
}
// ATTRIBUTE_LIST: Begin completions, 4 items
// ATTRIBUTE_LIST: Keyword/None: associativity; name=associativity
// ATTRIBUTE_LIST: Keyword/None: higherThan; name=higherThan
// ATTRIBUTE_LIST: Keyword/None: lowerThan; name=lowerThan
// ATTRIBUTE_LIST: Keyword/None: assignment; name=assignment
// ASSOCIATIVITY: Begin completions, 3 items
// ASSOCIATIVITY: Keyword/None: none; name=none
// ASSOCIATIVITY: Keyword/None: left; name=left
// ASSOCIATIVITY: Keyword/None: right; name=right
// ASSIGNMENT: Begin completions, 2 items
// ASSIGNMENT: Keyword[false]/None: false; name=false
// ASSIGNMENT: Keyword[true]/None: true; name=true
// PRECEDENCE_GROUP-DAG: Decl[PrecedenceGroup]/OtherModule[Swift]/IsSystem: AssignmentPrecedence; name=AssignmentPrecedence
// PRECEDENCE_GROUP-DAG: Decl[PrecedenceGroup]/OtherModule[Swift]/IsSystem: ComparisonPrecedence; name=ComparisonPrecedence
/* FIXME: (https://github.com/apple/swift/issues/51404) We only see precedence groups that are earlier in life! */
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_MULTIFILE: Decl[PrecedenceGroup]/CurrModule: PrecedenceGroupOtherFile; name=PrecedenceGroupOtherFile
// PRECEDENCE_GROUP_NEGATIVE-NOT: Decl[PrecedenceGroup]
|