mirror of
https://github.com/tomru/nvim.git
synced 2026-03-02 22:17:13 +01:00
fix root detection for lsp
This commit is contained in:
@@ -205,19 +205,26 @@ return {
|
||||
root_dir = function(bufnr, cb)
|
||||
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
|
||||
local root = vim.fs.root(fname, { 'apps/core/public/' })
|
||||
cb(root)
|
||||
elseif fname:find 'frontend%-apps/bcr' then
|
||||
local root = vim.fs.root(fname, { 'core/public/src' })
|
||||
if root then return cb(root) end
|
||||
end
|
||||
|
||||
if fname:find 'frontend%-apps/bcr' then
|
||||
-- am I in core?
|
||||
local root = vim.fs.root(fname, { 'apps/' })
|
||||
cb(root)
|
||||
else
|
||||
local default_markers = { 'tsconfig.json', 'package.json', 'jsconfig.json', '.git' }
|
||||
local root = vim.fs.root(fname, default_markers)
|
||||
cb(root)
|
||||
if root then return cb(root) end
|
||||
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 root = vim.fs.root(fname, default_markers)
|
||||
cb(root)
|
||||
end,
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user