Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions runtime/getting_started/setup_your_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -91,13 +91,27 @@ vim.lsp.config('denols', {
vim.lsp.config('ts_ls', {
on_attach = on_attach,
root_markers = {"package.json"},
single_file_support = false,
workspace_required = true,
})
```

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"},
workspace_required = true,
})
```

##### Kickstart.nvim and Mason LSP

If you are using [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim)
Expand Down
Loading