diff options
| author | kylo252 <59826753+kylo252@users.noreply.github.com> | 2021-12-08 09:18:54 +0100 |
|---|---|---|
| committer | kylo252 <59826753+kylo252@users.noreply.github.com> | 2021-12-08 09:18:54 +0100 |
| commit | eee8240ec63f527a47e886915a7e5444230a663a (patch) | |
| tree | 9ceed13a5a5f91c4e4accdae5fdd65ddf82a362c /CONTRIBUTING.md | |
| parent | chore(docs): remove windows notes from readme (diff) | |
| download | nvim-lspconfig-eee8240ec63f527a47e886915a7e5444230a663a.tar nvim-lspconfig-eee8240ec63f527a47e886915a7e5444230a663a.tar.gz nvim-lspconfig-eee8240ec63f527a47e886915a7e5444230a663a.tar.bz2 nvim-lspconfig-eee8240ec63f527a47e886915a7e5444230a663a.tar.lz nvim-lspconfig-eee8240ec63f527a47e886915a7e5444230a663a.tar.xz nvim-lspconfig-eee8240ec63f527a47e886915a7e5444230a663a.tar.zst nvim-lspconfig-eee8240ec63f527a47e886915a7e5444230a663a.zip | |
chore(docs): add a section about windows shims
Diffstat (limited to 'CONTRIBUTING.md')
| -rw-r--r-- | CONTRIBUTING.md | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e8c4a1ac..322b123e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,18 @@ The general form of adding a new language server is to start with a minimal skel When choosing a server name, convert all dashes (`-`) to underscores (`_`) If the name of the server is a unique name (`pyright`, `clangd`) or a commonly used abbreviation (`zls`), prefer this as the server name. If the server instead follows the pattern x-language-server, prefer the convention `x_ls` (`jsonnet_ls`). `default_config` should include, at minimum the following: -* `cmd`: a list which includes the executable name as the first entry, with arguments constituting subsequent list elements (`--stdio` is common) +* `cmd`: a list which includes the executable name as the first entry, with arguments constituting subsequent list elements (`--stdio` is common). +Note that Windows has a limitation when it comes to directly invoking a server that's installed by `npm` or `gem`, so it requires additional handling. + +```lua +local bin_name = 'typescript-language-server' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end +``` + * `filetypes`: a list for filetypes a * `root_dir`: a function (or function handle) which returns the root of the project used to determine if lspconfig should launch a new language server, or attach a previously launched server when you open a new buffer matching the filetype of the server. Note, lspconfig does not offer a dedicated single file mode (this is not codified in the spec). Do not add `vim.fn.cwd` or `util.path.dirname` in `root_dir`. A future version of lspconfig will provide emulation of a single file mode until this is formally codified in the specification. A good fallback is `util.find_git_ancestor`, see other configurations for examples. |
