StyLua icon indicating copy to clipboard operation
StyLua copied to clipboard

[VSCode Ext] pick `stylua` version/path from system environment `PATH`

Open latipun7 opened this issue 3 years ago • 1 comments

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.styluaPath is set to null (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.releaseVersion and stylua.releaseVersion.

Alternative

  • Change configuration to respect different environment. For example add this: stylua.styluaPath.win, stylua.styluaPath.linux, and stylua.styluaPath.macos.

latipun7 avatar Aug 08 '22 06:08 latipun7

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

JohnnyMorganz avatar Aug 08 '22 08:08 JohnnyMorganz