Skip to content

Commit 550b778

Browse files
author
Marc Jakobi
committed
docs: clarify that vim.lsp.config() expects a vim.lsp.ClientConfig
1 parent f24284c commit 550b778

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

doc/rustaceanvim.txt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,23 +168,15 @@ vim.g.rustaceanvim = {
168168
Notes:
169169

170170
- `vim.g.rustaceanvim` can also be a function that returns a |rustaceanvim.Opts| table.
171-
- You can also configure rust-analyzer using a `.vscode/settings.json` file
172-
or via |vim.lsp.config| (using the `'rust-analyzer'` key).
171+
- You can also configure the rust-analyzer LSP client using a `.vscode/settings.json` file
172+
or via |vim.lsp.config()| (using the `'rust-analyzer'` key).
173173

174174

175175
rustaceanvim.Opts *rustaceanvim.Opts*
176176

177177
Fields: ~
178-
{tools?} (rustaceanvim.tools.Opts)
179-
Plugin options.
180-
{server?} (rustaceanvim.lsp.ClientOpts)
181-
Language server client options.
182-
These can also be set using |vim.lsp.config()| for "rust-analyzer" or "*".
183-
If both the `server` table and a `vim.lsp.config["rust-analyzer"]` are defined,
184-
rustaceanvim merges |vim.lsp.config()| settings into the `server` table,
185-
giving them precedence over existing settings.
186-
{dap?} (rustaceanvim.dap.Opts)
187-
Debug adapter options
178+
{tools?} (rustaceanvim.tools.Opts)
179+
Plugin options.
188180

189181

190182
rustaceanvim.tools.Opts *rustaceanvim.tools.Opts*

lua/rustaceanvim/config/init.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
---Notes:
4040
---
4141
--- - `vim.g.rustaceanvim` can also be a function that returns a |rustaceanvim.Opts| table.
42-
--- - You can also configure rust-analyzer using a `.vscode/settings.json` file
43-
--- or via |vim.lsp.config| (using the `'rust-analyzer'` key).
42+
--- - You can also configure the rust-analyzer LSP client using a `.vscode/settings.json` file
43+
--- or via |vim.lsp.config()| (using the `'rust-analyzer'` key).
4444
---
4545
---@brief ]]
4646

@@ -55,10 +55,13 @@ vim.g.rustaceanvim = vim.g.rustaceanvim
5555
---@field tools? rustaceanvim.tools.Opts
5656
---
5757
---Language server client options.
58-
---These can also be set using |vim.lsp.config()| for "rust-analyzer" or "*".
58+
---Some fields can also be set using |vim.lsp.config()| for "rust-analyzer" or "*".
5959
---If both the `server` table and a `vim.lsp.config["rust-analyzer"]` are defined,
6060
---rustaceanvim merges |vim.lsp.config()| settings into the `server` table,
6161
---giving them precedence over existing settings.
62+
---Note that |vim.lsp.config()| expects a |vim.lsp.ClientConfig|.
63+
---Although you can also pass in |rustaceanvim.lsp.ClientOpts|, doing so is not
64+
-- officially supported and may not be possible in the future.
6265
---@field server? rustaceanvim.lsp.ClientOpts
6366
---
6467
---Debug adapter options

0 commit comments

Comments
 (0)