mirror of
https://github.com/tomru/nvim.git
synced 2026-03-03 06:27:14 +01:00
fix root detection for lsp
This commit is contained in:
@@ -205,19 +205,26 @@ return {
|
|||||||
root_dir = function(bufnr, cb)
|
root_dir = function(bufnr, cb)
|
||||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||||
|
|
||||||
if fname:find 'frontend%-apps/bcr/core/public' then
|
if fname:find 'frontend%-apps/bcr/core/public/src' then
|
||||||
-- yes, so use the core root
|
-- yes, so use the core root
|
||||||
local root = vim.fs.root(fname, { 'apps/core/public/' })
|
local root = vim.fs.root(fname, { 'core/public/src' })
|
||||||
cb(root)
|
if root then return cb(root) end
|
||||||
elseif fname:find 'frontend%-apps/bcr' then
|
end
|
||||||
|
|
||||||
|
if fname:find 'frontend%-apps/bcr' then
|
||||||
-- am I in core?
|
-- am I in core?
|
||||||
local root = vim.fs.root(fname, { 'apps/' })
|
local root = vim.fs.root(fname, { 'apps/' })
|
||||||
cb(root)
|
if root then return cb(root) end
|
||||||
else
|
end
|
||||||
|
|
||||||
|
if fname:find 'prisma%-design%-system/' then
|
||||||
|
local root = vim.fs.root(fname, { '.git' })
|
||||||
|
if root then return cb(root) end
|
||||||
|
end
|
||||||
|
|
||||||
local default_markers = { 'tsconfig.json', 'package.json', 'jsconfig.json', '.git' }
|
local default_markers = { 'tsconfig.json', 'package.json', 'jsconfig.json', '.git' }
|
||||||
local root = vim.fs.root(fname, default_markers)
|
local root = vim.fs.root(fname, default_markers)
|
||||||
cb(root)
|
cb(root)
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user