Skip to content

Commit

Permalink
fix(nvim): Adds coq_nvim for VHDL temporarily since nvim-cmp freezes
Browse files Browse the repository at this point in the history
This is only temporary. I am using nvim-cmp for _everything_ besides
completions in VHDL buffers, since nvim-cmp freezes the whole editor
when unisim is loaded and snippets are enabled. However, who knows, I
may switch to coq_nvim completely if I can config it as nicely as
nvim-cmp is

See:
hrsh7th/nvim-cmp#2028
VHDL-LS/rust_hdl#340
  • Loading branch information
SethGower committed Aug 30, 2024
1 parent 1c79cff commit f2d829b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
10 changes: 9 additions & 1 deletion config/nvim/lua/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,20 @@ return require('lazy').setup({
{ -- Neovim Language Server
"neovim/nvim-lspconfig",
event = Events.OpenFile,
init = function ()
vim.g.coq_settings = {
auto_start = false,
}
end,
config = function ()
require("plugins.lsp").setup()
end,
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim"
"williamboman/mason-lspconfig.nvim",
{ "ms-jpq/coq_nvim", branch = "coq" },
{ "ms-jpq/coq.artifacts", branch = "artifacts" },
{ 'ms-jpq/coq.thirdparty', branch = "3p" }
}
},
{
Expand Down
3 changes: 3 additions & 0 deletions config/nvim/lua/plugins/completions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ M.config = function ()
{ name = "luasnip" },
})
})
cmp.setup.filetype('vhdl', {
enabled = false
})

require("cmp_git").setup()
end
Expand Down
20 changes: 8 additions & 12 deletions config/nvim/lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,14 @@ M.setup = function ()
-- For some reason the vhdl_ls LSP server doesn't handle snippets in large (hundreds/thousands of files/units).
-- Causes a 1-5s freeze when completing something, which is unacceptable when I am trying to type. For now, just
-- gonna disable snippetSupport
lspconfig["vhdl_ls"].setup {
on_attach = on_attach,
capabilities = vim.tbl_extend("force", capabilities, {
textDocument = {
completion = {
completionItem = {
snippetSupport = false
}
}
}
}),
}
local coq = require("coq")
lspconfig["vhdl_ls"].setup(coq.lsp_ensure_capabilities({
on_attach = function (...)
on_attach(...)
vim.cmd([[COQnow]])
end,
capabilities = capabilities,
}))

lspconfig["yamlls"].setup {
on_attach = on_attach,
Expand Down

0 comments on commit f2d829b

Please sign in to comment.