Skip to content

Commit 6178000

Browse files
committed
Refresh lsp related configuration
1 parent 34dfbb9 commit 6178000

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

nvim/init/18_lsp.lua

+18-20
Original file line numberDiff line numberDiff line change
@@ -37,38 +37,38 @@ require('blink.cmp').setup {
3737
},
3838
documentation = {
3939
auto_show = true,
40-
auto_show_delay_ms = 500,
40+
},
41+
},
42+
signature = {
43+
enabled = true,
44+
window = {
45+
show_documentation = false,
4146
},
4247
},
4348
}
4449

45-
local blink_capabilities = require('blink.cmp').get_lsp_capabilities()
46-
4750
require('mason').setup()
4851
require('mason-lspconfig').setup {
4952
ensure_installed = {},
5053
automatic_installation = false,
5154
handlers = {
5255
function(server_name) -- default handler for servers that don't require custom setup
53-
require('lspconfig')[server_name].setup {
54-
capabilities = blink_capabilities
55-
}
56+
vim.lsp.enable(server_name)
5657
end,
5758
jsonls = function()
58-
require('lspconfig').jsonls.setup {
59-
capabilities = blink_capabilities,
59+
vim.lsp.config('jsonls', {
6060
settings = {
6161
json = {
6262
schemas = require('schemastore').json.schemas(),
6363
validate = { enable = true },
6464
},
65-
},
66-
}
65+
}
66+
})
67+
vim.lsp.enable('jsonls')
6768
end,
6869
yamlls = function()
69-
require('lspconfig').yamlls.setup(require('yaml-companion').setup {
70+
vim.lsp.config('yamlls', require('yaml-companion').setup {
7071
lspconfig = {
71-
capabilities = require('blink.cmp').get_lsp_capabilities(),
7272
settings = {
7373
yaml = {
7474
format = { enable = false },
@@ -77,15 +77,16 @@ require('mason-lspconfig').setup {
7777
},
7878
},
7979
})
80+
vim.lsp.enable('yamlls')
8081
end,
8182
terraformls = function()
82-
require('lspconfig').terraformls.setup {
83-
capabilities = blink_capabilities,
83+
vim.lsp.config('terraformls', {
8484
-- disable this lsp server syntax highlighting, it's garbage compared to what treesitter provides
8585
on_init = function(client)
8686
client.server_capabilities.semanticTokensProvider = nil
8787
end,
88-
}
88+
})
89+
vim.lsp.enable('terraformls')
8990
end,
9091
}
9192
}
@@ -95,11 +96,8 @@ vim.api.nvim_create_autocmd('User', {
9596
group = vim.api.nvim_create_augroup('copilot-suggestion-hide', { clear = true }),
9697
pattern = 'BlinkCmpMenuOpen',
9798
callback = function()
99+
require('copilot.suggestion').dismiss()
98100
vim.b.copilot_suggestion_hidden = true
99-
local copilot = require('copilot.suggestion')
100-
if copilot.is_visible() then
101-
copilot.dismiss()
102-
end
103101
end,
104102
})
105103

@@ -114,7 +112,7 @@ vim.api.nvim_create_autocmd('User', {
114112

115113
vim.api.nvim_create_autocmd('LspAttach', {
116114
desc = 'LSP configuration',
117-
group = vim.api.nvim_create_augroup('lsp-attach-configuration', { clear = true }),
115+
group = vim.api.nvim_create_augroup('lsp-attach-configuration', { clear = false }),
118116
callback = function(event)
119117
local client = vim.lsp.get_client_by_id(event.data.client_id)
120118
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_formatting) then

0 commit comments

Comments
 (0)