zigtools / zls-vscode

Deprecated, please use https://github.com/ziglang/vscode-zig
https://github.com/ziglang/vscode-zig
MIT License
85 stars 15 forks source link

Look for zls binary on the PATH when not configured #31

Closed leighmcculloch closed 2 years ago

leighmcculloch commented 2 years ago

The extension currently requires a hardcoded path to zls to be included in user settings:

https://github.com/zigtools/zls-vscode/blob/a533f4827c8353464c486d83ef12467fd322f228/src/extension.ts#L12-L19

However, a user's VSCode settings get used across a variety of systems and so the path may not be consistent on all systems. Given that zls is an executable, it is highly likely that the executable is on the PATH, and the zls-vscode extension could fallback to simply running the zls command using the PATH. This is what the vscode-zig extension does already, see here for reference.

SuperAuguste commented 2 years ago

Fixed!

SuperAuguste commented 2 years ago

The VSCode API's LanguageClient doesn't look into PATH for some reason; I'll look into this.