ms-jpq / coq_nvim

Fast as FUCK nvim completion. SQLite, concurrent scheduler, hundreds of hours of optimization.
GNU General Public License v3.0
3.54k stars 100 forks source link

Misconfigured `coq_settings` seems to fail silently #292

Closed mcchrish closed 3 years ago

mcchrish commented 3 years ago
vim.g.coq_settings = {
    display = {
        icons = {
            mode = "short",
            alias = {},
            mappings = {},
        },
    },
}

If you remove alias and mappings, it's working fine. COQnow or COQstats does not report anything.

mcchrish commented 3 years ago

Also, it's not just the icons is not working but the whole coq, i.e. no completion.

dnaaun commented 3 years ago

Hey @mcchrish , I believe the issue is that the lua expression {} (which is what display.icons.alias and display.icons.mappings are set to in the config you posted) is translated into a vimscript list, and not a dict.

And, coq is not "silently failing", if you type in :COQnow, it shows you the error message that the expression type is incorrect.

If you want coq to start automatically on vim startup, you have to set coq_settings.auto_start to either true or "shut-up" (the latter silences a friendly greeting).

Ie, if you modify your config like this:

vim.g.coq_settings = {
        auto_start = true,
    display = {
        icons = {
            mode = "short",
            alias = {},
            mappings = {},
        },
    },
}

coq will give you the error message.

mcchrish commented 3 years ago

I don't think it's related to nvim's translation from table to list/dict. Here's my actual config:

https://github.com/mcchrish/dotfiles/blob/72339afaa30db107d157e6702352180b44e635d6/vim/Library/Preferences/nvim/plugin/vendor/opt.lua#L30-L83

Since it's not an empty table, it should be unambiguously a dict.

And, coq is not "silently failing", if you type in :COQnow, it shows you the error message that the expression type is incorrect.

It does not for me. Running :COQnow does nothing and no error message is returned. Also all other COQ* commands does not work too.

mcchrish commented 3 years ago

It works fine if I remove the alias, or mappings.:

vim.g.coq_settings = {
    display = {
        icons = {
            mode = "short",
        },
    },
}
dnaaun commented 3 years ago

Ah, I checked out your config, and the alias setting is actually supposed to be aliases (sorry for not catching that earlier). When I tried to run :COQnow with your config, it correctly pointed out this mistake. And when I correct that mistake, :COQnow runs perfectly fine, and I coq starts to work again.

If :COQnow is not giving you error messages, could you run :messages after you run :COQnow? Maybe your nvim settings don't show multi line messages immediately (this is all pure speculation)?

mcchrish commented 3 years ago

Ah, I checked out your config, and the alias setting is actually supposed to be aliases (sorry for not catching that earlier).

That works 😄. Thanks!

It's still strange, right? Coq should be able to point out errors in config. Even the most minimal config does not work:

vim.g.coq_settings = { test = "wrong config" } -- Coq should say something about wrong config
vim.g.coq_settings = { } -- doesn't work as well

Nothing from :messages too.

dnaaun commented 3 years ago

This is very wierd indeed. When I type in :COQnow with the above settings, error messages show up for any invalid configuration. I'm at a loss as to how to debug this 😆

ms-jpq commented 3 years ago

https://github.com/ms-jpq/coq_nvim/pull/334

fixed