feat: add note about root_dir for nvim-lspconfig#2642
Conversation
|
I apologize for not creating an issue for this. I hope that is fine. |
bartlomieju
left a comment
There was a problem hiding this comment.
Thanks for the contribution! The single_file_support → workspace_required update is needed, but there are a few issues to address:
1. root_dir example is incorrect
The added code block has:
root_dir = {"package.json"},But root_dir expects a function, not a table of strings. It should use root_pattern from lspconfig:
root_dir = require("lspconfig").util.root_pattern("package.json"),As written, this would break users' configs.
2. Kickstart.nvim section not updated
The kickstart.nvim example further down the page still uses single_file_support = false — this should also be updated to workspace_required = true for consistency.
3. Fragile GitHub line-number link
The link to lsp/ts_ls.lua#L56-L68 will break as that file changes. Consider linking to the file without line numbers, or just describing the behavior inline.
lunadogbot
left a comment
There was a problem hiding this comment.
root_dir = {"package.json"}is still wrong for thets_lssample.root_dirneeds a resolver function here; userequire("lspconfig").util.root_pattern("package.json")or keep this example on the nativeroot_markersAPI.- The Kickstart.nvim block still uses
single_file_support = falsefor bothts_lsanddenols, so the page now gives conflicting advice after the text switched toworkspace_required = true. Please update that block too.
- nit: the GitHub link to
lsp/ts_ls.lua#L56-L68is fragile; link to the file or explain the behavior inline.
fibibot
left a comment
There was a problem hiding this comment.
Two blockers still need fixing before this page can safely recommend the new Neovim config.
root_dir = {"package.json"}is not a validnvim-lspconfigresolver forts_ls; userequire("lspconfig").util.root_pattern("package.json"), or keep the example on nativeroot_markersinstead.- The Kickstart.nvim block still says
single_file_support = falsefor bothts_lsanddenols, while the text above moved toworkspace_required = true. Update that block too so the page does not give conflicting configuration.
- nit: the
lsp/ts_ls.lua#L56-L68link is line-number fragile; link to the file or describe the behavior inline.
- Use root_pattern() for root_dir instead of a plain table - Update Kickstart.nvim block to use workspace_required = true instead of single_file_support = false - Remove fragile line-number anchor from lsp/ts_ls.lua link
fibibot
left a comment
There was a problem hiding this comment.
The Neovim examples now use workspace_required and a root_pattern(...) resolver consistently. One repo-convention blocker remains:
last_modified: 2026-02-19still has the old date even though this page now changes the documented Neovim setup. Please bump it for this content update.
nvim-lspconfigis the official collection of LSP server configurations by NeoVim. Therefore, the majority of NeoVim users use those defaults. It should be included how to prevent attachingts_lsanddenolsto a buffer.Additionally,
single_file_supportwas renamed toworkspace_requiredin NeoVim.