StyLua
StyLua copied to clipboard
[VSCode Ext] pick `stylua` version/path from system environment `PATH`
Use Case
- I use VSCode for many environments. Use it for local files or use it for remote files using SSH (Remote SSH).
- My local is Windows machine, and my remote is Linux machine.
- In Linux machine, I already installed stylua using its distribution.
- In windows machine, I don't install stylua.
stylua.styluaPathis set tonull(default).
What to Expect
- When I open lua files in Windows, search stylua in PATH, stylua not installed so it's not found. In that case, download stylua and/or use stylua from the local storage.
- When I open lua files in remote linux, search stylua in PATH, stylua found. Use that stylua version instead, don't notify user to download latest version or ignore
stylua.releaseVersionandstylua.releaseVersion.
Alternative
- Change configuration to respect different environment. For example add this:
stylua.styluaPath.win,stylua.styluaPath.linux, andstylua.styluaPath.macos.
This is something I definitely want, and I did start trying it out.
The problematic hurdle was that VSCode doesn't have access to PATH on macOS (it is just the default) if you open it from the GUI/Spotlight. So it doesn't find stylua.
There are (very messy) ways to get about it, but once that is sorted, then I think this is a good idea