Skip to content

Commit 62f6454

Browse files
authored
refactor(nvim)!: Drop support for nvim-lspconfig and only use vim.lsp.config. (#197)
* refactor(nvim)!: Drop support for nvim-lspconfig and only use `vim.lsp.config`. * Auto generate docs * docs(nvim): Update version to `*` in nvim docs * Auto generate docs --------- Co-authored-by: Davidyz <Davidyz@users.noreply.github.com>
1 parent 76ccb24 commit 62f6454

3 files changed

Lines changed: 8 additions & 19 deletions

File tree

doc/VectorCode.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Use your favorite plugin manager.
5454
>lua
5555
{
5656
"Davidyz/VectorCode",
57-
version = "<0.7.0", -- optional, depending on whether you're on nightly or release
57+
version = "*", -- optional, depending on whether you're on nightly or release
5858
dependencies = { "nvim-lua/plenary.nvim" },
5959
cmd = "VectorCode", -- if you're lazy-loading VectorCode
6060
}
@@ -354,11 +354,9 @@ used in previous versions;
354354
2. The `lsp` based backend, which make use of the experimental `vectorcode-server`
355355
implemented in version 0.4.0. If you want to customise the LSP executable or
356356
any options supported by `vim.lsp.ClientConfig`, you can do so by using
357-
`vim.lsp.config()` or
358-
nvim-lspconfig <https://github.com/neovim/nvim-lspconfig>. The LSP will
359-
attempt to read configurations from these 2 sources before it starts. (If
360-
`vim.lsp.config.vectorcode_server` is not `nil`, this will be used and
361-
nvim-lspconfig will be ignored.)
357+
`vim.lsp.config()`. This plugin will load the config associated with the name
358+
`vectorcode_server`. You can override the default config (for example, the
359+
path to the executable) by calling `vim.lsp.config('vectorcode_server', opts)`.
362360

363361
-------------------------------------------------------------------------------
364362
Features default lsp

docs/neovim.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Use your favorite plugin manager.
4343
```lua
4444
{
4545
"Davidyz/VectorCode",
46-
version = "<0.7.0", -- optional, depending on whether you're on nightly or release
46+
version = "*", -- optional, depending on whether you're on nightly or release
4747
dependencies = { "nvim-lua/plenary.nvim" },
4848
cmd = "VectorCode", -- if you're lazy-loading VectorCode
4949
}
@@ -320,11 +320,9 @@ interface:
320320
2. The `lsp` based backend, which make use of the experimental `vectorcode-server`
321321
implemented in version 0.4.0. If you want to customise the LSP executable or
322322
any options supported by `vim.lsp.ClientConfig`, you can do so by using
323-
`vim.lsp.config()` or
324-
[nvim-lspconfig](https://github.com/neovim/nvim-lspconfig). The LSP will
325-
attempt to read configurations from these 2 sources before it starts. (If
326-
`vim.lsp.config.vectorcode_server` is not `nil`, this will be used and
327-
nvim-lspconfig will be ignored.)
323+
`vim.lsp.config()`. This plugin will load the config associated with the name
324+
`vectorcode_server`. You can override the default config (for example, the
325+
path to the executable) by calling `vim.lsp.config('vectorcode_server', opts)`.
328326

329327

330328
| Features | `default` | `lsp` |

lua/vectorcode/config.lua

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ local lsp_configs = function()
4949
-- nvim >= 0.11.0
5050
cfg = vim.tbl_deep_extend("force", cfg, vim.lsp.config.vectorcode_server)
5151
logger.debug("Using vim.lsp.config.vectorcode_server for LSP config:\n", cfg)
52-
else
53-
-- nvim < 0.11.0
54-
local ok, lspconfig = pcall(require, "lspconfig.configs")
55-
if ok and lspconfig.vectorcode_server ~= nil then
56-
cfg = lspconfig.vectorcode_server.config_def.default_config
57-
logger.debug("Using nvim-lspconfig for LSP config:\n", cfg)
58-
end
5952
end
6053
cfg.name = "vectorcode_server"
6154
if setup_config.sync_log_env_var then

0 commit comments

Comments
 (0)