Index out of bounds in analysis.documentPositionContext
when using VSCode Live Share
#325
Labels
bug
Something isn't working
Thanks for the awesome tool; it's made it a lot easier for me to get started with zig!
Unfortunately, while learning Zig together with friends in a different country, I discovered a reproducible index-out-of-bounds panic when using zls and zig master in conjunction with VSCode's official Live Share extension (https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare-pack). Live Share's architecture uses a very simple dumb terminal model, where the host machine is in charge of running extensions and responding to input from remote participants who can see and interact with the code, so it shouldn't generally require any extra work to support it as far as I can tell.
When I start a Live Share session and connect to it (via the same machine or a different one), syntax highlighting doesn't work on the client(s). If a client starts typing something, the host's zls server reliably panics with the following trace:
To reproduce:
zig init-exe
build.zig
in VSCode with thezls-vscode
extension installed and enabledmain.zig
in the client session. Note that syntax highlighting is not present.std.
inside themain
functionOutput
tab underZig Language Server
Based on the trace, I suspect that the source of the problem lies with
zls
and not withzls-vscode
orvsliveshare
. However, there have been rare cases of issues with LiveShare and language extensions. See, for example Dart-Code/Dart-Code#2269 and the associated microsoft/live-share#3509. I'm super new to zig, but please let me know if there's any way I can help track down the cause of this bug.The text was updated successfully, but these errors were encountered: