mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-30 22:59:22 +02:00
chore: minor cleanup to root_dir comments (#1222)
This commit is contained in:
parent
120590b8ec
commit
7cd03ff4e3
1 changed files with 4 additions and 6 deletions
|
@ -24,21 +24,19 @@ function M.get_registered_providers_by_filetype(ft)
|
|||
end
|
||||
|
||||
local function validate_nodejs_provider(requests, provider)
|
||||
local root_dir = ""
|
||||
local root_dir
|
||||
if lvim.builtin.rooter.active then
|
||||
--- old logic to set root_dir
|
||||
--- use vim-rooter to set root_dir
|
||||
vim.cmd "let root_dir = FindRootDirectory()"
|
||||
root_dir = vim.api.nvim_get_var "root_dir"
|
||||
else
|
||||
--- new logic to set root_dir
|
||||
--- use LSP to set root_dir
|
||||
local ts_client = require("utils").get_active_client_by_ft "typescript"
|
||||
if ts_client then
|
||||
root_dir = ts_client.config.root_dir
|
||||
end
|
||||
if ts_client == nil then
|
||||
u.lvim_log "Unable to determine root directory since tsserver didn't start correctly"
|
||||
return
|
||||
end
|
||||
root_dir = ts_client.config.root_dir
|
||||
end
|
||||
local local_nodejs_command = root_dir .. "/node_modules/.bin/" .. provider._opts.command
|
||||
u.lvim_log(string.format("checking [%s] for local node module: [%s]", local_nodejs_command, vim.inspect(provider)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue