feat: add blink.cmp and disable custom completion pipeline
This commit is contained in:
@@ -6,16 +6,9 @@ local GROUP = vim.api.nvim_create_augroup("ow.lsp.completion", { clear = true })
|
||||
|
||||
local popup = Popup.new()
|
||||
|
||||
local M = {}
|
||||
|
||||
---@param capabilities lsp.ClientCapabilities
|
||||
function M.apply_capabilities(capabilities)
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
end
|
||||
|
||||
---@param client vim.lsp.Client
|
||||
---@param buf integer
|
||||
function M.on_attach(client, buf)
|
||||
local function on_attach(client, buf)
|
||||
if
|
||||
not client:supports_method(
|
||||
vim.lsp.protocol.Methods.textDocument_completion
|
||||
@@ -34,7 +27,29 @@ function M.on_attach(client, buf)
|
||||
})
|
||||
end
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
vim.lsp.config("*", {
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
completion = {
|
||||
completionItem = { snippetSupport = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = GROUP,
|
||||
callback = function(ev)
|
||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||
if client then
|
||||
on_attach(client, ev.buf)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("CompleteChanged", {
|
||||
group = GROUP,
|
||||
callback = function(ev)
|
||||
|
||||
+2
-6
@@ -4,7 +4,6 @@
|
||||
---@field context lsp.HandlerContext
|
||||
|
||||
local codelens = require("lsp.codelens")
|
||||
local completion = require("lsp.completion")
|
||||
local diagnostic = require("lsp.diagnostic")
|
||||
local log = require("log")
|
||||
|
||||
@@ -43,8 +42,6 @@ local function on_attach(client, buf)
|
||||
client.settings
|
||||
) or client.settings
|
||||
|
||||
completion.on_attach(client, buf)
|
||||
|
||||
vim.api.nvim_clear_autocmds({ group = GROUP, buffer = buf })
|
||||
vim.api.nvim_create_autocmd("LspProgress", {
|
||||
buffer = buf,
|
||||
@@ -91,8 +88,7 @@ function M.setup()
|
||||
"zls",
|
||||
})
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
completion.apply_capabilities(capabilities)
|
||||
local capabilities = require("blink.cmp").get_lsp_capabilities({}, true)
|
||||
vim.lsp.config("*", {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
@@ -107,7 +103,7 @@ function M.setup()
|
||||
end,
|
||||
})
|
||||
|
||||
completion.setup()
|
||||
-- require("lsp.completion").setup()
|
||||
codelens.setup()
|
||||
|
||||
vim.lsp.log.set_level(vim.log.levels.WARN)
|
||||
|
||||
Reference in New Issue
Block a user