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 @@ -139,7 +139,7 @@ import SwiftSyntax
139139 switch Syntax ( syntax) . as ( SyntaxEnum . self) {
140140 case . variableDecl( let variableDecl) :
141141 variableDecl. bindings. flatMap { binding in
142- getNames ( from: binding. pattern, accessibleAfter: accessibleAfter)
142+ getNames ( from: binding. pattern, accessibleAfter: accessibleAfter != nil ? binding . endPositionBeforeTrailingTrivia : nil )
143143 }
144144 case . tuplePattern( let tuplePattern) :
145145 tuplePattern. elements. flatMap { tupleElement in
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ final class testNameLookup: XCTestCase {
5050 source: """
5151 for i in 1..<4 {
5252 let (1️⃣a, 2️⃣b) = (1, 2)
53- let 3️⃣c = 3, 4️⃣d = 4
53+ let 3️⃣c = 3, 4️⃣d = 9️⃣c
5454
5555 5️⃣a
5656 6️⃣b
@@ -63,6 +63,7 @@ final class testNameLookup: XCTestCase {
6363 " 6️⃣ " : [ . fromScope( CodeBlockSyntax . self, expectedNames: [ " 2️⃣ " ] ) ] ,
6464 " 7️⃣ " : [ . fromScope( CodeBlockSyntax . self, expectedNames: [ " 3️⃣ " ] ) ] ,
6565 " 8️⃣ " : [ . fromScope( CodeBlockSyntax . self, expectedNames: [ " 4️⃣ " ] ) ] ,
66+ " 9️⃣ " : [ . fromScope( CodeBlockSyntax . self, expectedNames: [ " 3️⃣ " ] ) ] ,
6667 ] ,
6768 expectedResultTypes: . all( IdentifierPatternSyntax . self)
6869 )
You can’t perform that action at this time.
0 commit comments