VSCode extension -- Can't install version 2.1 and trying to do so breaks 1.7
Using VS Code (or Cursor):
I get notification that StyLua 2.1.0 is available. When it I ask it to update, it claims briefly to be downloading.
If I then try to format, I get:
[error] Error: spawn c:\Users\XXXX\AppData\Roaming\Code\User\globalStorage\johnnymorganz.stylua\stylua.exe ENOENT at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19) at onErrorNT (node:internal/child_process:483:16) at processTicksAndRejections (node:internal/process/task_queues:90:21)
and an empty file (recoverable with undo -- phew).
c:\Users\XXXXX\AppData\Roaming\Code\User\globalStorage\johnnymorganz.stylua is empty.
Disabling, uninstalling, deleting the johnnymorganz.stylua folder and reinstalling the extension (to get back to 1.7.1, as 2.1.0 isn't available in the Marketplace) doesn't fix it. C:\Users\XXXXX\AppData\Roaming\Cursor\User\globalStorage\johnnymorganz.stylua is still empty.
Windows 11 on ARM.
This sounds like an issue where downloading the binary failed. I think it could be solved by running the StyLua: Reinstall StyLua command in VSCode.
However, we should handle this gracefully at least, and definitely don't attempt to format the file and cause it to become empty
I'm not convinced the StyLua: Reinstall StyLua command will help if the right version isn't available in the marketplace? It's still only reporting 1.7.1 as avaible.
The extension version is independent of StyLua version - it remains consistent even as stylua has new releases. The extension itself has some logic to find and download the latest stylua release from GitHub
OK.
I've installed the binary manually as a workaround