As I read it, languageId is a required field of TextDocumentItem. However, the wording seems to me to be ambiguous about what a client should send if a language can't be detected, or is not among the table entries. Also, what should a server do when given an unknown languageId?
I have tested two editors (Kate and Qt Creator) which send an empty string. Kate will send the server executable name by default, and can be configured to send an empty string instead. I also find one server which uses systemverilog and verilog, and treats unknown values as parsing errors.
|
Text documents have a language identifier to identify a document on the server side when it handles more than one language to avoid re-interpreting the file extension. If a document refers to one of the programming languages listed below it is recommended that clients use those ids. |
As I read it,
languageIdis a required field ofTextDocumentItem. However, the wording seems to me to be ambiguous about what a client should send if a language can't be detected, or is not among the table entries. Also, what should a server do when given an unknown languageId?I have tested two editors (Kate and Qt Creator) which send an empty string. Kate will send the server executable name by default, and can be configured to send an empty string instead. I also find one server which uses
systemverilogandverilog, and treats unknown values as parsing errors.language-server-protocol/_specifications/lsp/3.18/types/textDocumentItem.md
Line 30 in ce9abfe