microsoft/vscode

TypeScript: References include definition, which breaks `"editor.gotoLocation.multipleReferences": "goto"` usage

talks2much opened this issue · 4 comments

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: insider
  • OS Version: Windows

Steps to Reproduce:

  1. Set "editor.gotoLocation.multipleReferences": "goto" setting
  2. Create untitled TypeScript file:
const test = () => {}
test()
test()
  1. Ctrl+clicking test on first line or execute Go to References command

Expected: focus on line 2
Actual: stays on the same position

References provide isn't being called on Go to References command, but specifically TypeScript extension still includes definition into references. I hope you take this issue as it is really annoying, there is absolutely no need to do this + I can call definitions manually when I want.

I was just curios why its happening only with TypeScript extension and it seems that:

if (!options.includeDeclaration && ref.isDefinition) {

const result = await provider.provideReferences(model, position, { includeDeclaration: true }, token);

Its hardcoded here, there is no way to disable it even not via API,

And finally this change was also not clear for me

c4d6481#diff-d897e7805588a8bb44eb7cb12ae2d505658e8c29b8c4bd7625233b6dedbb90bb

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.

Happy Coding!

I'm sorry to mention you here @robeady but it seems to be closed in favor of your #114673 did you a find a solution since then? We're personally using extension to workaround that. 😞

no, I didn't, but I don't know if the issue I reported has been fixed since I last checked in on it