chore: fix formatting
This commit is contained in:
+3
-20
@@ -174,26 +174,6 @@ function M:on_attach(client, bufnr)
|
|||||||
vim.cmd.highlight({ "link LspReferenceRead Visual", bang = true })
|
vim.cmd.highlight({ "link LspReferenceRead Visual", bang = true })
|
||||||
vim.cmd.highlight({ "link LspReferenceText Visual", bang = true })
|
vim.cmd.highlight({ "link LspReferenceText Visual", bang = true })
|
||||||
vim.cmd.highlight({ "link LspReferenceWrite Visual", bang = true })
|
vim.cmd.highlight({ "link LspReferenceWrite Visual", bang = true })
|
||||||
-- vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI", }, {
|
|
||||||
-- buffer = bufnr,
|
|
||||||
-- callback = vim.lsp.buf.document_highlight,
|
|
||||||
-- })
|
|
||||||
-- vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
|
||||||
-- buffer = bufnr,
|
|
||||||
-- callback = vim.lsp.buf.clear_references,
|
|
||||||
-- })
|
|
||||||
|
|
||||||
-- Auto show signature on insert in function parameters
|
|
||||||
-- if client.server_capabilities.signatureHelpProvider then
|
|
||||||
-- local chars = client.server_capabilities.signatureHelpProvider
|
|
||||||
-- .triggerCharacters
|
|
||||||
-- if chars and #chars > 0 then
|
|
||||||
-- vim.api.nvim_create_autocmd("CursorHoldI", {
|
|
||||||
-- buffer = bufnr,
|
|
||||||
-- callback = vim.lsp.buf.signature_help,
|
|
||||||
-- })
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
|
|
||||||
vim.opt.updatetime = 300
|
vim.opt.updatetime = 300
|
||||||
require("lsp-inlayhints").on_attach(client, bufnr, false)
|
require("lsp-inlayhints").on_attach(client, bufnr, false)
|
||||||
@@ -208,13 +188,16 @@ end
|
|||||||
--- Configure the LSP client
|
--- Configure the LSP client
|
||||||
function M:configure_client()
|
function M:configure_client()
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
if self.config.root_patterns then
|
if self.config.root_patterns then
|
||||||
self.config.lspconfig.root_dir =
|
self.config.lspconfig.root_dir =
|
||||||
lspconfig.util.root_pattern(unpack(self.config.root_patterns))
|
lspconfig.util.root_pattern(unpack(self.config.root_patterns))
|
||||||
else
|
else
|
||||||
self.config.lspconfig.root_dir = lspconfig.util.find_git_ancestor
|
self.config.lspconfig.root_dir = lspconfig.util.find_git_ancestor
|
||||||
end
|
end
|
||||||
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
|
||||||
local cmp_nvim_lsp = utils.try_require("cmp_nvim_lsp")
|
local cmp_nvim_lsp = utils.try_require("cmp_nvim_lsp")
|
||||||
if cmp_nvim_lsp then
|
if cmp_nvim_lsp then
|
||||||
capabilities = vim.tbl_deep_extend("force", capabilities,
|
capabilities = vim.tbl_deep_extend("force", capabilities,
|
||||||
|
|||||||
@@ -84,20 +84,6 @@ local function setup()
|
|||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
["<C-b>"] = function(fallback)
|
|
||||||
if cmp.visible_docs() then
|
|
||||||
cmp.scroll_docs(-4)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
["<C-f>"] = function(fallback)
|
|
||||||
if cmp.visible_docs() then
|
|
||||||
cmp.scroll_docs(4)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
|
|||||||
Reference in New Issue
Block a user