aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/angularls/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-09-17 16:05:20 +0200
committerGitHub <noreply@github.com>2021-09-17 16:05:20 +0200
commit9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6 (patch)
tree58da4fff57cc3aff4380f501b1845310dff4f2e8 /lua/nvim-lsp-installer/servers/angularls/init.lua
parenttexlab: fix ensure_executables (diff)
downloadmason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.gz
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.bz2
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.lz
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.xz
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.zst
mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.zip
optimize io (70%+ startup speedups) (#93)
Diffstat (limited to 'lua/nvim-lsp-installer/servers/angularls/init.lua')
-rw-r--r--lua/nvim-lsp-installer/servers/angularls/init.lua57
1 files changed, 28 insertions, 29 deletions
diff --git a/lua/nvim-lsp-installer/servers/angularls/init.lua b/lua/nvim-lsp-installer/servers/angularls/init.lua
index 8de5b29f..89c62741 100644
--- a/lua/nvim-lsp-installer/servers/angularls/init.lua
+++ b/lua/nvim-lsp-installer/servers/angularls/init.lua
@@ -11,37 +11,36 @@ local function get_probe_dir(root_dir)
return project_root and (project_root .. "/node_modules") or ""
end
-local default_probe_dir = get_probe_dir(vim.fn.getcwd())
+return function(name, root_dir)
+ local default_probe_dir = get_probe_dir(vim.fn.getcwd())
+ local executable_path = npm.executable(root_dir, "ngserver")
-local root_dir = server.get_server_root_path "angularls"
-
-local executable_path = npm.executable(root_dir, "ngserver")
-
-return server.Server:new {
- name = "angularls",
- root_dir = root_dir,
- installer = npm.packages { "@angular/language-server" },
- default_options = {
- cmd = {
- executable_path,
- "--stdio",
- "--tsProbeLocations",
- default_probe_dir,
- "--ngProbeLocations",
- default_probe_dir,
- },
- on_new_config = function(new_config, new_root_dir)
- local new_probe_dir = get_probe_dir(new_root_dir)
-
- -- We need to check our probe directories because they may have changed.
- new_config.cmd = {
+ return server.Server:new {
+ name = name,
+ root_dir = root_dir,
+ installer = npm.packages { "@angular/language-server" },
+ default_options = {
+ cmd = {
executable_path,
"--stdio",
"--tsProbeLocations",
- new_probe_dir,
+ default_probe_dir,
"--ngProbeLocations",
- new_probe_dir,
- }
- end,
- },
-}
+ default_probe_dir,
+ },
+ on_new_config = function(new_config, new_root_dir)
+ local new_probe_dir = get_probe_dir(new_root_dir)
+
+ -- We need to check our probe directories because they may have changed.
+ new_config.cmd = {
+ executable_path,
+ "--stdio",
+ "--tsProbeLocations",
+ new_probe_dir,
+ "--ngProbeLocations",
+ new_probe_dir,
+ }
+ end,
+ },
+ }
+end