aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-12-05 04:07:57 +0100
committerWilliam Boman <william@redwill.se>2021-12-05 17:43:48 +0100
commit4f5de77fab742ab2ca5512e7f3c9881cacdaf8eb (patch)
tree0c96fb4ff4b759984a4a64d268135ea6ef0e797d /lua
parentfix(installers/shell): pass script via arg, when possible (#307) (diff)
downloadmason-4f5de77fab742ab2ca5512e7f3c9881cacdaf8eb.tar
mason-4f5de77fab742ab2ca5512e7f3c9881cacdaf8eb.tar.gz
mason-4f5de77fab742ab2ca5512e7f3c9881cacdaf8eb.tar.bz2
mason-4f5de77fab742ab2ca5512e7f3c9881cacdaf8eb.tar.lz
mason-4f5de77fab742ab2ca5512e7f3c9881cacdaf8eb.tar.xz
mason-4f5de77fab742ab2ca5512e7f3c9881cacdaf8eb.tar.zst
mason-4f5de77fab742ab2ca5512e7f3c9881cacdaf8eb.zip
fix(angularls): also provide `cmd` property
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-lsp-installer/servers/angularls/init.lua21
1 files changed, 13 insertions, 8 deletions
diff --git a/lua/nvim-lsp-installer/servers/angularls/init.lua b/lua/nvim-lsp-installer/servers/angularls/init.lua
index d32bb5af..265dfb4b 100644
--- a/lua/nvim-lsp-installer/servers/angularls/init.lua
+++ b/lua/nvim-lsp-installer/servers/angularls/init.lua
@@ -12,6 +12,17 @@ local function append_node_modules(dirs)
end
return function(name, root_dir)
+ local function get_cmd(workspace_dir)
+ return {
+ npm.executable(root_dir, "ngserver"),
+ "--stdio",
+ "--tsProbeLocations",
+ table.concat(append_node_modules { root_dir, workspace_dir }, ","),
+ "--ngProbeLocations",
+ table.concat(append_node_modules { root_dir, workspace_dir }, ","),
+ }
+ end
+
return server.Server:new {
name = name,
root_dir = root_dir,
@@ -19,15 +30,9 @@ return function(name, root_dir)
languages = { "angular" },
installer = npm.packages { "@angular/language-server", "typescript" },
default_options = {
+ cmd = get_cmd(path.cwd()),
on_new_config = function(new_config, new_root_dir)
- new_config.cmd = {
- npm.executable(root_dir, "ngserver"),
- "--stdio",
- "--tsProbeLocations",
- table.concat(append_node_modules { root_dir, new_root_dir }, ","),
- "--ngProbeLocations",
- table.concat(append_node_modules { root_dir, new_root_dir }, ","),
- }
+ new_config.cmd = get_cmd(new_root_dir)
end,
},
}