Comments (2)
This only seems to provide the ability to find the root directory based on the markers provided into the function. This looks to me more equivalent to util.root.detectors.patterns
specifically.
It doesn't account for the LSP servers root_dir
. To use vim.fs.root
for discovering LSP servers root_dir
, we would have to specify every possible marker as a pattern for the root_dir
of every LSP server (and that would also make it hardcoded and what if users wanted to change the LSP server's root_dir
pattern in their personal configuration in nvim-lspconfig
spec?).
util.root.detectors.lsp
gets the root_dir
directly from the LSP client.
So, personally I fail to see how this can replace the whole util.root
.
from lazyvim.
https://neovim.io/doc/user/lua.html#vim.fs.root()
-- Find the root of a Python project, starting from file 'main.py'
vim.fs.root(vim.fs.joinpath(vim.env.PWD, 'main.py'), {'pyproject.toml', 'setup.py' })
-- Find the root of a git repository
vim.fs.root(0, '.git')
-- Find the parent directory containing any file with a .csproj extension
vim.fs.root(0, function(name, path)
return name:match('%.csproj$') ~= nil
end)
from lazyvim.
Related Issues (20)
- bug: settings for outline.nvim cause symbol search crash HOT 2
- bug: debugging C# with omnisharp - netcoredbg.CMD exited with code: 1
- bug: weird keymap error HOT 3
- feature: use which-keys new dynamic `desc` and `icon` for the ui toggles HOT 3
- bug: telescope require `fd` when find files HOT 1
- bug: Mason package path not found for debugpy HOT 7
- bug: "fzf project " does not set pwd to the project path, which is different with what "telescope project" do. HOT 2
- feature: correctly overriding core plugin mini.ai
- bug: rust codelens is not complete HOT 1
- bug: lsp keymaps calling functions rather than passing function HOT 1
- bug: Mason plugin doesn't install mason-registry HOT 3
- bug: Error with nvim-cmp HOT 3
- feature: allow for overriding keymaps of dial.nvim
- bug: Can't Select Items on cmp HOT 1
- bug: Ctrl-n and Ctrl-p to go through suggestions not working anymore. HOT 2
- bug: cursor abnormal HOT 2
- bug: WARNING prettier unavailable: Condition failed
- feature: Do not update plug-ins repeatedly HOT 4
- feature: Expose a function to "process" a `toggle` to the users HOT 18
- bug: yanky extra breaks `<` and `>` in neo-tree HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lazyvim.