From da1f4654dc628e041b500d30392a35a62b18b16c Mon Sep 17 00:00:00 2001 From: Marten <76761713+martenmatrix@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:21:32 +0200 Subject: [PATCH 1/3] feat: add note about root_dir for nvim-lspconfig --- runtime/getting_started/setup_your_environment.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runtime/getting_started/setup_your_environment.md b/runtime/getting_started/setup_your_environment.md index ee7629b53..b5e9aeabf 100644 --- a/runtime/getting_started/setup_your_environment.md +++ b/runtime/getting_started/setup_your_environment.md @@ -98,6 +98,15 @@ vim.lsp.config('ts_ls', { For Deno, the example above assumes a `deno.json` or `deno.jsonc` file exists at the root of the project. +If you're using `nvim-lspconfig`, you'll have to set `root_dir` for `ts_ls`. This is because `nvim-lspconfig` creates a [`root_dir`](https://github.com/neovim/nvim-lspconfig/blob/master/lsp/ts_ls.lua#L56-L68) entry and `root_markers` is [unused if root_dir is specified](https://neovim.io/doc/user/lsp.html). +```lua +vim.lsp.config('ts_ls', { + on_attach = on_attach, + root_dir = {"package.json"}, + single_file_support = false, +}) +``` + ##### Kickstart.nvim and Mason LSP If you are using [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim) From c5124d0a7ae0d2daa6589be90dd16b79ce7e4005 Mon Sep 17 00:00:00 2001 From: Marten <76761713+martenmatrix@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:42:27 +0200 Subject: [PATCH 2/3] chore: format --- runtime/getting_started/setup_your_environment.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/getting_started/setup_your_environment.md b/runtime/getting_started/setup_your_environment.md index b5e9aeabf..e7a015520 100644 --- a/runtime/getting_started/setup_your_environment.md +++ b/runtime/getting_started/setup_your_environment.md @@ -98,7 +98,12 @@ vim.lsp.config('ts_ls', { For Deno, the example above assumes a `deno.json` or `deno.jsonc` file exists at the root of the project. -If you're using `nvim-lspconfig`, you'll have to set `root_dir` for `ts_ls`. This is because `nvim-lspconfig` creates a [`root_dir`](https://github.com/neovim/nvim-lspconfig/blob/master/lsp/ts_ls.lua#L56-L68) entry and `root_markers` is [unused if root_dir is specified](https://neovim.io/doc/user/lsp.html). +If you're using `nvim-lspconfig`, you'll have to set `root_dir` for `ts_ls`. +This is because `nvim-lspconfig` creates a +[`root_dir`](https://github.com/neovim/nvim-lspconfig/blob/master/lsp/ts_ls.lua#L56-L68) +entry and `root_markers` is +[unused if root_dir is specified](https://neovim.io/doc/user/lsp.html). + ```lua vim.lsp.config('ts_ls', { on_attach = on_attach, From 8ec4ceb1efc5068ef68a904eeabf3005b11300f8 Mon Sep 17 00:00:00 2001 From: Marten <76761713+martenmatrix@users.noreply.github.com> Date: Fri, 10 Oct 2025 19:10:25 +0200 Subject: [PATCH 3/3] feat: single_file_support was renamed to workspace_required --- runtime/getting_started/setup_your_environment.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/getting_started/setup_your_environment.md b/runtime/getting_started/setup_your_environment.md index e7a015520..67f04abb5 100644 --- a/runtime/getting_started/setup_your_environment.md +++ b/runtime/getting_started/setup_your_environment.md @@ -79,7 +79,7 @@ instructions to enable the Note that if you also have `ts_ls` as an LSP client, you may run into issues where both `ts_ls` and `denols` are attached to your current buffer. To resolve this, make sure to set some unique `root_dir` for both `ts_ls` and `denols`. You -may also need to set `single_file_support` to `false` for `ts_ls` to prevent it +may also need to set `workspace_required` to `true` for `ts_ls` to prevent it from running in `single file mode`. Here is an example of such a configuration: ```lua @@ -91,7 +91,7 @@ vim.lsp.config('denols', { vim.lsp.config('ts_ls', { on_attach = on_attach, root_markers = {"package.json"}, - single_file_support = false, + workspace_required = true, }) ``` @@ -108,7 +108,7 @@ entry and `root_markers` is vim.lsp.config('ts_ls', { on_attach = on_attach, root_dir = {"package.json"}, - single_file_support = false, + workspace_required = true, }) ```