#VSCode only shows me completions or definitions if I 'go to definition' on the source file first.

1 messages · Page 1 of 1 (latest)

wraith patio
#

I have managed to setup Zig with ZLS support in VSCode. If I load up my project and start typing std. I don't get anything. There is also no syntax highlighting on fs in the line std.fs. However if I then 'Go To Definition' on @import("std") then I get completions for std. But not fs, I have to 'Go To Definition' on that first to get those.

This happens every launch. Please can someone help me figure out whether this is a settings issue with the VSCode extension, a configuration issue with ZLS, or something else?

Note: I have built my own ZLS from master to include a bug fix I wanted. My zig version is 0.11.0-dev.449+665eba93c, which is the same version I built ZLS with.

wraith patio
#

I saw a comment about output that appears to have been removed; here is the out from 'Zig Language Server':

info : (config): Using zig executable C:\zig\zig-windows-x86_64-0.11.0-dev.449+665eba93c\zig.exe
info : (config): Using zig lib path 'C:\zig\zig-windows-x86_64-0.11.0-dev.449+665eba93c\lib'
info : (server): zls initializing
info : (server): Server.ClientCapabilities{ .supports_snippets = true, .supports_semantic_tokens = true, .supports_inlay_hints = true, .supports_will_save = true, .supports_will_save_wait_until = true, .hover_supports_md = true, .completion_doc_supports_md = true, .label_details_support = true, .supports_configuration = true }
info : (server): Using offset encoding: utf16
error: (store ): Failed to load build configuration for file:///c%3A/dev/personal/zig-lua-parser/build.zig (error: error.InvalidUtf8)
info : (server): Setting configuration...
info : (config): Using zig executable C:\zig\zig-windows-x86_64-0.11.0-dev.449+665eba93c\zig.exe
patent wharf
#

error: (store ): Failed to load build configuration for file:///c%3A/dev/personal/zig-lua-parser/build.zig (error: error.InvalidUtf8)

not a windows dev, but this seems like the culprit dunnit

#

maybe check that file's encoding, and convert it to utf8

final ice
wraith patio
#

Thanks for your responses. I did suspect some problems due to my building from source and therefore needing to be on master for Zig itself. I will try a rebuild and see if that helps.