Zig Version
0.16.0
ZLS Version
0.16.0
Client / Code Editor / Extensions
Lite XL on Windows
Steps to Reproduce and Observed Behavior
- Download Lite XL and the
lsp plugin
- Add the following
init.lua file in the user directory, assuming you already have zls on PATH:
local lspconfig = require "plugins.lsp.config"
lspconfig.zls.setup()
- Open a Zig file
- Crash
Expected Behavior
So I'm updating to use the newer ZLS v0.16.0 alongside Zig v0.16.0.
However there's a problem which is causing ZLS to instantly crash.
The editor itself is otherwise still completely functional.
Here's Lite XL's log.txt:
- See PastedText.txt
- I applied all my insights, mentioned further below, to obtain as much logging as possible here
What I have tried so far is:
- disabling all plugins (
lsp still seems to turn on automatically because of ./user/init.lua)
- resorting to:
- opening only an empty Zig file
- using a minimal
./user/init.lua:
local lspconfig = require "plugins.lsp.config"
lspconfig.zls.setup()
- enabling more error logging by:
- building a
-Doptimize=Debug ZLS v0.16.0 binary from source
- the only difference by doing this that I noticed is
... (debug) in the logging, as opposed to ... (info)
- enabling the
--enable-stderr-logs flag as seen in zls --help, inside .../lsp/config.lua
lspconfig.zls = add_lsp {
...
command = { '.../zls', '--enable-stderr-logs' }, -- This is as mentioned
verbose = true -- Additionally, this enables seeing all LSP communication JSON
}
- enabling Lite XL's standard error logging option for the
lsp plugin, via ./user/init.lua here
...
local config = require "core.config"
config.plugins.lsp.log_server_stderr = true
At least three Lite XL users have been able to run ZLS in Lite XL on Linux, having altered two lines of code in .../lsp/server.lua to avoid crashes. To clarify, I also tried doing that, without success.
I have been searching for similar issues since and found #1442 to be the most similar to mine, however changing / to \\ and adding .exe to the ZLS binary path didn't help.
Attach ZLS log output
This is zls.log, seems like a summarised log.txt
info ( main ): Starting ZLS 0.16.0 @ '.../zls'
info ( main ): Log File: ...\AppData\Local\Temp\zls\zls.log (debug)
info (server): Client Info: Lite XL (2.1.8)
debug (server): Offset Encoding: 'utf-16'
info (server): added Workspace Folder: file:///... (969 files)
The '.../zls' is the absolute path to the ZLS binary. Adding ZLS to PATH and using 'zls' instead made no difference.
Zig Version
0.16.0
ZLS Version
0.16.0
Client / Code Editor / Extensions
Lite XL on Windows
Steps to Reproduce and Observed Behavior
lspplugininit.luafile in theuserdirectory, assuming you already havezlson PATH:Expected Behavior
So I'm updating to use the newer ZLS v0.16.0 alongside Zig v0.16.0.
However there's a problem which is causing ZLS to instantly crash.
The editor itself is otherwise still completely functional.
Here's Lite XL's
log.txt:What I have tried so far is:
lspstill seems to turn on automatically because of./user/init.lua)./user/init.lua:-Doptimize=DebugZLS v0.16.0 binary from source... (debug)in the logging, as opposed to... (info)--enable-stderr-logsflag as seen inzls --help, inside.../lsp/config.lualspplugin, via./user/init.luahereAt least three Lite XL users have been able to run ZLS in Lite XL on Linux, having altered two lines of code in
.../lsp/server.luato avoid crashes. To clarify, I also tried doing that, without success.I have been searching for similar issues since and found #1442 to be the most similar to mine, however changing
/to\\and adding.exeto the ZLS binary path didn't help.Attach ZLS log output
This is
zls.log, seems like a summarisedlog.txtThe
'.../zls'is the absolute path to the ZLS binary. Adding ZLS to PATH and using'zls'instead made no difference.