-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
cmd+click
symbol definition to find all references does not work in vim mode
#10392
Comments
I wonder whether this is reproducible by others? |
Yeah, I can reproduce it. |
I investigated the code. The current implementation: after cmd+clicking, if definition is found, check whether the selected definition range covers where the cursor previously was before the definition is revealed (if definition is not revealed elsewhere, it is revealed right here, so I am clicking right on the definition, so let's do FindAllReference). zed/crates/editor/src/hover_links.rs Lines 215 to 253 in c81eb41
This is working fine when vim mode is false. However, when vim mode is enabled, |
Should vim go to VISUAL mode when jumping to definition? |
Hmmm, I'm not sure but that sounds wrong. I wonder whether we could change the check to say that |
…10684) Exclude go-to-definition links returned by LSP that points to the current cursor position. This fixes #10392 . Related PR #9243 . The previous implementation first performs go-to-definition, and if the selected text covers the clicked position, it figures out that it is already clicking on a definition, and should instead look for references. However, the selected range does not necessarily cover the clicked position after clicking on a definition, as in VIM mode. After the PR, if cmd+click on definitions, the definition links would be an empty list, so no go-to-definition is performed, and find-all-references is performed instead. Release Notes: - Fixed #10392 , now `cmd+click`ing to find all references works in vim mode.
Check for existing issues
Describe the bug / provide steps to reproduce it
When
"vim_mode": true
,cmd + click
onlyGoToDefinition
but does notFindAllReference
when clicking on def (in INSERT or NORMAL mode).If vim mode is disabled, however, the bidirectional
cmd + click
works properly.2024-04-11.09.24.52.mov
__
Environment
Zed: v0.131.1 (Zed Preview)
OS: macOS 14.4.1
Memory: 16 GiB
Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
Bidirectional
cmd + click
should work also in vim mode. Related #9259 .If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.No response
The text was updated successfully, but these errors were encountered: