mattn / efm-langserver

General purpose Language Server
MIT License
1.36k stars 61 forks source link

Although efm was setup correctly and detected successfully in nvim, it posts error #219

Open winkee01 opened 2 years ago

winkee01 commented 2 years ago

I was editing a rust file in nvim, efm was detected via :LspInfo, however, It refused to work, the log file ~/.cache/nvim/lsp.log shows this error:

[START][2022-05-03 16:21:32] LSP logging initiated
[ERROR][2022-05-03 16:21:32] .../vim/lsp/rpc.lua:420    "rpc"   "efm-langserver"    "stderr"    "2022/05/03 16:21:32 efm-langserver: no configuration file\n2022/05/03 16:21:32 efm-langserver: reading on stdin, writing on stdout\n"
[ERROR][2022-05-03 16:21:33] .../vim/lsp/rpc.lua:420    "rpc"   "efm-langserver"    "stderr"    "2022/05/03 16:21:33 lint for LanguageID not supported: rust\n"
[ERROR][2022-05-03 16:21:33] .../vim/lsp/rpc.lua:420    "rpc"   "efm-langserver"    "stderr"    "2022/05/03 16:21:33 lint for LanguageID not supported: rust\n"
[ERROR][2022-05-03 16:21:34] .../vim/lsp/rpc.lua:420    "rpc"   "efm-langserver"    "stderr"    "2022/05/03 16:21:34 lint for LanguageID not supported: rust\n"
[ERROR][2022-05-03 16:21:36] .../vim/lsp/rpc.lua:420    "rpc"   "rust-analyzer" "stderr"    '[ERROR rust_analyzer::dispatch] unknown request: Request { id: RequestId(I32(7)), method: "textDocument/inlayHint", params: Object({"range": Object({"start": Object({"character": Number(0), "line": Number(0)}), "end": Object({"character": Number(1), "line": Number(30)})}), "textDocument": Object({"uri": String("file:///Users/winkee/dev/rs/calculator/src/main.rs")})}) }\n'
danielnehrig commented 2 years ago

This totally depends on what your interpretation on correct is as for in simpler terms works on my machine (shrug) you're not addressing a efm issue here but a neovim setup issue from what i can see. im on the latest efm version and as for me i do not have any issues with efm formatting/linting in rust files

if you want help i suggest you ask around in the neovim community if a LSP service would open the pandoras box of letting maintainers debug issue from every consumers perspective we'll be in hells kitchen and i think its unreasonable to expect with this amount of information to let the maintainers figure out your problem at hand since they might not even be using your LSP consuming application

ghost commented 1 year ago

Ran into a similar situation when using eslint_d. In my case it turned out to be a missing eslint plugin that wasn't found, and eslint_d was returning an error code when trying to format stdin, but efm was just throwing a rather generic error

If anyone runs into this message format for LanguageID not supported / lint for LanguageID not supported I'd suggest copying the lint/format command from your efm configuration and manually running it in the terminal first. Make sure the command works on its own without efm, then debug further.

For efm developers - the error message could be more descriptive and could potentially relay the error message thrown by the formatter. As it stands right now it's a little cryptic so it's and hard to understand where the issue is coming from.

kassio commented 1 year ago

@winkee01, did you find a solution? I just ran in the same error on my setup 😞 .

gmhpfc commented 11 months ago

its simple install formatter manually e.g with Mason stylua , pritierd and config in lspsaga.lua accourdingly.