File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1347,26 +1347,23 @@ export function findReferences(
1347
1347
if ( ! node || node . type !== "id" ) return [ ] ;
1348
1348
1349
1349
const identifier = getNodeText ( document , node ) ;
1350
- const references : Location [ ] = [ ] ;
1351
1350
1352
1351
// [TODO]: Exclude false positives, i.e. occurrences
1353
1352
// of the name that are bound by different lambdas
1354
1353
// using the same identifier for their parameter
1355
1354
1356
1355
// Find all occurrences of this identifier
1357
- walkTree ( tree . rootNode , ( currentNode ) => {
1356
+ return walkTreeFlatMapping ( tree . rootNode , ( currentNode ) => {
1358
1357
if (
1359
1358
currentNode . type === "id" &&
1360
1359
getNodeText ( document , currentNode ) === identifier
1361
1360
) {
1362
- references . push ( {
1361
+ return [ {
1363
1362
uri : document . uri ,
1364
1363
range : nodeToRange ( currentNode ) ,
1365
- } ) ;
1366
- }
1364
+ } ] ;
1365
+ } else return [ ] ;
1367
1366
} ) ;
1368
-
1369
- return references ;
1370
1367
}
1371
1368
1372
1369
export function prepareRename (
You can’t perform that action at this time.
0 commit comments