MaskRay / vscode-ccls

ccls plugin for Visual Studio Code
123 stars 37 forks source link

F12 go to definition does not work, but ctrl+click works #66

Closed mkitby closed 5 years ago

mkitby commented 5 years ago

Observed behavior

F12 go to definition does not work sometimes, but ctrl+click works.

System information

MaskRay commented 5 years ago

Tried https://github.com/MaskRay/ccls/wiki/Visual-Studio-Code#using-vscode-ccls-along-side-vscode-cpptools-extension-for-debugger-support ?

mkitby commented 5 years ago

If the function is selected and highlighted by double clicking and it's not the only one highlighted symbol , then the F12 will not work. Is this expected?

bengtj commented 4 years ago

I realized that I had the the same issue. Looking up a symbol does not work if the cursor is after the last character in a typename. Which it is if you doubleclick the typename word.

This makes it very confusing as it can be in the muscle memory to double-click the word and then you think that the index does not work when using F12. But it actually works if right-clicking as you put the cursor where you right-click inside the typename word.

The really strange thing is that you get a tooltip from vscode with "No definition found 'typename'" where the typename is the correct typename. So it feels like the correct typename should've been sent to ccls as well.