ms-jpq / coq_nvim

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

Auto-refresh completion results #596

Open epixinvites opened 1 year ago

epixinvites commented 1 year ago

I don't know if this is intended or not, but there are cases where the completion that I want does not show up, but only shows up after I manually refresh the completions. Is it possible to configure it so that for every letter I type in the completion results automatically refresh?

This is my configuration:

vim.g.coq_settings = {
    ["clients.snippets.warn"] = {"outdated"},
    ["display.ghost_text.enabled"] = false,
    ["clients.tabnine.enabled"] = false,
    ["keymap.recommended"] = false,
    ["clients.buffers.same_filetype"] = true,
}

From the video below you can see most of the LSP results only appear after I hit C-Space (To manually refresh the autocompletion results)

https://github.com/ms-jpq/coq_nvim/assets/54717060/99dd36b8-d04b-4046-b6c8-23dd997ec1e3

This also illustrates the problem (You can see that the correct results only appear after I hit C-Space):

https://github.com/ms-jpq/coq_nvim/assets/54717060/21c63522-819e-4636-baec-b53658d1ce55

Shougo commented 1 year ago

coq.nvim has auto timeout.

https://github.com/ms-jpq/coq_nvim/blob/becbd35ff334cc7254c7dc990a7b2a83458b9905/docs/MISC.md?plain=1#L27

epixinvites commented 1 year ago

coq.nvim has auto timeout.

https://github.com/ms-jpq/coq_nvim/blob/becbd35ff334cc7254c7dc990a7b2a83458b9905/docs/MISC.md?plain=1#L27

So do I have to set the timeout higher? or lower?

Shougo commented 1 year ago

It should be higher.

epixinvites commented 1 year ago

It should be higher.

I've set it the value to 0.2, I start seeing some more relevant results, but it's still omitting quite a lot of results. Is 0.2 too low? What should I set it to?

Another thing, after manually overriding the limits.completion_auto_timeout, now C-Space does not work anymore. It gives me Option 'completeFunc' is not setwhen I press C-Space instead.

Shougo commented 1 year ago

https://github.com/ms-jpq/coq_nvim/blob/becbd35ff334cc7254c7dc990a7b2a83458b9905/config/defaults.yml#L195

manual_timeout is 0.66. So 0.2 is low.

Another thing, after manually overriding the limits.completion_auto_timeout, now C-Space does not work anymore. It gives me Option 'completeFunc' is not setwhen I press C-Space instead.

I don't know why.

epixinvites commented 1 year ago

https://github.com/ms-jpq/coq_nvim/blob/becbd35ff334cc7254c7dc990a7b2a83458b9905/config/defaults.yml#L195

manual_timeout is 0.66. So 0.2 is low.

Another thing, after manually overriding the limits.completion_auto_timeout, now C-Space does not work anymore. It gives me Option 'completeFunc' is not setwhen I press C-Space instead.

I don't know why.

Wait, but the value you overrode was the manual_timeout,

coq.nvim has auto timeout.

https://github.com/ms-jpq/coq_nvim/blob/becbd35ff334cc7254c7dc990a7b2a83458b9905/docs/MISC.md?plain=1#L27

but you referenced the auto_timeout here?

Shougo commented 1 year ago

Yes. It is referenced by FAQ.

epixinvites commented 1 year ago

This is my new configuration, now not only are some results still omitted, C-Space doesn't work anymore due to Option 'completeFunc' is not set.

vim.g.coq_settings = {
    ["clients.snippets.warn"] = {"outdated"},
    ["display.ghost_text.enabled"] = false,
    ["clients.tabnine.enabled"] = false,
    ["clients.buffers.same_filetype"] = true,
    ["limits.completion_auto_timeout"] = 0.66,
    ["keymap.recommended"] = false,
}

Can't I just trigger C-Space every time I hit a new letter?

ic-768 commented 3 months ago

I have this issue as well. Auto-suggestions are extremely lacking, even after setting all the timeouts to a very high number.


  {
    "neovim/nvim-lspconfig",
    lazy = false,
    dependencies = {
      { "ms-jpq/coq_nvim", branch = "coq" },
      { "ms-jpq/coq.artifacts", branch = "artifacts" },
      { 'ms-jpq/coq.thirdparty', branch = "3p" }
    },
    init = function()
      vim.g.coq_settings = {
        auto_start = true,
        ['clients.lsp.resolve_timeout'] = 2,
        ["limits.completion_auto_timeout"] = 2,
        ["limits.completion_manual_timeout"] = 2,
        ["completion.always"] = true,
      }
    end,
    config = function()
      -- Your LSP settings here
    end,
  }

Manually triggering works perfectly though.