|
@ -92,19 +92,12 @@ return { |
|
|
local capabilities = vim.lsp.protocol.make_client_capabilities() |
|
|
local capabilities = vim.lsp.protocol.make_client_capabilities() |
|
|
capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities()) |
|
|
capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities()) |
|
|
|
|
|
|
|
|
-- Function to detect the operating system |
|
|
|
|
|
local function get_os() |
|
|
|
|
|
local handle = io.popen("uname") |
|
|
|
|
|
if not handle then |
|
|
|
|
|
return error("Failed to detect operating system") |
|
|
|
|
|
end |
|
|
|
|
|
local result = handle:read("*a") |
|
|
|
|
|
handle:close() |
|
|
|
|
|
return result:lower():gsub("%s+", "") |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local base_path = "/usr/lib/node_modules" |
|
|
|
|
|
if get_os() == "darwin" then |
|
|
|
|
|
|
|
|
local base_path = "" |
|
|
|
|
|
if (vim.loop.fs_stat("/usr/lib/node_modules")) then |
|
|
|
|
|
base_path = "/usr/lib/node_modules" |
|
|
|
|
|
elseif (vim.loop.fs_stat("/usr/local/lib/node_modules")) then |
|
|
|
|
|
base_path = "/usr/local/lib/node_modules" |
|
|
|
|
|
elseif (vim.loop.fs_stat("/opt/homebrew/lib/node_modules")) then |
|
|
base_path = "/opt/homebrew/lib/node_modules" |
|
|
base_path = "/opt/homebrew/lib/node_modules" |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|