aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/server_configurations/elmls.lua
diff options
context:
space:
mode:
authorkylo252 <59826753+kylo252@users.noreply.github.com>2021-12-01 09:03:10 +0100
committerkylo252 <59826753+kylo252@users.noreply.github.com>2021-12-08 09:09:25 +0100
commita2719a8723e503f1be89d9b1c334846de405eb23 (patch)
treeb9f374673b9f98a9cc7f4b96ca861c635306d4a0 /lua/lspconfig/server_configurations/elmls.lua
parentchore: fix missing [lspconfig] prefix for vim.notify (#1546) (diff)
downloadnvim-lspconfig-a2719a8723e503f1be89d9b1c334846de405eb23.tar
nvim-lspconfig-a2719a8723e503f1be89d9b1c334846de405eb23.tar.gz
nvim-lspconfig-a2719a8723e503f1be89d9b1c334846de405eb23.tar.bz2
nvim-lspconfig-a2719a8723e503f1be89d9b1c334846de405eb23.tar.lz
nvim-lspconfig-a2719a8723e503f1be89d9b1c334846de405eb23.tar.xz
nvim-lspconfig-a2719a8723e503f1be89d9b1c334846de405eb23.tar.zst
nvim-lspconfig-a2719a8723e503f1be89d9b1c334846de405eb23.zip
fix(npm): resolve the command correctly on windows
Diffstat (limited to 'lua/lspconfig/server_configurations/elmls.lua')
-rw-r--r--lua/lspconfig/server_configurations/elmls.lua7
1 files changed, 6 insertions, 1 deletions
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)