mirror of
https://github.com/neovim/nvim-lspconfig.git
synced 2026-05-08 01:56:09 +02:00
fix: fix incorrect root finding
This commit is contained in:
parent
cedf795225
commit
513f4f0bde
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user