You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zed (linked to zls 6a16b27), Neovim (linked to zvm -i master --zls)
I should also mention I use the "check" step in my build.zig to enable build_on_save
As shown in the screenshot, I don't get a suggested code action to fix it.
I wanted to contribute something to zls and actually ended up finding this as a bug.
As a result, I am running off the latest commit on master.
Relevant debugging code:
Notably, the error_bundle.errorMessageCount() is returning 0, meaning it never gets into the point where it can suggest code actions.
pubconstBuilder=struct {
pubfngenerateCodeAction(...) error{OutOfMemory}!void {
//...// Below line prints 0log.debug("{d}\n", .{error_bundle.errorMessageCount()});
if (error_bundle.errorMessageCount() ==0) return; // `getMessages` can't be called on an empty ErrorBundle// Never Reached!// Code actions dispatched down herefor (error_bundle.getMessages()) |msg_index| {
log.debug("{s}\n", .{"in here"});
Before attempting to fix this, is this a configuration issue?
Is there a better way to debug/work on zls that you could recommend, I never managed to find a CONTRIBUTING.md or anything along those lines. I've managed to insert some debugging printing into zls as well as a tail -F ~/.cache/zls/zls.log.
The expected behavior is to display code actions when requested.
Relevant log output
info ( main ): Starting ZLS 0.14.0-dev.365+6a16b27 @ '/home/skantify/code/zls/zig-out/bin/zls'
info ( main ): Log File: /home/skantify/.cache/zls/zls.log (debug)
info (server): Client Info: Zed-0.170.2
info (server): Autofix Mode: source.fixall
debug (server): Offset Encoding: utf-16
info (server): added Workspace Folder: file:///home/skantify/code/zldb
info (server): Loaded config: /home/skantify/.config/zls.json
info (server): Set config option 'enable_argument_placeholders' to false
info (server): Set config option 'enable_build_on_save' to true
info (server): Set config option 'warn_style' to true
info (server): Set config option 'highlight_global_var_declarations' to true
info (server): Set config option 'skip_std_references' to true
info (server): Set config option 'builtin_path' to "/home/skantify/.cache/zls/builtin.zig"
info (server): Set config option 'zig_lib_path' to "/home/skantify/.zvm/master/lib"
info (server): Set config option 'zig_exe_path' to "/home/skantify/.zvm/bin/zig"
info (server): Set config option 'build_runner_path' to "/home/skantify/.cache/zls/build_runner/7180d84475778f22727a41e291f1ec7f/build_runner.zig"
info (server): Set config option 'global_cache_path' to "/home/skantify/.cache/zls"
debug (server): Took 36ms to process request-0-initialize on Thread 34549
debug (server): Dynamically registering method 'workspace/didChangeConfiguration'
debug (server): Took 1ms to process notification-initialized on Thread 34549
debug (server): Took 1ms to process notification-workspace/didChangeConfiguration on Thread 34549
info (store ): Loaded build file 'file:///home/skantify/code/zldb/build.zig'
debug (store ): Opened document 'file:///home/skantify/code/zldb/src/main.zig'
debug (server): Took 2ms to process notification-textDocument/didOpen on Thread 34549
debug (server): Took 0ms to process response-"register-workspace/didChangeConfiguration" on Thread 34549
info (server): trying to start Build-On-Save for'file:///home/skantify/code/zldb'
debug (server): Took 5ms to process response-"i_haz_configuration" on Thread 34549
debug (server): Took 0ms to process response-"progress" on Thread 34549
debug (server): Took 5ms to process response-"i_haz_configuration" on Thread 34549
debug (server): Took 0ms to process response-"inlay_hints_refresh" on Thread 34549
debug (server): Took 6ms to process request-426-textDocument/inlayHint on Thread 31234
debug (server): Took 12ms to process request-428-textDocument/inlayHint on Thread 31233
debug (inlay_hint): cannot deduce fn expression with tag 'zig.Ast.Node.Tag.enum_literal'
debug (inlay_hint): cannot deduce fn expression with tag 'zig.Ast.Node.Tag.enum_literal'
debug (inlay_hint): cannot deduce fn expression with tag 'zig.Ast.Node.Tag.enum_literal'
debug (inlay_hint): cannot deduce fn expression with tag 'zig.Ast.Node.Tag.enum_literal'
debug (inlay_hint): cannot deduce fn expression with tag 'zig.Ast.Node.Tag.enum_literal'
debug (server): Took 63ms to process request-427-textDocument/inlayHint on Thread 31231
debug (server): Took 0ms to process notification-workspace/didChangeConfiguration on Thread 31230
debug (server): Took 0ms to process notification-workspace/didChangeConfiguration on Thread 31230
debug (server): Took 0ms to process notification-workspace/didChangeConfiguration on Thread 34549
debug (server): Took 8ms to process response-"i_haz_configuration" on Thread 31230
debug (server): Took 0ms to process notification-workspace/didChangeConfiguration on Thread 31230
debug (server): Took 7ms to process response-"i_haz_configuration" on Thread 34549
debug (server): Took 10ms to process response-"i_haz_configuration" on Thread 31230
debug (server): Took 7ms to process response-"i_haz_configuration" on Thread 31230
debug (server): Took 0ms to process request-2-textDocument/documentHighlight on Thread 34552
debug (server): 0
debug (server): Took 18ms to process request-3-textDocument/codeAction on Thread 34553
debug (server): Took 0ms to process request-4-textDocument/documentHighlight on Thread 34551
debug (server): Took 1ms to process request-5-textDocument/documentHighlight on Thread 34550
debug (server): Took 1ms to process request-6-textDocument/documentHighlight on Thread 34552
debug (server): Took 2ms to process request-7-textDocument/documentHighlight on Thread 34553
debug (server): 0
debug (server): Took 16ms to process request-8-textDocument/codeAction on Thread 34551
The text was updated successfully, but these errors were encountered:
Alright, I did some more digging to see what's going on and I see the /codeAction path depends on zig ast-check, which shows no errors (yet still always gives the import sorting action), while /hover uses the Analyzer for diagnostics which are not from zig ast-check.
I'm not sure that is intentional or not, as doing a full Analyzed check is probably a bit more expensive to do in conjunction with the Analyzer check.
Zig Version
0.14.0-dev.2851+b074fb7dd
ZLS Version
6a16b27
Client / Code Editor / Extensions
Zed (linked to zls 6a16b27), Neovim (linked to
zvm -i master --zls
)I should also mention I use the
"check"
step in mybuild.zig
to enablebuild_on_save
Steps to Reproduce and Observed Behavior
Here's the script with a non camel case function
As shown in the screenshot, I don't get a suggested code action to fix it.
I wanted to contribute something to
zls
and actually ended up finding this as a bug.As a result, I am running off the latest commit on master.
Relevant debugging code:
Notably, the
error_bundle.errorMessageCount()
is returning0
, meaning it never gets into the point where it can suggest code actions.zls/src/features/code_actions.zig
Line 39 in 6a16b27
Two questions
CONTRIBUTING.md
or anything along those lines. I've managed to insert some debugging printing intozls
as well as atail -F ~/.cache/zls/zls.log
.Here is my settings in case it matters:
Expected Behavior
The expected behavior is to display code actions when requested.
Relevant log output
The text was updated successfully, but these errors were encountered: