elm-format spawning vim.ui.select in neovim
The elm-format when returning error will spawn vim.ui.select in neovim.
Expected Behavior
I'm expecting the LSP to not spawn vim.ui.select when elm-format returning error. Just ignore it.
Current Behavior
As you can see, when elm-format is returning error, it will spawn vim.ui.select with message Running elm-format failed. Check the file for syntax errors. which annoys me as I need to close them every time it shown which is often when you want save to get a useful feedback from elm compiler.
Possible Solution
Steps to Reproduce (for bugs)
- Using native LSP in neovim https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#elmls
- Just default configuration, nothing fancy
- Write a invalid elm code
- Save and LSP will spawn
vim.ui.selectdue to elm-format returning error
Context
Your Environment
- Version used:
- Editor used: Neovim
- Environment name and version (e.g. node.js 5.4):
- Operating System and version: NixOS 24.11
Found the code that print the error message. https://github.com/elm-tooling/elm-language-server/blob/dcdcdd067c495ab418720955f7476efe9714d656/src/common/providers/documentFormatingProvider.ts#L68-L70
would be really nice to configure this
Maybe showErrorMessage isn't what's wanted here? Either RemoteConsole.error or showMessage?
showMessage
Not sure what you mean by that, there are also this.connection.window.showInformationMessage and this.connection.window.showWarningMessage - but I can't find showMessage
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showMessage
It was pointed out that the TS library for LSP doesn't seem to surface this feature, so maybe showMessage isn't an option?
For the future: I was shown this workaround:
https://github.com/joakin/nvim/blob/bddf8f52ec92a5e23425b1a26f13d1c22a70106b/lua/plugins/lspconfig.lua#L183 which I can confirm works.