For some symbols, `gd` jumps to a wrong location several seconds after jumping to the correct definition.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
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=.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=. mode=Normal. keybindings=normalModeKeyBindingsMap.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
workbench.main.js:238 [Extension Host] ModeHandler: debug: handling key=.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=. mode=Normal. keybindings=normalModeKeyBindingsMap.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
workbench.main.js:238 [Extension Host] VimState: warn: invalid cursor stop position. [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=.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=. mode=Normal. keybindings=normalModeKeyBindingsMap.
workbench.main.js:238 [Extension Host] Remapper: debug: trying to find matching remap. keys=. mode=Normal. keybindings=normalModeKeyBindingsNonRecursiveMap.
workbench.main.js:238 [Extension Host] getCursorsAfterSync: warn: getCursorsAfterSync: selection not updated within 0ms.
[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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the delayed jump using gd on a C++ symbol, then inspect the gd and c-o handling associated with the logged invalid cursor positions. Done means the cursor remains at the correct definition after the delay and c-o returns through the expected locations without invalid-position warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100