aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-09-21 20:21:19 -0400
committerJustin M. Keyes <justinkz@gmail.com>2025-09-21 20:21:19 -0400
commitef73a4f2a1ddf0439eb97b46de2aab265ddba1cd (patch)
tree8a2a0521aef0eec06f362cd962e976628a098331
parentfeat(foam_ls): fallback root directories #4085 (diff)
downloadnvim-lspconfig-ef73a4f2a1ddf0439eb97b46de2aab265ddba1cd.tar
nvim-lspconfig-ef73a4f2a1ddf0439eb97b46de2aab265ddba1cd.tar.gz
nvim-lspconfig-ef73a4f2a1ddf0439eb97b46de2aab265ddba1cd.tar.bz2
nvim-lspconfig-ef73a4f2a1ddf0439eb97b46de2aab265ddba1cd.tar.lz
nvim-lspconfig-ef73a4f2a1ddf0439eb97b46de2aab265ddba1cd.tar.xz
nvim-lspconfig-ef73a4f2a1ddf0439eb97b46de2aab265ddba1cd.tar.zst
nvim-lspconfig-ef73a4f2a1ddf0439eb97b46de2aab265ddba1cd.zip
docs: root marker priority
-rw-r--r--CONTRIBUTING.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5a2cc836..715bf13f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -100,6 +100,31 @@ return {
}
```
+### Root marker priority
+
+By default, the [`root_markers` field](https://neovim.io/doc/user/lsp.html#lsp-root_markers) is ordered by priority.
+However, configs can specify "equal priority" (since Nvim 0.11.3) by placing names in a nested list.
+
+For example in this config, `'package.json'` and `'tsconfig.json'` have *equal* priority, whereas `'.git'` has lower priority.
+
+```lua
+return {
+ …
+ root_markers = { { 'package.json', 'tsconfig.json' }, { '.git' } }
+}
+```
+
+Since nvim-lspconfig still supports Nvim older than 0.11.3, avoid the "nested list" form on older versions of Nvim:
+
+```lua
+return {
+ …
+ root_markers = vim.fn.has('nvim-0.11.3') == 1
+ and { { 'package.json', 'tsconfig.json' }, { '.git' } }
+ or { 'package.json', 'tsconfig.json', '.git' }
+}
+```
+
## Commit style
Follow the Neovim core [commit message guidelines](https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#commit-messages). Examples: