Skip to content
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

Moving cursor on a symbol using keyboard doesn't show occurrences of the symbol #225065

Closed
ulugbekna opened this issue Aug 7, 2024 · 8 comments · Fixed by #225447
Closed

Moving cursor on a symbol using keyboard doesn't show occurrences of the symbol #225065

ulugbekna opened this issue Aug 7, 2024 · 8 comments · Fixed by #225447
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-highlight Editor selection/word highlight issues

Comments

@ulugbekna
Copy link
Contributor

Repro:

  1. Move cursor around using keyboard and put it on a variable name that's used somewhere in the code
CleanShot.2024-08-07.at.17.00.31.mp4

Version: 1.93.0-insider
Commit: d4c4e69
Date: 2024-08-07T05:03:47.999Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.5.0

@jrieken jrieken assigned Yoyokrazy and unassigned jrieken Aug 7, 2024
@Yoyokrazy Yoyokrazy added bug Issue identified by VS Code Team member as probable bug editor-highlight Editor selection/word highlight issues info-needed Issue requires more information from poster labels Aug 7, 2024
@Yoyokrazy
Copy link
Contributor

Yoyokrazy commented Aug 7, 2024

Could you check your settings related to word highlighting? I'm unable to repro this on my local machine. Settings to check:

  • editor.occurrencesHighlight
  • editor.selectionHighlight (shouldn't be related, but just in case)

Also, does this repro on stable at all?

(latest insiders as of 11am PT aug 7th)

20240807-1832-14.7937027.mp4

@Yoyokrazy Yoyokrazy removed the bug Issue identified by VS Code Team member as probable bug label Aug 7, 2024
@ulugbekna
Copy link
Contributor Author

Hm, I can repro only with the Vim extension (vscodevim.vim) installed, but the problem is that the vim ext hasn't updated since May and this doesn't repro on stable 1.92, so there must be some regression in insiders. I also can repro with all settings removed.

@Yoyokrazy Yoyokrazy added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Aug 8, 2024
@ulugbekna
Copy link
Contributor Author

ulugbekna commented Aug 9, 2024

@Yoyokrazy occurrences highlighting is broken NOT only with vim, which I think makes it an important bug. It should be reasonably easy to track down the bug with vscode-bisect

Repro:

  1. Move cursor onto a symbol for which you want occurrences using arrow keys
  2. Move cursor within the symbol - 🐛 the highlighting remains for a second and then disappears

The demo below first shows behavior in stable then insiders:

CleanShot.2024-08-09.at.11.38.45.mp4

@ulugbekna
Copy link
Contributor Author

ulugbekna commented Aug 12, 2024

This's the #224415 that introduced the regression based on vscode-bisecting'ing it. It would be great to either fix this bug or revert that PR as a short-term work around because it's such an important feature.

[build] c0331c8 is the first bad commit after 6f2764a.

All changes in that build:

6f2764a...c0331c8

@Yoyokrazy
Copy link
Contributor

@ulugbekna thanks for the dig into this! taking care of this in the AM, should have it resolved by next insiders

@Yoyokrazy
Copy link
Contributor

bit of looking, I've got a hunch that this could be related to a known issue related to an output channel being open. see #199253

@ulugbekna could you confirm whether or not this could be the issue? I noticed in your second repro video that there was text streaming, and it's still been the only way I can repro the bug... Are you able to repro with all output channels and streaming text closed? I'm going to fix the mentioned and hopefully that may resolve this as well. Let me know if you're seeing it repro with output channels all closed

@ulugbekna
Copy link
Contributor Author

The repro involving the vim ext is always reproducible and the main problem for me. The other repro occurs rarely and not sure under what conditions

@Yoyokrazy
Copy link
Contributor

Okay so this has always been "broken", but it seems to be related really far back to a patch that happened here:
VSCodeVim/Vim@c6b0723

What it looks like right now is that during all of the polish work that came for occurrence highlighting, specifically the Delayer that was introduced to avoid firing occurrence requests excessively, managed to get events firing in a sequence that broke the precondition for the event that fired to manually force a triggering of the wordHighlighter.

As it is, I think that the experience in stable VS Code 1.92.1 + vim extension is broken as well, see below:

20240812-2126-15.7455651.mp4

The fix can be fully handled here with the following:

  • In Core:
    • cancel the runDelayer upon restoreViewState, to avoid triggering cursor change requests when we are already forcing a recompute of the occurrences
    • remove the precondition to manual triggering of the wordHighlighter via restoreViewState

Fixed behavior: (selfhosting code OSS)

20240812-2138-25.3226667.mp4

  • OPTIONALLY: In VSCodeVim: remove the manual triggering of "editor.action.wordHighlight.trigger" (range linked below) which in turn would execute a restoreViewState() in the wordHighlighter. I've tested as much vim interaction as I can google/ask others on the team about, and so far the improved wordHighlighter handles all occurrences and decorations smoothly and without any flicker.

https://github.com/VSCodeVim/Vim/blob/master/src/mode/modeHandler.ts#L1736-L1742

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-highlight Editor selection/word highlight issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants