aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-12-10 10:22:10 -0800
committerGitHub <noreply@github.com>2021-12-10 10:22:10 -0800
commit026ab6bd54075cc8e095f9040f7912ffb708864d (patch)
tree38898842be3e84e5bed0f385fc177a5f05329ac9
parentdocs: update server_configurations.md (diff)
parentchore(docs): add a section about windows shims (diff)
downloadnvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.tar
nvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.tar.gz
nvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.tar.bz2
nvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.tar.lz
nvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.tar.xz
nvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.tar.zst
nvim-lspconfig-026ab6bd54075cc8e095f9040f7912ffb708864d.zip
Merge pull request #1522 from kylo252/win-compat
-rw-r--r--CONTRIBUTING.md13
-rw-r--r--README.md4
-rw-r--r--lua/lspconfig/server_configurations/angularls.lua24
-rw-r--r--lua/lspconfig/server_configurations/ansiblels.lua9
-rw-r--r--lua/lspconfig/server_configurations/bashls.lua9
-rw-r--r--lua/lspconfig/server_configurations/cssls.lua7
-rw-r--r--lua/lspconfig/server_configurations/cucumber_language_server.lua9
-rw-r--r--lua/lspconfig/server_configurations/diagnosticls.lua6
-rw-r--r--lua/lspconfig/server_configurations/dockerls.lua9
-rw-r--r--lua/lspconfig/server_configurations/dotls.lua9
-rw-r--r--lua/lspconfig/server_configurations/elmls.lua7
-rw-r--r--lua/lspconfig/server_configurations/ember.lua9
-rw-r--r--lua/lspconfig/server_configurations/emmet_ls.lua9
-rw-r--r--lua/lspconfig/server_configurations/eslint.lua8
-rw-r--r--lua/lspconfig/server_configurations/graphql.lua9
-rw-r--r--lua/lspconfig/server_configurations/html.lua7
-rw-r--r--lua/lspconfig/server_configurations/intelephense.lua9
-rw-r--r--lua/lspconfig/server_configurations/jsonls.lua6
-rw-r--r--lua/lspconfig/server_configurations/lean3ls.lua10
-rw-r--r--lua/lspconfig/server_configurations/ocamlls.lua8
-rw-r--r--lua/lspconfig/server_configurations/prismals.lua6
-rw-r--r--lua/lspconfig/server_configurations/purescriptls.lua6
-rw-r--r--lua/lspconfig/server_configurations/pyright.lua6
-rw-r--r--lua/lspconfig/server_configurations/rome.lua9
-rw-r--r--lua/lspconfig/server_configurations/solargraph.lua6
-rw-r--r--lua/lspconfig/server_configurations/stylelint_lsp.lua9
-rw-r--r--lua/lspconfig/server_configurations/svelte.lua6
-rw-r--r--lua/lspconfig/server_configurations/tailwindcss.lua7
-rw-r--r--lua/lspconfig/server_configurations/tsserver.lua6
-rw-r--r--lua/lspconfig/server_configurations/vimls.lua6
-rw-r--r--lua/lspconfig/server_configurations/volar.lua8
-rw-r--r--lua/lspconfig/server_configurations/vuels.lua9
-rw-r--r--lua/lspconfig/server_configurations/yamlls.lua9
33 files changed, 222 insertions, 52 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.
diff --git a/README.md b/README.md
index 2c750dbb..85f1eb02 100644
--- a/README.md
+++ b/README.md
@@ -188,10 +188,6 @@ Please see the [wiki](https://github.com/neovim/nvim-lspconfig/wiki) for additio
* [Project local settings](https://github.com/neovim/nvim-lspconfig/wiki/Project-local-settings)
* [Recommended plugins for enhanced language server features](https://github.com/neovim/nvim-lspconfig/wiki/Language-specific-plugins)
-## Windows
-
-In order for neovim to launch certain executables on Windows, it must append `.cmd` to the command name. To work around this, manually append `.cmd` to the entry `cmd` in a given plugin's setup{} call.
-
## Contributions
If you are missing a language server on the list in [server_configurations.md](doc/server_configurations.md), contributing
diff --git a/lua/lspconfig/server_configurations/angularls.lua b/lua/lspconfig/server_configurations/angularls.lua
index 321c97cb..4d30de71 100644
--- a/lua/lspconfig/server_configurations/angularls.lua
+++ b/lua/lspconfig/server_configurations/angularls.lua
@@ -11,16 +11,24 @@ end
local default_probe_dir = get_probe_dir(vim.fn.getcwd())
+local bin_name = 'ngserver'
+local args = {
+ '--stdio',
+ '--tsProbeLocations',
+ default_probe_dir,
+ '--ngProbeLocations',
+ default_probe_dir,
+}
+
+local cmd = { bin_name, unpack(args) }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, unpack(args) }
+end
+
return {
default_config = {
- cmd = {
- 'ngserver',
- '--stdio',
- '--tsProbeLocations',
- default_probe_dir,
- '--ngProbeLocations',
- default_probe_dir,
- },
+ cmd = cmd,
filetypes = { 'typescript', 'html', 'typescriptreact', 'typescript.tsx' },
-- Check for angular.json or .git first since that is the root of the project.
-- Don't check for tsconfig.json or package.json since there are multiple of these
diff --git a/lua/lspconfig/server_configurations/ansiblels.lua b/lua/lspconfig/server_configurations/ansiblels.lua
index 07311969..5eb8e527 100644
--- a/lua/lspconfig/server_configurations/ansiblels.lua
+++ b/lua/lspconfig/server_configurations/ansiblels.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'ansible-language-server'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
+
return {
default_config = {
- cmd = { 'ansible-language-server', '--stdio' },
+ cmd = cmd,
settings = {
ansible = {
python = {
diff --git a/lua/lspconfig/server_configurations/bashls.lua b/lua/lspconfig/server_configurations/bashls.lua
index 6aa8780e..bae4318b 100644
--- a/lua/lspconfig/server_configurations/bashls.lua
+++ b/lua/lspconfig/server_configurations/bashls.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'bash-language-server'
+local cmd = { bin_name, 'start' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, 'start' }
+end
+
return {
default_config = {
- cmd = { 'bash-language-server', 'start' },
+ cmd = cmd,
cmd_env = {
-- Prevent recursive scanning which will cause issues when opening a file
-- directly in the home directory (e.g. ~/foo.sh).
diff --git a/lua/lspconfig/server_configurations/cssls.lua b/lua/lspconfig/server_configurations/cssls.lua
index 21470d91..41c38e6a 100644
--- a/lua/lspconfig/server_configurations/cssls.lua
+++ b/lua/lspconfig/server_configurations/cssls.lua
@@ -1,10 +1,15 @@
local util = require 'lspconfig.util'
local bin_name = 'vscode-css-language-server'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
return {
default_config = {
- cmd = { bin_name, '--stdio' },
+ cmd = cmd,
filetypes = { 'css', 'scss', 'less' },
root_dir = util.root_pattern('package.json', '.git'),
single_file_support = true,
diff --git a/lua/lspconfig/server_configurations/cucumber_language_server.lua b/lua/lspconfig/server_configurations/cucumber_language_server.lua
index 1fb4b8a0..07832061 100644
--- a/lua/lspconfig/server_configurations/cucumber_language_server.lua
+++ b/lua/lspconfig/server_configurations/cucumber_language_server.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'cucumber-language-server'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
+
return {
default_config = {
- cmd = { 'cucumber-language-server', '--stdio' },
+ cmd = cmd,
filetypes = { 'cucumber' },
root_dir = util.find_git_ancestor,
},
diff --git a/lua/lspconfig/server_configurations/diagnosticls.lua b/lua/lspconfig/server_configurations/diagnosticls.lua
index 4e1b8ee5..8f0476b6 100644
--- a/lua/lspconfig/server_configurations/diagnosticls.lua
+++ b/lua/lspconfig/server_configurations/diagnosticls.lua
@@ -1,13 +1,15 @@
local util = require 'lspconfig.util'
local bin_name = 'diagnostic-languageserver'
+local cmd = { bin_name, '--stdio' }
+
if vim.fn.has 'win32' == 1 then
- bin_name = bin_name .. '.cmd'
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
end
return {
default_config = {
- cmd = { bin_name, '--stdio' },
+ cmd = cmd,
root_dir = util.find_git_ancestor,
single_file_support = true,
filetypes = {},
diff --git a/lua/lspconfig/server_configurations/dockerls.lua b/lua/lspconfig/server_configurations/dockerls.lua
index 97376ea7..6d1cfc7d 100644
--- a/lua/lspconfig/server_configurations/dockerls.lua
+++ b/lua/lspconfig/server_configurations/dockerls.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'docker-langserver'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
+
return {
default_config = {
- cmd = { 'docker-langserver', '--stdio' },
+ cmd = cmd,
filetypes = { 'dockerfile' },
root_dir = util.root_pattern 'Dockerfile',
single_file_support = true,
diff --git a/lua/lspconfig/server_configurations/dotls.lua b/lua/lspconfig/server_configurations/dotls.lua
index 479f4306..dff14b9c 100644
--- a/lua/lspconfig/server_configurations/dotls.lua
+++ b/lua/lspconfig/server_configurations/dotls.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'dot-language-server'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
+
return {
default_config = {
- cmd = { 'dot-language-server', '--stdio' },
+ cmd = cmd,
filetypes = { 'dot' },
root_dir = util.find_git_ancestor,
single_file_support = true,
diff --git a/lua/lspconfig/server_configurations/elmls.lua b/lua/lspconfig/server_configurations/elmls.lua
index 2e4feca9..bac26550 100644
--- a/lua/lspconfig/server_configurations/elmls.lua
+++ b/lua/lspconfig/server_configurations/elmls.lua
@@ -3,6 +3,11 @@ local lsp = vim.lsp
local api = vim.api
local bin_name = 'elm-language-server'
+local cmd = { bin_name }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name }
+end
local default_capabilities = lsp.protocol.make_client_capabilities()
default_capabilities.offsetEncoding = { 'utf-8', 'utf-16' }
@@ -10,7 +15,7 @@ local elm_root_pattern = util.root_pattern 'elm.json'
return {
default_config = {
- cmd = { bin_name },
+ cmd = cmd,
-- TODO(ashkan) if we comment this out, it will allow elmls to operate on elm.json. It seems like it could do that, but no other editor allows it right now.
filetypes = { 'elm' },
root_dir = function(fname)
diff --git a/lua/lspconfig/server_configurations/ember.lua b/lua/lspconfig/server_configurations/ember.lua
index 98d01ad1..e6ce1eae 100644
--- a/lua/lspconfig/server_configurations/ember.lua
+++ b/lua/lspconfig/server_configurations/ember.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'ember-language-server'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
+
return {
default_config = {
- cmd = { 'ember-language-server', '--stdio' },
+ cmd = cmd,
filetypes = { 'handlebars', 'typescript', 'javascript' },
root_dir = util.root_pattern('ember-cli-build.js', '.git'),
},
diff --git a/lua/lspconfig/server_configurations/emmet_ls.lua b/lua/lspconfig/server_configurations/emmet_ls.lua
index 471f21f1..9eed1feb 100644
--- a/lua/lspconfig/server_configurations/emmet_ls.lua
+++ b/lua/lspconfig/server_configurations/emmet_ls.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'emmet-ls'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
+
return {
default_config = {
- cmd = { 'emmet-ls', '--stdio' },
+ cmd = cmd,
filetypes = { 'html', 'css' },
root_dir = util.find_git_ancestor,
},
diff --git a/lua/lspconfig/server_configurations/eslint.lua b/lua/lspconfig/server_configurations/eslint.lua
index 5ddd3b4a..db57fb5c 100644
--- a/lua/lspconfig/server_configurations/eslint.lua
+++ b/lua/lspconfig/server_configurations/eslint.lua
@@ -43,9 +43,15 @@ local function fix_all(opts)
end
local bin_name = 'vscode-eslint-language-server'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
+
return {
default_config = {
- cmd = { bin_name, '--stdio' },
+ cmd = cmd,
filetypes = {
'javascript',
'javascriptreact',
diff --git a/lua/lspconfig/server_configurations/graphql.lua b/lua/lspconfig/server_configurations/graphql.lua
index f4299e99..43fd23d2 100644
--- a/lua/lspconfig/server_configurations/graphql.lua
+++ b/lua/lspconfig/server_configurations/graphql.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'graphql-lsp'
+local cmd = { bin_name, 'server', '-m', 'stream' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, 'server', '-m', 'stream' }
+end
+
return {
default_config = {
- cmd = { 'graphql-lsp', 'server', '-m', 'stream' },
+ cmd = cmd,
filetypes = { 'graphql', 'typescriptreact', 'javascriptreact' },
root_dir = util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*'),
},
diff --git a/lua/lspconfig/server_configurations/html.lua b/lua/lspconfig/server_configurations/html.lua
index 8b6882d5..315143dd 100644
--- a/lua/lspconfig/server_configurations/html.lua
+++ b/lua/lspconfig/server_configurations/html.lua
@@ -1,10 +1,15 @@
local util = require 'lspconfig.util'
local bin_name = 'vscode-html-language-server'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
return {
default_config = {
- cmd = { bin_name, '--stdio' },
+ cmd = cmd,
filetypes = { 'html' },
root_dir = util.root_pattern('package.json', '.git'),
single_file_support = true,
diff --git a/lua/lspconfig/server_configurations/intelephense.lua b/lua/lspconfig/server_configurations/intelephense.lua
index 3ab69b1b..b422dae4 100644
--- a/lua/lspconfig/server_configurations/intelephense.lua
+++ b/lua/lspconfig/server_configurations/intelephense.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'intelephense'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
+
return {
default_config = {
- cmd = { 'intelephense', '--stdio' },
+ cmd = cmd,
filetypes = { 'php' },
root_dir = function(pattern)
local cwd = vim.loop.cwd()
diff --git a/lua/lspconfig/server_configurations/jsonls.lua b/lua/lspconfig/server_configurations/jsonls.lua
index beed940a..75170283 100644
--- a/lua/lspconfig/server_configurations/jsonls.lua
+++ b/lua/lspconfig/server_configurations/jsonls.lua
@@ -1,13 +1,15 @@
local util = require 'lspconfig.util'
local bin_name = 'vscode-json-language-server'
+local cmd = { bin_name, '--stdio' }
+
if vim.fn.has 'win32' == 1 then
- bin_name = bin_name .. '.cmd'
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
end
return {
default_config = {
- cmd = { bin_name, '--stdio' },
+ cmd = cmd,
filetypes = { 'json' },
init_options = {
provideFormatter = true,
diff --git a/lua/lspconfig/server_configurations/lean3ls.lua b/lua/lspconfig/server_configurations/lean3ls.lua
index cad9b125..dc3872e8 100644
--- a/lua/lspconfig/server_configurations/lean3ls.lua
+++ b/lua/lspconfig/server_configurations/lean3ls.lua
@@ -1,8 +1,16 @@
local util = require 'lspconfig.util'
+local bin_name = 'lean-language-server'
+local args = { '--stdio', '--', '-M', '4096', '-T', '100000' }
+local cmd = { bin_name, unpack(args) }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, unpack(args) }
+end
+
return {
default_config = {
- cmd = { 'lean-language-server', '--stdio', '--', '-M', '4096', '-T', '100000' },
+ cmd = cmd,
filetypes = { 'lean3' },
root_dir = function(fname)
-- check if inside elan stdlib
diff --git a/lua/lspconfig/server_configurations/ocamlls.lua b/lua/lspconfig/server_configurations/ocamlls.lua
index 8526f3e2..fcc25dbc 100644
--- a/lua/lspconfig/server_configurations/ocamlls.lua
+++ b/lua/lspconfig/server_configurations/ocamlls.lua
@@ -1,8 +1,14 @@
local util = require 'lspconfig.util'
+local bin_name = 'ocaml-language-server'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
return {
default_config = {
- cmd = { 'ocaml-language-server', '--stdio' },
+ cmd = cmd,
filetypes = { 'ocaml', 'reason' },
root_dir = util.root_pattern('*.opam', 'esy.json', 'package.json'),
},
diff --git a/lua/lspconfig/server_configurations/prismals.lua b/lua/lspconfig/server_configurations/prismals.lua
index 96c12a86..1cfb486f 100644
--- a/lua/lspconfig/server_configurations/prismals.lua
+++ b/lua/lspconfig/server_configurations/prismals.lua
@@ -1,13 +1,15 @@
local util = require 'lspconfig.util'
local bin_name = 'prisma-language-server'
+local cmd = { bin_name, '--stdio' }
+
if vim.fn.has 'win32' == 1 then
- bin_name = bin_name .. '.cmd'
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
end
return {
default_config = {
- cmd = { bin_name, '--stdio' },
+ cmd = cmd,
filetypes = { 'prisma' },
settings = {
prisma = {
diff --git a/lua/lspconfig/server_configurations/purescriptls.lua b/lua/lspconfig/server_configurations/purescriptls.lua
index e5cef6be..81524d56 100644
--- a/lua/lspconfig/server_configurations/purescriptls.lua
+++ b/lua/lspconfig/server_configurations/purescriptls.lua
@@ -1,13 +1,15 @@
local util = require 'lspconfig.util'
local bin_name = 'purescript-language-server'
+local cmd = { bin_name, '--stdio' }
+
if vim.fn.has 'win32' == 1 then
- bin_name = bin_name .. '.cmd'
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
end
return {
default_config = {
- cmd = { bin_name, '--stdio' },
+ cmd = cmd,
filetypes = { 'purescript' },
root_dir = util.root_pattern('bower.json', 'psc-package.json', 'spago.dhall'),
},
diff --git a/lua/lspconfig/server_configurations/pyright.lua b/lua/lspconfig/server_configurations/pyright.lua
index ca2d815b..118241bb 100644
--- a/lua/lspconfig/server_configurations/pyright.lua
+++ b/lua/lspconfig/server_configurations/pyright.lua
@@ -1,8 +1,10 @@
local util = require 'lspconfig.util'
local bin_name = 'pyright-langserver'
+local cmd = { bin_name, '--stdio' }
+
if vim.fn.has 'win32' == 1 then
- bin_name = bin_name .. '.cmd'
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
end
local root_files = {
@@ -24,7 +26,7 @@ end
return {
default_config = {
- cmd = { bin_name, '--stdio' },
+ cmd = cmd,
filetypes = { 'python' },
root_dir = util.root_pattern(unpack(root_files)),
single_file_support = true,
diff --git a/lua/lspconfig/server_configurations/rome.lua b/lua/lspconfig/server_configurations/rome.lua
index 3e82be7b..7a8e9cee 100644
--- a/lua/lspconfig/server_configurations/rome.lua
+++ b/lua/lspconfig/server_configurations/rome.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'rome'
+local cmd = { bin_name, 'lsp' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, 'lsp' }
+end
+
return {
default_config = {
- cmd = { 'rome', 'lsp' },
+ cmd = cmd,
filetypes = {
'javascript',
'javascriptreact',
diff --git a/lua/lspconfig/server_configurations/solargraph.lua b/lua/lspconfig/server_configurations/solargraph.lua
index 4ac0c55f..c0782812 100644
--- a/lua/lspconfig/server_configurations/solargraph.lua
+++ b/lua/lspconfig/server_configurations/solargraph.lua
@@ -1,13 +1,15 @@
local util = require 'lspconfig.util'
local bin_name = 'solargraph'
+local cmd = { bin_name, '--stdio' }
+
if vim.fn.has 'win32' == 1 then
- bin_name = bin_name .. '.bat'
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
end
return {
default_config = {
- cmd = { bin_name, 'stdio' },
+ cmd = cmd,
settings = {
solargraph = {
diagnostics = true,
diff --git a/lua/lspconfig/server_configurations/stylelint_lsp.lua b/lua/lspconfig/server_configurations/stylelint_lsp.lua
index f311b410..7dfc27aa 100644
--- a/lua/lspconfig/server_configurations/stylelint_lsp.lua
+++ b/lua/lspconfig/server_configurations/stylelint_lsp.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'stylelint-lsp'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
+
return {
default_config = {
- cmd = { 'stylelint-lsp', '--stdio' },
+ cmd = cmd,
filetypes = {
'css',
'less',
diff --git a/lua/lspconfig/server_configurations/svelte.lua b/lua/lspconfig/server_configurations/svelte.lua
index ca2151b4..14db1925 100644
--- a/lua/lspconfig/server_configurations/svelte.lua
+++ b/lua/lspconfig/server_configurations/svelte.lua
@@ -1,13 +1,15 @@
local util = require 'lspconfig.util'
local bin_name = 'svelteserver'
+local cmd = { bin_name, '--stdio' }
+
if vim.fn.has 'win32' == 1 then
- bin_name = bin_name .. '.cmd'
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
end
return {
default_config = {
- cmd = { bin_name, '--stdio' },
+ cmd = cmd,
filetypes = { 'svelte' },
root_dir = util.root_pattern('package.json', '.git'),
},
diff --git a/lua/lspconfig/server_configurations/tailwindcss.lua b/lua/lspconfig/server_configurations/tailwindcss.lua
index e392bfaa..dcdaa293 100644
--- a/lua/lspconfig/server_configurations/tailwindcss.lua
+++ b/lua/lspconfig/server_configurations/tailwindcss.lua
@@ -1,10 +1,15 @@
local util = require 'lspconfig.util'
local bin_name = 'tailwindcss-language-server'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
return {
default_config = {
- cmd = { bin_name, '--stdio' },
+ cmd = cmd,
-- filetypes copied and adjusted from tailwindcss-intellisense
filetypes = {
-- html
diff --git a/lua/lspconfig/server_configurations/tsserver.lua b/lua/lspconfig/server_configurations/tsserver.lua
index 553378a1..0f916fef 100644
--- a/lua/lspconfig/server_configurations/tsserver.lua
+++ b/lua/lspconfig/server_configurations/tsserver.lua
@@ -1,14 +1,16 @@
local util = require 'lspconfig.util'
local bin_name = 'typescript-language-server'
+local cmd = { bin_name, '--stdio' }
+
if vim.fn.has 'win32' == 1 then
- bin_name = bin_name .. '.cmd'
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
end
return {
default_config = {
init_options = { hostInfo = 'neovim' },
- cmd = { bin_name, '--stdio' },
+ cmd = cmd,
filetypes = {
'javascript',
'javascriptreact',
diff --git a/lua/lspconfig/server_configurations/vimls.lua b/lua/lspconfig/server_configurations/vimls.lua
index f8de0861..4f0d1d93 100644
--- a/lua/lspconfig/server_configurations/vimls.lua
+++ b/lua/lspconfig/server_configurations/vimls.lua
@@ -1,13 +1,15 @@
local util = require 'lspconfig.util'
local bin_name = 'vim-language-server'
+local cmd = { bin_name, '--stdio' }
+
if vim.fn.has 'win32' == 1 then
- bin_name = bin_name .. '.cmd'
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
end
return {
default_config = {
- cmd = { bin_name, '--stdio' },
+ cmd = cmd,
filetypes = { 'vim' },
root_dir = function(fname)
return util.find_git_ancestor(fname) or vim.fn.getcwd()
diff --git a/lua/lspconfig/server_configurations/volar.lua b/lua/lspconfig/server_configurations/volar.lua
index 6c7d71ec..21d65beb 100644
--- a/lua/lspconfig/server_configurations/volar.lua
+++ b/lua/lspconfig/server_configurations/volar.lua
@@ -46,9 +46,15 @@ local volar_init_options = {
},
}
+local bin_name = 'volar-server'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
return {
default_config = {
- cmd = { 'volar-server', '--stdio' },
+ cmd = cmd,
filetypes = { 'vue' },
root_dir = util.root_pattern 'package.json',
init_options = volar_init_options,
diff --git a/lua/lspconfig/server_configurations/vuels.lua b/lua/lspconfig/server_configurations/vuels.lua
index 1e2ecd99..0a689b34 100644
--- a/lua/lspconfig/server_configurations/vuels.lua
+++ b/lua/lspconfig/server_configurations/vuels.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'vls'
+local cmd = { bin_name }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name }
+end
+
return {
default_config = {
- cmd = { 'vls' },
+ cmd = cmd,
filetypes = { 'vue' },
root_dir = util.root_pattern('package.json', 'vue.config.js'),
init_options = {
diff --git a/lua/lspconfig/server_configurations/yamlls.lua b/lua/lspconfig/server_configurations/yamlls.lua
index 91bb66c9..03dfba7c 100644
--- a/lua/lspconfig/server_configurations/yamlls.lua
+++ b/lua/lspconfig/server_configurations/yamlls.lua
@@ -1,8 +1,15 @@
local util = require 'lspconfig.util'
+local bin_name = 'yaml-language-server'
+local cmd = { bin_name, '--stdio' }
+
+if vim.fn.has 'win32' == 1 then
+ cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
+end
+
return {
default_config = {
- cmd = { 'yaml-language-server', '--stdio' },
+ cmd = cmd,
filetypes = { 'yaml', 'yaml.docker-compose' },
root_dir = util.find_git_ancestor,
single_file_support = true,