vscode-meson icon indicating copy to clipboard operation
vscode-meson copied to clipboard

Formatting crashes when muon is not installed

Open mon opened this issue 2 years ago • 2 comments

Not sure what's best - prompt the user and auto-install (similar to the python extension's use of Black/autopep8), or simply inform the user.

image

Output:

2023-10-13 09:49:49.106 Swift-MesonLSP.exe[24744:2334] ignoring unknown notification MessageDecodingError(code: LanguageServerProtocol.ErrorCode(rawValue: -32601), message: "method not found: textDocument/willSave", id: nil, messageKind: LanguageServerProtocol.MessageDecodingError.MessageKind.notification)
2023-10-13 09:49:49.126 Swift-MesonLSP.exe[24744:2334] MesonServer: Request<textDocument/formatting(99)>
2023-10-13T09:49:49+1000 info LanguageServer::MesonServer : [LanguageServer] Formatting c:/.../src/meson.build
2023-10-13T09:49:49+1000 warning LanguageServer::MesonServer : [LanguageServer] Unable to find c:/.../src/meson.build in memfiles
2023-10-13T09:49:49+1000 error LanguageServer::MesonServer : [LanguageServer] Unable to format file
2023-10-13 09:49:49.133 Swift-MesonLSP.exe[24744:2334] MesonServer: Response<textDocument/formatting(99)>
[Error - 9:49:49 AM] Request textDocument/formatting failed.
  Message: Either failed to read the input file or to format using muon
  Code: -32603 
2023-10-13 09:49:49.180 Swift-MesonLSP.exe[24744:2334] MesonServer: Notification<textDocument/didSave>
2023-10-13T09:49:49+1000 info LanguageServer::MesonServer : [LanguageServer] [Save] Dropping c:/.../src/meson.build from memcache

mon avatar Oct 12 '23 23:10 mon

I think prompting to download muon would make sense, but as far as I can see there are no prebuilt muon windows binaries on https://muon.build/

Then the extension would have to extract it to somewhere on PATH, as I just use executables from there or I add some configuration option to the language server to pass the path to muon.

JCWasmx86 avatar Oct 13 '23 09:10 JCWasmx86

Looks like the github mirror builds windows binaries, it just doesn't seem to store any artifacts (perhaps only the repo owner can access them).

I'd be happy with a BYO binary on PATH - muon is a little bleeding-edge right now, so it'd be nice to pin to some version I know works.

mon avatar Oct 14 '23 02:10 mon

muon is now statically linked => No muon needed anymore => Issue can be closed

JCWasmx86 avatar Apr 10 '24 03:04 JCWasmx86

Right you are! How awesome, thanks for this massive usability bump! ^_^

mon avatar Apr 10 '24 05:04 mon