Skip to content

Commit 5167895

Browse files
committed
use vim.lsp.config for capabilities
Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
1 parent 9723854 commit 5167895

2 files changed

Lines changed: 4 additions & 15 deletions

File tree

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,6 @@ For best completion experience:
6565
vim.o.completeopt = 'menuone,noselect,noinsert,popup'
6666
```
6767

68-
And you also ideally want to set the capabilities so Neovim will fetch documentation when resolving completion items:
69-
70-
```lua
71-
-- Here we grab default Neovim capabilities and extend them with ones we want on top
72-
local capabilities = vim.tbl_deep_extend('force',
73-
vim.lsp.protocol.make_client_capabilities(),
74-
require('autocomplete.capabilities')
75-
)
76-
77-
-- Now set capabilities on your LSP servers
78-
require('lspconfig')['<YOUR_LSP_SERVER>'].setup {
79-
capabilities = capabilities
80-
}
81-
```
82-
8368
## cmdcomplete
8469
Command-line autocompletion
8570

lua/myplugins/bufcomplete.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ function M.setup(config)
131131

132132
local group = vim.api.nvim_create_augroup('myplugins-bufcomplete', { clear = true })
133133

134+
vim.lsp.config('*', {
135+
capabilities = M.capabilities(),
136+
})
137+
134138
vim.api.nvim_create_autocmd('TextChangedI', {
135139
group = group,
136140
desc = 'Auto show completion',

0 commit comments

Comments
 (0)