vscode: Occurrence highlighting stuck

Type: Bug

I have occurrences highlight and selection highlight turned off. At a seemingly random moment, a buggy form of occurrence highlighting started to happen, so that whatever word my cursor was on when navigating to an instance of VSCode, that word and all occurrences of it became highlighted, and that highlighting would not go away. Moving the cursor did not change the previous highlighting, and navigating to different tabs or instances did not change it either. Quitting the application and opening again did not fix the problem.

highlight-stuck

VS Code version: Code 1.87.0 (Universal) (019f4d1419fbc8219a181fab7892ebccf7ee29a2, 2024-02-27T23:42:56.944Z) OS version: Darwin arm64 23.3.0 Modes:

System Info
Item Value
CPUs Apple M2 Pro (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 1, 1, 1
Memory (System) 16.00GB (0.07GB free)
Process Argv –crash-reporter-id abdd8d03-357d-48d7-9593-6e4889620722
Screen Reader no
VM 0%
Extensions (16)
Extension Author (truncated) Version
rtf ale 2.7.0
auto-add-brackets ali 0.12.2
character-highlighter bsh 0.0.2
selected-lines-count gur 1.4.0
rainbow-csv mec 3.11.0
dotenv mik 1.0.1
ruby-rubocop mis 0.8.6
block-travel sas 0.0.2
ruby-lsp Sho 0.5.11
open-in-browser tec 2.0.0
pdf tom 1.2.2
sort-lines Tyr 1.11.0
gitblame wad 10.9.0
vscode-ruby win 0.28.0
change-case wma 1.0.0
current-file-path yos 4.0.0

(2 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
2e7ec940:30968132
pythontbext0:30879054
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfcontrol:30973184
d34g3935:30971562
edj9j583:30969295
fegfb526:30973843
bg6jg535:30958357
ccp2r3:30958157
dsvsc020:30973508

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Reactions: 18
  • Comments: 19 (5 by maintainers)

Commits related to this issue

Most upvoted comments

You’re not alone. I am hitting this issue as well. This started in the Feb 2024 version and exists with all extensions disabled. Rolling back to the Jan 2024 issue fixes it for me (but then Copilot can no longer be enabled).

I am temporarily working around the issue by by making the highlight color invisible in my settings.json. Now the only thing that’s annoying is the scrollbar markers, but I can live with that until this is fixed.

"workbench.colorCustomizations": {       
    "editor.wordHighlightBackground": "#00000000",
},

Some more information regarding this issue: I have also started encountering this issue, can confirm the issue still exists after disabling all extensions. My occurrence highlighting setting is also turned off and it seems that this setting is what is causing the issue after updating to the latest version of vs code. This issue did not exist prior to the most recent version. If you have editor groups split side by side, and move to the right editor group, then back to the left editor group, the “stuck occurrence highlighting” issue occurs where the cursor was previously. Typing/backspacing the selection will temporarily fix this issue until it happens again. Hope this helps 🙂

@hpjaj If you want to stay on 1.87.0 specifically, setting "editor.occurencesHighlight" : "singleFile" will enable standard semantic highlighting throughout your workspace which is behaving correctly. This is the behavior that the setting "true" previously covered. The fix for "off" will be coming in the recovery release (version 1.87.1) which will be released today. If you would like to access the fixed behavior immediately, you can use the insiders edition of VS Code, linked in my comment above.

@svipas There have been two bugs with occurrences getting “stuck”, and both should have been fixed by now (see #199866 and #198866). If you are experiencing issues, please file a bug and feel free to tag me directly and I can get to it. Currently (in the stable 1.87.0 release) there should not be issues with “stuck” highlighting while the setting is either "singleFile" or "multiFile".

@oomek, @Botan626, @mattmc3 the fix is already shipped to VS Code Insiders if you would like to continue using other features from 1.87. Insiders will receive fixes before the major version is typically able to adopt them.

The fix will be coming likely this week with recovery 1.87.1 release.

@Yoyokrazy - setting "editor.occurencesHighlight" : "singleFile" fixes the primary issue for me. It does still have some odd behavior, but hard for me to say definitively, b/c I have always had the “Occurrence Highlight” feature set to off. Also could be the result of some combination of the other “highlight” related settings.

Thanks!

@oomek - You can downgrade to 1.86.2 in the meantime - no reason to be on 1.87 while it’s broken: https://code.visualstudio.com/updates/v1_86

Same here