Note that anyzig already supports zls. You can build it with zig build zls in the anyzig repo. It’s a pitty perhaps that this is not mentioned in the readme.
anyzig is an indirection that handles version management of the zig executable and according to @neurocyte you can also build such an indirection for zls, so it doesn’t make sense to include any specific zls version in its binary, instead you can create an anyzls so to say (which then will automatically download a zls version, at least that seems like it works from taking a short look at the code, but would be good to add a description to the readme).
I’m not a user of zls so it’s been a bit of an afterthought. I actually don’t know whether people are using it or not? If people are I can try to find time to accommodate. I was thinking of just making anyzig itself support zls…the anyzig and anyzls binaries are almost identical. You’d just pass the"zls" parameter to the anyzig executable.
P.S. oh…there’s also an extra step that’s needed for zls…mapping a Zig version to a zls version. Will need to implement that.
Editors must be able to launch zls; zig zls is not going to work, using a symbolic link from zls to zigany looks better. Not working zls is what preventing people from using zigany!
There was a pfg/fix-zls branch with a working patch for zls—I am using it right now, with an additional b.getInstallStep().dependOn(&install.step); in build.zig for zls executable—and it rocks
There are some valid reasons that a programmer does not want tools for auto-completion, even syntax coloring. For example not using auto-completion leads to better—easy to remember—names in APIs.
I am still using zls mostly for its code navigation capabilities.
Thats a very understandable reason. But as you mention, the navigation stuff is really helpful, as is function documentation. I also don’t use too much autocompletion, but the offered completions show me that everything is set up correctly (although, you can’t rely on this, since the LSP might have some internal quirks.)
I don’t use an LSP. I use emacs and the times I’ve tried using an LSP resulted in emacs crashing and becoming unresponsive. I blame emacs but it’s been hard to find an alternative editor that does everything I rely on.
It is not correct for the vscode zig plugin, it is always calling either a zls executable that is in the PATH, or a configured zls executable without the ability to provide arguments (the first call is using as argument: --version).
It is correct for helix, but a user must change the default configuration—it is inconvenient for an editor that just works.
It is fine to use a zls script that just calls zig zls; but I really don’t know how a windows user can handle it.