-
Notifications
You must be signed in to change notification settings - Fork 28k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vscode-references-view does not de-duplicate results like the built in ReferencesModel #117095
Comments
This commit de-duplicates reference location results in the same way that the built-in 'go to references'/peek references behavior does. The built-in "go to references" command in vscode uses the `ReferencesModel` to de-duplicate reference results: https://github.com/microsoft/vscode/blob/36dd567011eda09317a76d5dcb820fa9961eb786/src/vs/editor/contrib/gotoSymbol/referencesModel.ts#L171-L182 Equal uri's and ranges constitute duplicate results: https://github.com/microsoft/vscode/blob/36dd567011eda09317a76d5dcb820fa9961eb786/src/vs/editor/contrib/gotoSymbol/referencesModel.ts#L293-L295 fix microsoft/vscode#117095
This commit de-duplicates reference and other location results from API endpoints `executeDefinitionProvider`, `executeDeclarationProvider`, `executeImplementationProvider`, `executeTypeDefinitionProvider`, and `executeReferenceProvider` (all commands registered in `goToSymbol.ts` which share the `getLocationsLinks` helper). Previously, this work was only done in the `ReferencesModel` which is used by the `editor.action.findReferences` command. Extensions which called the `vscode.executeReferenceProvider` would still get the duplicate results. fix microsoft#117095
Hi @jrieken, I was wondering what the ETA for a fix for this would be (#117424 if approved). We're getting a lot of reports in the Angular Language Service extension repo for duplicate results in "find all references". If this will take some time to agree on a fix and get it into a release, I think we'll want to implement a workaround on our end for now. Thanks for your help! |
…uests VSCode only de-duplicates references results for "go to references" requests but does not de-duplicate them for "find all references" requests. The result is that users see duplicate references for results in TypeScript files - one from the built-in TS extension and one from us. While this is an issue in VSCode (see microsoft/vscode#117095) this commit provides a quick workaround on our end until it can be addressed there. This commit should be reverted when microsoft/vscode/issues/117095 is resolved. fixes angular/vscode-ng-language-service#1124
…uests VSCode only de-duplicates references results for "go to references" requests but does not de-duplicate them for "find all references" requests. The result is that users see duplicate references for results in TypeScript files - one from the built-in TS extension and one from us. While this is an issue in VSCode (see microsoft/vscode#117095) this commit provides a quick workaround on our end until it can be addressed there. This commit should be reverted when microsoft/vscode/issues/117095 is resolved. fixes angular/vscode-ng-language-service#1124
…uests (#41041) VSCode only de-duplicates references results for "go to references" requests but does not de-duplicate them for "find all references" requests. The result is that users see duplicate references for results in TypeScript files - one from the built-in TS extension and one from us. While this is an issue in VSCode (see microsoft/vscode#117095) this commit provides a quick workaround on our end until it can be addressed there. This commit should be reverted when microsoft/vscode/issues/117095 is resolved. fixes angular/vscode-ng-language-service#1124 PR Close #41041
…uests (#41041) VSCode only de-duplicates references results for "go to references" requests but does not de-duplicate them for "find all references" requests. The result is that users see duplicate references for results in TypeScript files - one from the built-in TS extension and one from us. While this is an issue in VSCode (see microsoft/vscode#117095) this commit provides a quick workaround on our end until it can be addressed there. This commit should be reverted when microsoft/vscode/issues/117095 is resolved. fixes angular/vscode-ng-language-service#1124 PR Close #41041
fix #117095 de-duplicate reference results
@jrieken what's a good way to verify this? |
Hi @RMacfarlane - I can verify this today. You'd need to know about an extension that provides reference results that would be duplicates of another extension and then run the "find all references" action from the built in Reference Search View extension (which does not de-duplicate results) I can verify this with the angular language service by reverting angular/angular@10aa564 |
/verified |
Thanks @atscott! |
The built-in "go to references" command in vscode uses the
ReferencesModel
to de-duplicate reference results:vscode/src/vs/editor/contrib/gotoSymbol/referencesModel.ts
Lines 171 to 182 in 36dd567
Equal uri's and ranges constitute duplicate results:
vscode/src/vs/editor/contrib/gotoSymbol/referencesModel.ts
Lines 293 to 295 in 36dd567
The
ReferencesModel
of the extension does not de-duplicate results at all, but instead always pushes each location to the containingFileItem
's references list: https://github.com/microsoft/vscode-references-view/blob/f1b526b39c97981c81d52a98d6e66f8f699dc38a/src/references/model.ts#L73The text was updated successfully, but these errors were encountered: