Formatting crashes when muon is not installed
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.
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
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.
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.
muon is now statically linked => No muon needed anymore => Issue can be closed
Right you are! How awesome, thanks for this massive usability bump! ^_^