Skip to content

Commit

Permalink
fix(lsp): register snippetSupport capability only if using nvim >= …
Browse files Browse the repository at this point in the history
…0.10
  • Loading branch information
mrcjkb committed May 16, 2024
1 parent be0f0e7 commit 66466d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Executors/termopen:
`<Esc>` to close buffer not silent.
Thanks [@b1n](https://github.com/b1n)!
- LSP: Only register `completionItem.snippetSupport` client capability
when using Neovim >= 0.10.

## [4.23.1] - 2024-05-12

Expand Down
7 changes: 5 additions & 2 deletions lua/rustaceanvim/config/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ end
local function make_rustaceanvim_capabilities()
local capabilities = vim.lsp.protocol.make_client_capabilities()

-- snippets
capabilities.textDocument.completion.completionItem.snippetSupport = true
if vim.fn.has('nvim-0.10.0') == 1 then
-- snippets
-- This will also be added if cmp_nvim_lsp is detected.
capabilities.textDocument.completion.completionItem.snippetSupport = true
end

-- send actions with hover request
capabilities.experimental = {
Expand Down

0 comments on commit 66466d4

Please sign in to comment.