Closed ristillu closed 1 year ago
In answer to my own question, I figured out if I added auto_start
to my init.lua
it behaved as expected, therefore it was some weird ordering thing that lazy
triggers.
To clean up my code, I removed the auto_start
from my config for coq
--[[ vim.g.coq_settings = {
auto_start = true
} ]]
local lsp = require("lspconfig")
local coq = require("coq")
-- set up servers below with ensure_capabilities etc
and changed the lazy
entry to:
{
"ms-jpq/coq_nvim",
branch = "coq",
init = function() vim.g.coq_settings = { auto_start = true } end,
dependencies = {
{ "ms-jpq/coq.artifacts", branch = "artifacts" },
{ "neovim/nvim-lspconfig" },
},
config = function() require("config.ms_jpq_coq") end,
lazy = false,
},
Note the added init
line.
The init
happens before the plugin is loaded, ref here. I guess the entry for the spec under the config
part is where the behavior I noticed is implied:
config
is executed when the plugin loads. The default implementation will automatically runrequire("plugin").setup(opts)
."plugin"
will default toname
if specified, otherwiselazy.nvim
will do its best to guess the correct plugin name. See alsoopts
. To use the default implementation withoutopts
setconfig
totrue
.
@ristillu im getting this error , but coq runs fine?
fixed tho
@NormTurtle um... so... How did you fix this?
I have recently migrated from
wbthomason/packer.nvim
tofolke/lazy.nvim
. It has broken mycoq
. Theuse
entry has changed and now looks like:The only changes from
packer
are the syntax and thelazy = false,
line to (I thought) ensurecoq
is loaded.coq
works if I run:COQnow
. But in myconfig/ms_jpq_coq.lua
file that I'm loading I havewhich is what I had with
packer
, except it is not auto-loading withlazy
.I've run with
COQ_DEBUG=1 nvim $file -V10vimlog
and there is nothing in the:LspLog
orvimlog
that seems obvious. Just nothing happens until I hit:COQnow
. In thevimlog
I can see thatlazy
processes thecoq
entry but it just doesn't load until I command it to. I also addedprint("loading coq")
to theconfig/ms_jpq_coq.lua
file to confirm that file is loaded, and it is.Any tips?