From c87e2fec9f54a438ddfd50642426a2dd628de180 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Mon, 18 Oct 2021 14:04:54 +0200 Subject: feat: autogen metadata table(s) (#159) Co-authored-by: William Boman --- lua/nvim-lsp-installer/servers/angularls/init.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'lua/nvim-lsp-installer/servers/angularls/init.lua') diff --git a/lua/nvim-lsp-installer/servers/angularls/init.lua b/lua/nvim-lsp-installer/servers/angularls/init.lua index 5a545cd2..102ad32f 100644 --- a/lua/nvim-lsp-installer/servers/angularls/init.lua +++ b/lua/nvim-lsp-installer/servers/angularls/init.lua @@ -1,17 +1,18 @@ -local util = require "lspconfig/util" local server = require "nvim-lsp-installer.server" local npm = require "nvim-lsp-installer.installers.npm" --- Angular requires a node_modules directory to probe for @angular/language-service and typescript --- in order to use your projects configured versions. --- This defaults to the vim cwd, but will get overwritten by the resolved root of the file. -local function get_probe_dir(root_dir) - local project_root = util.find_node_modules_ancestor(root_dir) +return function(name, root_dir) + local util = require "lspconfig/util" + -- + -- Angular requires a node_modules directory to probe for @angular/language-service and typescript + -- in order to use your projects configured versions. + -- This defaults to the vim cwd, but will get overwritten by the resolved root of the file. + local function get_probe_dir(root_dir) + local project_root = util.find_node_modules_ancestor(root_dir) - return project_root and (project_root .. "/node_modules") or "" -end + return project_root and (project_root .. "/node_modules") or "" + end -return function(name, root_dir) local default_probe_dir = get_probe_dir(vim.fn.getcwd()) local executable_path = npm.executable(root_dir, "ngserver") -- cgit v1.2.3-70-g09d2