Skip to content

Commit 1f53b49

Browse files
committed
chore(setup) completion nvim-lua#2
1 parent dd4000a commit 1f53b49

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

init.lua

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,8 @@ require('lazy').setup({
652652
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
653653
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
654654
local capabilities = require('blink.cmp').get_lsp_capabilities()
655-
655+
local completion_capabilites = require('cmp_nvim_lsp').default_capabilities()
656+
capabilities = vim.tbl_deep_extend('force', {}, capabilities, completion_capabilites or {})
656657
-- Enable the following language servers
657658
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
658659
--
@@ -663,14 +664,27 @@ require('lazy').setup({
663664
-- - settings (table): Override the default settings passed when initializing the server.
664665
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
665666
local servers = {
666-
java_language_server = {},
667-
jsonls = {},
668-
ltex = {},
667+
java_language_server = {
668+
capabilities = capabilities,
669+
},
670+
jsonls = {
671+
capabilities = capabilities,
672+
},
673+
ltex = {
674+
capabilities = capabilities,
675+
},
669676
-- clangd = {},
670-
gopls = {},
671-
tflint = {},
672-
terraformls = {},
677+
gopls = {
678+
capabilities = capabilities,
679+
},
680+
tflint = {
681+
capabilities = capabilities,
682+
},
683+
terraformls = {
684+
capabilities = capabilities,
685+
},
673686
pyright = {
687+
capabilities = capabilities,
674688
settings = {
675689
pyright = {
676690
autoImportCompletion = true,
@@ -702,6 +716,7 @@ require('lazy').setup({
702716
-- ts_ls = {},
703717
--
704718
dockerls = {
719+
capabilities = capabilities,
705720
settings = {
706721
docker = { languageserver = { formatter = { ignoreMultilineInstructions = true } } },
707722
},
@@ -711,6 +726,7 @@ require('lazy').setup({
711726
-- cmd = { ... },
712727
-- filetypes = { ... },
713728
-- capabilities = {},
729+
capabilities = capabilities,
714730
settings = {
715731
Lua = {
716732
completion = {

lua/plugins/completions.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
return {
2+
{
3+
'hrsh7th/cmp-nvim-lsp',
4+
},
25
{
36
'L3MON4D3/LuaSnip',
47
-- follow latest release.

0 commit comments

Comments
 (0)