zls icon indicating copy to clipboard operation
zls copied to clipboard

Semantic Tokens causes editor's theme to flicker when code is invalid

Open xoxorwr opened this issue 9 months ago • 3 comments

Zig Version

master

ZLS Version

master

Client / Code Editor / Extensions

Sublime Text 4200

Steps to Reproduce and Observed Behavior

  1. open a zig file
  2. type code, make the code invalid by typing random chars
  3. save
  4. notice editor flicker due to semantic tokens

Expected Behavior

It should not flicker

My guess is that zls resets semantic token state when linter fails, but it shouldn't, otherwise it causes client to flicker

Definition of the flicker:

switches between semantic token theme and normal theme

Attach ZLS log output

No response

xoxorwr avatar Feb 15 '26 10:02 xoxorwr

Here a video that showcase the issue:

https://github.com/user-attachments/assets/4fbc4458-3099-422d-acbe-eef854efc71e

xoxorwr avatar Feb 15 '26 10:02 xoxorwr

In the video your provided, after typing the random invalid code, are you saving the file with CTRL+S or are you undoing your text edit with CTRL+Z? The reproduction steps you provided claim the former but the video appears to do the latter.

Could you provide the following information to try and identify what exactly is causing this issue:

  • the entire source file (no video or image, feel free to remove unnecessary parts from the file)
  • ZLS log output
  • contents of LSP.sublime-settings (Preferences -> Package Settings -> LSP -> Settings)
  • contents of Zig.sublime-settings (Preferences -> Package Settings -> Zig -> Settings)
  • the color scheme being used

techatrix avatar Feb 15 '26 14:02 techatrix

Closing as stale. If anyone is still experiencing this issue, feel free to open an issue again and provide reproducible steps.

techatrix avatar Nov 09 '26 15:11 techatrix