From f2d829b600ad758beca84c7739e01e5599ab0086 Mon Sep 17 00:00:00 2001 From: Seth Gower Date: Fri, 30 Aug 2024 08:27:44 -0400 Subject: [PATCH] fix(nvim): Adds coq_nvim for VHDL temporarily since nvim-cmp freezes 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: https://github.com/hrsh7th/nvim-cmp/issues/2028 https://github.com/VHDL-LS/rust_hdl/issues/340 --- config/nvim/lua/plugins.lua | 10 +++++++++- config/nvim/lua/plugins/completions.lua | 3 +++ config/nvim/lua/plugins/lsp.lua | 20 ++++++++------------ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 00742c3..4739c1b 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -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" } } }, { diff --git a/config/nvim/lua/plugins/completions.lua b/config/nvim/lua/plugins/completions.lua index 2455f3e..c325de4 100644 --- a/config/nvim/lua/plugins/completions.lua +++ b/config/nvim/lua/plugins/completions.lua @@ -114,6 +114,9 @@ M.config = function () { name = "luasnip" }, }) }) + cmp.setup.filetype('vhdl', { + enabled = false + }) require("cmp_git").setup() end diff --git a/config/nvim/lua/plugins/lsp.lua b/config/nvim/lua/plugins/lsp.lua index 522383a..f39e075 100644 --- a/config/nvim/lua/plugins/lsp.lua +++ b/config/nvim/lua/plugins/lsp.lua @@ -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,