diff options
author | TJ DeVries <devries.timothyj@gmail.com> | 2021-03-10 16:53:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-10 16:53:23 -0500 |
commit | 564dd7d8db110d134987f8619c3894d2149f8956 (patch) | |
tree | c640576e9074274a66982f26daecf72230653f57 /runtime/doc | |
parent | c29494b719d9706aa84758336b4c1e7ba6f86070 (diff) | |
download | rneovim-564dd7d8db110d134987f8619c3894d2149f8956.tar.gz rneovim-564dd7d8db110d134987f8619c3894d2149f8956.tar.bz2 rneovim-564dd7d8db110d134987f8619c3894d2149f8956.zip |
lsp: get_language_id (#14092)
* Allow specifying a languageId for a lsp
For some languages the filetype might not match the languageId the
language server accepts. In these cases the config for the language
server can contain a function which gets the current buffer and filetype
and returns a languageId. When it isn't provided the filetype is used
instead.
Example:
```lua
require'lspconfig'.sourcekit.setup{
get_language_id = function(bufnr, ft)
return 'swift'
end;
}
```
Closes #13093
* lsp: Change to get_language_id
Co-authored-by: Jan Dammshäuser <mail@jandamm.de>
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/lsp.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 24f9dd7a69..6d7c3f26ef 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -799,6 +799,8 @@ start_client({config}) *vim.lsp.start_client()* See `initialize` in the LSP spec. {name} (string, default=client-id) Name in log messages. + {get_language_id} function(bufnr, filetype) -> language + ID as string. Defaults to the filetype. {offset_encoding} (default="utf-16") One of "utf-8", "utf-16", or "utf-32" which is the encoding that the LSP server expects. |