Random very high ZLS latency

Hey, for some reason I randomly started getting incredibly high delay dealing with things that interact with ZLS, such as the VSCode intellisense or the automatic zig fmt that runs on save.

I tried reinstalling ZLS, as I compile it myself instead of using the vscode-zig version. I also tried reinstalling Zig and I tried reinstalling VSCode and vscode-zig, but nothing changed.

This is how the ZLS debug logs look, the high MS seems to match up with times of high latency/delay between the code editor and the language server.


Any ideas on how I could approach fixing this issue? Let me know if you need more information, I’d be more than happy to provide it.

Hi @xydone

zig version and zls --version must match.

  • For zig 0.13.0, use the released 0.13.0 zls or checkout zls 0.13.0.
  • For (updated) zig master/0.14.0-dev, compile (or recompile) the zls HEAD (using the updated zig version).

Follow the zls installation guide to build from source.

Welcome to ziggit :slight_smile:

Hey! Thanks for the tips!
I just tried moving to 0.13.0 as I was previously using master, however the issue is present again. I did double check and the ZLS and Zig versions do match, so it shouldn’t be environments getting mixed up.

Update, fixed the issue by adding "zig.zls.preferAstCheckAsChildProcess": false, inside the settings.json file in VSCode.

Further info can be found here: Massive ZLS textDocument/codeAction delay · Issue #2101 · zigtools/zls · GitHub

3 Likes