For some symbols, `gd` jumps to a wrong location several seconds after jumping to the correct definition.
Describe the bug For some symbols, 'gd' jumps to the end of the file containing the real definition. Following c-o will jump back to the beginning of the file.
To Reproduce Steps to reproduce the behavior:
- Navigate to a symbol (I'm browsing C++ code) and press 'gd' to jump to the definition.
- Cursor will jump to the definition correctly.
- Wait for about 3 seconds without any further inputs, the cursor will then jump to the end of the file.
- Press c-o will jump to the beginning of the file.
- Press c-o again will jump back to the end of the file.
- Press c-o the third time will jump back to where 'gd' is issued.
Expected behavior F12 and Alt+Left Arrow works correctly. 'gd' and c-o should jump to the correct locations.
Screenshots If applicable, add screenshots to help explain your problem. If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim#debugging-remappings.
Environment (please complete the following information):
- Extension (VsCodeVim) version: 1.8.1
- VSCode version: 1.35.0 - insider / 1.34.0
- OS: Win10 64
Additional context Add any other context about the problem here.
Here is the log in the developers console when I hit the bug:
[Extension Host] ModeHandler: debug: handling key=g.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=g. mode=Normal. keybindings=normalModeKeyBindingsMap.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=g. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
workbench.main.js:238 [Extension Host] ModeHandler: debug: handling key=d.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=d. mode=Normal. keybindings=normalModeKeyBindingsMap.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=d. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
workbench.main.js:238 [Extension Host] VimState: warn: invalid cursor position. [ [2555, 56] | [2555, 56]].
workbench.main.js:238 [Extension Host] VimState: warn: invalid cursor start position. [2555, 56].
workbench.main.js:238 [Extension Host] ModeHandler: debug: handling key=
[2555,56] is acutally the line and column where I pressed 'gd'. The first warning is triggered about 3 seconds after the cursor jumps to the correct location.
I thing this is a "codelen" problem. I prevented this problem by closeing codelen .
setting.json
"editor.codeLens": false,
See the codelen feature in release notes: 1.34.0
And I found all move 'j', 'k', 'c-d' etc will be obvious delayed after 'gd'. The native go-to-definition(f12) has not this trouble. Hope to improve this so that I don't have to wait a few milliseconds before moving.
I'm also seeing this behaviour. disabling code lens fixes it for me but I use code lens all the time so I'd rather not disable it. i was able to solve the problem by mapping over the gd command, (and adding a gp command for fun):
{
"before": ["g", "p"],
"commands": ["editor.action.peekDefinition"]
},
{
"before": ["g", "d"],
"commands": ["editor.action.revealDefinition"]
},
This work-around, rebinding gd in the proposed way seems to work fine for me, too.
Same issue, but unfortunately, rebinding gd doesn't work for me. Does anyone have any other workaround?