Skip to content

feat: add note about root_dir for nvim-lspconfig#2642

Open
martenmatrix wants to merge 4 commits intodenoland:mainfrom
martenmatrix:patch-1
Open

feat: add note about root_dir for nvim-lspconfig#2642
martenmatrix wants to merge 4 commits intodenoland:mainfrom
martenmatrix:patch-1

Conversation

@martenmatrix
Copy link
Copy Markdown

@martenmatrix martenmatrix commented Oct 10, 2025

nvim-lspconfig is 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 attaching ts_ls and denols to a buffer.

Additionally, single_file_support was renamed to workspace_required in NeoVim.

@martenmatrix
Copy link
Copy Markdown
Author

I apologize for not creating an issue for this. I hope that is fine.

Copy link
Copy Markdown
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! The single_file_supportworkspace_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants