Closed towry closed 1 month ago
In monorepo, the eslint is installed at the root node_modules by pnpm.
node_modules
In code https://github.com/nvimtools/none-ls.nvim/blob/8691504118b252d64fc5023a104aedd100ab754a/lua/null-ls/helpers/command_resolver.lua#L40
The u.get_root() will cause the searching only traverse up to the sub package's root if the nvim user are using some project manage plugin.
u.get_root()
For example:
-- monorepo - node_modules - packages - foo-package - index.js - node_modules
If we are edit the index.js in foo-package, the vim.uv.cwd() will be monorepo/packages/foo-package, but the eslint are in monorepo/node_modules/.bin because of pnpm.
vim.uv.cwd()
monorepo/packages/foo-package
eslint
monorepo/node_modules/.bin
So u.get_root() returns monorepo/packages/foo-package and in https://github.com/nvimtools/none-ls.nvim/blob/8691504118b252d64fc5023a104aedd100ab754a/lua/null-ls/helpers/command_resolver.lua#L11 the search will be stopped immediately.
Yes
I suggest add an option to change the end_path when searching for command executable. for example, config.get_search_root_stop_path
end_path
config.get_search_root_stop_path
Issues
Feature description
In monorepo, the eslint is installed at the root
node_modules
by pnpm.In code https://github.com/nvimtools/none-ls.nvim/blob/8691504118b252d64fc5023a104aedd100ab754a/lua/null-ls/helpers/command_resolver.lua#L40
The
u.get_root()
will cause the searching only traverse up to the sub package's root if the nvim user are using some project manage plugin.For example:
If we are edit the index.js in foo-package, the
vim.uv.cwd()
will bemonorepo/packages/foo-package
, but theeslint
are inmonorepo/node_modules/.bin
because of pnpm.So
u.get_root()
returnsmonorepo/packages/foo-package
and in https://github.com/nvimtools/none-ls.nvim/blob/8691504118b252d64fc5023a104aedd100ab754a/lua/null-ls/helpers/command_resolver.lua#L11 the search will be stopped immediately.Help
Yes
Implementation help
I suggest add an option to change the
end_path
when searching for command executable. for example,config.get_search_root_stop_path