File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Sources/SwiftLexicalLookup
Tests/SwiftLexicalLookupTest Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ import SwiftSyntax
132
132
switch Syntax ( syntax) . as ( SyntaxEnum . self) {
133
133
case . variableDecl( let variableDecl) :
134
134
variableDecl. bindings. flatMap { binding in
135
- getNames ( from: binding. pattern, accessibleAfter: accessibleAfter)
135
+ getNames ( from: binding. pattern, accessibleAfter: accessibleAfter != nil ? binding . endPositionBeforeTrailingTrivia : nil )
136
136
}
137
137
case . tuplePattern( let tuplePattern) :
138
138
tuplePattern. elements. flatMap { tupleElement in
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ final class testNameLookup: XCTestCase {
50
50
source: """
51
51
for i in 1..<4 {
52
52
let (1️⃣a, 2️⃣b) = (1, 2)
53
- let 3️⃣c = 3, 4️⃣d = 4
53
+ let 3️⃣c = 3, 4️⃣d = 9️⃣c
54
54
55
55
5️⃣a
56
56
6️⃣b
@@ -63,6 +63,7 @@ final class testNameLookup: XCTestCase {
63
63
" 6️⃣ " : [ . fromScope( CodeBlockSyntax . self, expectedNames: [ " 2️⃣ " ] ) ] ,
64
64
" 7️⃣ " : [ . fromScope( CodeBlockSyntax . self, expectedNames: [ " 3️⃣ " ] ) ] ,
65
65
" 8️⃣ " : [ . fromScope( CodeBlockSyntax . self, expectedNames: [ " 4️⃣ " ] ) ] ,
66
+ " 9️⃣ " : [ . fromScope( CodeBlockSyntax . self, expectedNames: [ " 3️⃣ " ] ) ] ,
66
67
] ,
67
68
expectedResultTypes: . all( IdentifierPatternSyntax . self)
68
69
)
You can’t perform that action at this time.
0 commit comments