-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
languageId is set incorrectly? #17
Comments
All language servers I have tested work properly with the file extension and changing to use the lsp.add_server {
name = "ocaml-lsp",
language = "ocaml",
file_patterns = {"%.ml$", "%.mli$"},
command = {"ocamllsp"},
id_not_extension = true,
verbose = false
} Also added ocaml-lsp entry as shared by you to the lsp/config.lua file with the |
Some servers work with extensions due to initially unclear languageId policy (link). I think that clangd doesn't work with the extension but with the identifier: cpp or c (maybe some others). They are identifiers and incidentally extensions (I think), C++ can have various extensions (cxx, hpp, ...). m. |
Clangd seemed to properly work when sending If you have suggestions please share them, will leave this issue open until better strategy is achieved (which I think could be allowing a table of supported languages). |
I made an OCaml syntax highlighter for LiteXL, and trying to use it with the LSP server (ocaml-lsp) I realized that probably the "languageId" property (in init.lua) is set incorrectly (at least as per https://microsoft.github.io/language-server-protocol/specifications/specification-current/) to the file extension (without dot) and not to a standard identifier.
Changing to:
The server is working correctly (it seems) with a configuration like:
The text was updated successfully, but these errors were encountered: