diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2025-09-21 20:21:19 -0400 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2025-09-21 20:21:19 -0400 |
| commit | ef73a4f2a1ddf0439eb97b46de2aab265ddba1cd (patch) | |
| tree | 8a2a0521aef0eec06f362cd962e976628a098331 | |
| parent | feat(foam_ls): fallback root directories #4085 (diff) | |
| download | nvim-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.md | 25 |
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: |
