feat(nvim): add coq-nvim
This commit is contained in:
parent
526783f07a
commit
e2aff57d72
7 changed files with 62 additions and 113 deletions
|
|
@ -5,9 +5,6 @@ vim.diagnostic.config({
|
|||
virtual_text = false,
|
||||
})
|
||||
|
||||
-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
vim.o.foldcolumn = "1" -- '0' is not bad
|
||||
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
|
||||
vim.o.foldlevelstart = 99
|
||||
|
|
@ -47,6 +44,7 @@ require("which-key").register({
|
|||
M = { require("ufo").closeAllFolds, "Close all folds" },
|
||||
},
|
||||
})
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
-- Tell the server the capability of foldingRange,
|
||||
-- Neovim hasn't added foldingRange to default capabilities, users must add it manually
|
||||
capabilities.textDocument.foldingRange = {
|
||||
|
|
@ -107,9 +105,6 @@ end
|
|||
local lspconfig_default_options = {
|
||||
on_attach = on_attach_def,
|
||||
capabilities = capabilities,
|
||||
flags = {
|
||||
debounce_text_changes = 100,
|
||||
},
|
||||
}
|
||||
|
||||
---function to add default options to lspconfig
|
||||
|
|
@ -117,8 +112,9 @@ local lspconfig_default_options = {
|
|||
---@param options table
|
||||
---@return nil
|
||||
local function lspconfig_setup(lsp, options)
|
||||
local final_options = vim.tbl_deep_extend("force", lspconfig_default_options, options)
|
||||
lspconfig[lsp].setup(final_options)
|
||||
local coq_options = require("coq").lsp_ensure_capabilities({})
|
||||
local merged_options = vim.tbl_deep_extend("force", coq_options, lspconfig_default_options, options)
|
||||
lspconfig[lsp].setup(merged_options)
|
||||
end
|
||||
|
||||
local servers = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue