language-tools: Double click to show all occurrences in scrollbar is broken
Vue - Official extension or vue-tsc version
2.1.6
VSCode version
1.93.1
Vue version
2.7.16
TypeScript version
5.5.4 / 5.6.2
System Info
System:
OS: Windows 11 10.0.22631
CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Memory: 28.76 GB / 47.81 GB
Binaries:
Node: 20.17.0 - C:\Program Files\nodejs\node.EXE
npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
pnpm: 9.10.0 - ~\AppData\Roaming\npm\pnpm.CMD
Browsers:
Edge: Chromium (123.0.2420.97)
Internet Explorer: 11.0.22621.3527
package.json dependencies
No response
Steps to reproduce
Double click the name of a function in a .vue file. Previously, all occurrences were highlighted in the scrollbar of VS code. Now the highlighting in the scrollbar is missing and can only be seen in the document.
When I double click the name of a function in a .ts file, scrollbar highlighting is still working as expected.
What is expected?
Show highlighting for occurrences in scrollbar
What is actually happening?
Highlighting is missing
Link to minimal reproduction
No response
Any additional comments?
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 17 (4 by maintainers)
Vue language server and tsserver both provide highlight information, VSCode will show the highlights returned by both servers at the same time in the past, but since a certain version, VSCode only shows the highlights returned by the Vue language server for .vue files, which is the cause of the problem.
With #5263, Vue language server will also return highlights from tsserver, but due to the limitation of LSP, it doesn’t support to return highlights from multiple files, it can’t support
editor.occurrencesHighlight: multiFileat the moment.@alexchexes Thank you for a prompt and thorough check on your side! Indeed, you are right to point out the difference in our
editor.occurrencesHighlightsetting. I’ve had it set tomultiFilemerely as a workaround pointed at in this ticket above, don’t need multi file highlight either. However, as others have pointed above, that workaround breaks on vs code restart until you toggle tosingleFileand back again(which is annoying, hence I was looking for another fix)The workaround with
"vue.server.hybridMode": "typeScriptPluginOnly"indeed was not working for me due tomultiFile, but works great withsingleFile, after restarts as well, which I’ll be using for the timebeing.Indeed, @KazariEX’s https://github.com/vuejs/language-tools/pull/5263/ seems like it would do the trick, though at a glance(I might be wrong) it does not look like it would support
multiFilehighlight either if anyone actually cares about it.At first, I downgraded too, but then I noticed that the “Go to definition” feature doesn’t work inside <template>, and some variable references didn’t work either. Eventually, I updated to the latest version (2.2.0 as of now) and, to make occurrences highlighting work, added this setting to my VS Code settings:
Now, 2.2.0 works pretty well. I haven’t noticed problems that I experienced before, yet, although I mainly work with JS, not TS right now.
I find that if I roll back VSCode to 1.92.x, it works again.
Adding screenshots for clarity (we are also seeing this issue):
When hybrid mode is enabled:
When hybrid mode is disabled:
Noticed something similar as well. Though it’s for single click occurrences highlight.
This feature is controlled via
editor.occurrencesHighlightVS Code setting. After additional investigation:"editor.occurrencesHighlight": "single"- works in .ts files, doesn’t work in .vue files"editor.occurrencesHighlight": "multiFile"- works in .ts and .vue filesVS Code:
Vue Extension v2.1.6. TS: 5.5.4, Hybrid mode enabled
Anything else I can provide to help resolve this?