aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2025-01-22 14:20:49 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2025-01-22 16:28:20 +0100
commit513f4f0bde469ecb3abe2e1b606f63cf142e751e (patch)
treef1a4108872b8c3c668f5827a21f9b479250ef261
parentdocs: fix typo (diff)
downloadnvim-lspconfig-1.4.0.tar
nvim-lspconfig-1.4.0.tar.gz
nvim-lspconfig-1.4.0.tar.bz2
nvim-lspconfig-1.4.0.tar.lz
nvim-lspconfig-1.4.0.tar.xz
nvim-lspconfig-1.4.0.tar.zst
nvim-lspconfig-1.4.0.zip
fix: fix incorrect root findingv1.4.0
-rw-r--r--lua/lspconfig/configs/angularls.lua2
-rw-r--r--lua/lspconfig/configs/astro.lua2
-rw-r--r--lua/lspconfig/configs/glint.lua2
-rw-r--r--lua/lspconfig/configs/relay_lsp.lua2
-rw-r--r--lua/lspconfig/configs/volar.lua2
5 files changed, 5 insertions, 5 deletions
diff --git a/lua/lspconfig/configs/angularls.lua b/lua/lspconfig/configs/angularls.lua
index c704f508..91b076a1 100644
--- a/lua/lspconfig/configs/angularls.lua
+++ b/lua/lspconfig/configs/angularls.lua
@@ -4,7 +4,7 @@ local util = require 'lspconfig.util'
-- 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 = vim.fs.find('node_modules', { path = root_dir, upward = true })[1]
+ local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1])
return project_root and (project_root .. '/node_modules') or ''
end
diff --git a/lua/lspconfig/configs/astro.lua b/lua/lspconfig/configs/astro.lua
index 2600356d..23c3f760 100644
--- a/lua/lspconfig/configs/astro.lua
+++ b/lua/lspconfig/configs/astro.lua
@@ -1,7 +1,7 @@
local util = require 'lspconfig.util'
local function get_typescript_server_path(root_dir)
- local project_root = vim.fs.find('node_modules', { path = root_dir, upward = true })[1]
+ local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1])
return project_root and (project_root .. '/typescript/lib') or ''
end
diff --git a/lua/lspconfig/configs/glint.lua b/lua/lspconfig/configs/glint.lua
index 5c3c97c6..9240a969 100644
--- a/lua/lspconfig/configs/glint.lua
+++ b/lua/lspconfig/configs/glint.lua
@@ -4,7 +4,7 @@ return {
default_config = {
cmd = { 'glint-language-server' },
on_new_config = function(config, new_root_dir)
- local project_root = vim.fs.find('node_modules', { path = new_root_dir, upward = true })[1]
+ local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = new_root_dir, upward = true })[1])
-- Glint should not be installed globally.
local node_bin_path = project_root .. '/node_modules/.bin'
local path = node_bin_path .. (vim.fn.has('win32') == 1 and ';' or ':') .. vim.env.PATH
diff --git a/lua/lspconfig/configs/relay_lsp.lua b/lua/lspconfig/configs/relay_lsp.lua
index 78ec20a0..cc8e2c5b 100644
--- a/lua/lspconfig/configs/relay_lsp.lua
+++ b/lua/lspconfig/configs/relay_lsp.lua
@@ -23,7 +23,7 @@ return {
},
root_dir = util.root_pattern('relay.config.*', 'package.json'),
on_new_config = function(config, root_dir)
- local project_root = vim.fs.find('node_modules', { path = root_dir, upward = true })[1]
+ local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1])
local node_bin_path = project_root .. '/node_modules/.bin'
local compiler_cmd = { node_bin_path .. '/relay-compiler', '--watch' }
local path = node_bin_path .. (vim.fn.has('win32') == 1 and ';' or ':') .. vim.env.PATH
diff --git a/lua/lspconfig/configs/volar.lua b/lua/lspconfig/configs/volar.lua
index 1eb0ba3d..b180f1a9 100644
--- a/lua/lspconfig/configs/volar.lua
+++ b/lua/lspconfig/configs/volar.lua
@@ -1,7 +1,7 @@
local util = require 'lspconfig.util'
local function get_typescript_server_path(root_dir)
- local project_root = vim.fs.find('node_modules', { path = root_dir, upward = true })[1]
+ local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1])
return project_root and (project_root .. '/typescript/lib') or ''
end