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