Selecting word makes CTRL + Click -> "Go to Definition" stop working
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.100.2
- OS Version: Windows 11 Pro
Steps to Reproduce:
- Create a
.pyfile with the following content:
class AA:
pass
class B(AA):
pass
- Select
AAon line 4 (insideB(AA)) - Use CTRL + Click (F12 and context menu work normally)
- See that the cursor doesn't move to the declaration
If you unselect AA, the command works as expected.
I can also reproduce this in Dart, it is not a language-specific problem.
https://github.com/user-attachments/assets/1c2b5ed7-1701-4132-9bf8-f3f14bb4ec49
This example is inside the Dart SDK:
https://github.com/user-attachments/assets/19c2d69d-6383-402f-b504-da9d0124e208
The first time I noticed it and tried screen recording for this issue, the issue stopped occurring. I had a break and put my computer in Sleep/Hibernate (not Suspended) mode, and when I came back, I could reproduce this fine again. Maybe something to do with that? I have no idea.
CC @DanTup
If you unselect AA, the command works as expected.
Can you put the curser after the AA, like AA| and try the F12 way
can confirm it is a timing based issue
- double click word
- hold ctrl and left click mouse i. clicking too fast results in entire line highlighted ii. clicking too slow results in ctrl+click working iii. clicking right in-between results in a de-selection of the word and no jumping
https://github.com/user-attachments/assets/d2ab277c-3e54-48ad-bd3b-f93018b922b8
~~I can confirm that the underline (and blue highlight) doesn't work until you move the mouse~~ ~~however ctrl+click still works correctly~~
~~can you show with workbench.action.toggleScreencastMode enabled please?~~
~~what other languages have you tried?~~
~~both Dart and Python come from extensions~~
If you unselect AA, the command works as expected.
Can you put the curser after the AA, like
AA|and try the F12 way
Both F12 and context menu (RMB) work as expected everytime (I've not tried but I guess command pallet would work too).
The first time I found this was when using Find buttons for next/previous (it highlights all similar in file and selects the current one).
I have the same problem. Moreover, using the F12 shortcut key doesn't work, and the "go to definition" option doesn't appear when I right - click the mouse.
I know why the jump is invalid. In the.vscode\settings.json file in the project folder, the "python.languageServer": "None" must be deleted, and then all interpretations and jumps will be restored.
I think I figured out what is causing this for me. The problem is that it has no idea if I'm using:
-
Select +
CTRL+ LMB down + Move (copy selection where the LMB up happens) -
CTRL+Click(Go to definition)
I'm not sure how we can handle that better. Probably what @RedCMD said before about timings (thanks for looking at this) has some influence in replicating this. Maybe also consider if the cursor moved (or if it currently does, increase the minimum delta - maybe to outside the selected area).