coq_nvim icon indicating copy to clipboard operation
coq_nvim copied to clipboard

Tab doesn't trigger completion & no snippet is shown

Open MVP-Harry opened this issue 2 years ago • 9 comments

Hi there,

Recently I switched from coc to lsp, and decided to go with coq as the completion plugin. So far it's been really impressive!

However, I'm experiencing two issues. I've looked at the docs, but found no luck. Sorry if the question is elementary!

The first issue is that tab doesn't trigger completion. I wonder if there's a keymap conflict or something like that. The suggestions are shown, but I'm unable to select them using tab: image

The second issue is that the snippets won't show up. I have installed the three plugins, and added coq.lsp_ensure_capabilities() to my config. The relevant configs are below:

	Plug 'ms-jpq/coq_nvim', {'branch': 'coq'}
	Plug 'ms-jpq/coq.artifacts', {'branch': 'artifacts'}
	Plug 'ms-jpq/coq.thirdparty', {'branch': '3p'}
lua << EOF
local lspconfig = require'lspconfig'
local servers = { 'pyright', 'clangd' }
local coq = require'coq'

for _, lsp in pairs(servers) do
	lspconfig[lsp].setup {
		on_attach = on_attach,
		coq.lsp_ensure_capabilities(),
		flags = {
			debounce_text_changes = 150
		}
	}
end
EOF

Thank you!

MVP-Harry avatar Apr 22 '22 02:04 MVP-Harry

Hi ! You can try changing your config like how I have mine where coq.lsp_ensure_capabilities() covers everything in the setup function.

for _, lsp in pairs(servers) do
	lspconfig[lsp].setup(coq.lsp_ensure_capabilities({
		on_attach = on_attach,
		flags = {
			debounce_text_changes = 150
		}
	}))
end

axelcalixte avatar Apr 22 '22 07:04 axelcalixte

@axelcalixte Hi! Unfortunately it still doesn't work when I change it. Whenever I press "tab", it doesn't trigger any sort of completion. Do you have any other ideas? Thanks!

MVP-Harry avatar Apr 22 '22 13:04 MVP-Harry

do you have any autopair plugin installed?

kaiuri avatar Apr 25 '22 12:04 kaiuri

Tab doesn*t work for me either. Or, worse, it sometimes works and sometimes doesn`t -- I haven't found any relations yet.

Peek 2022-04-26 23-01

(Note the »., which is my tab symbol)


I don't think I have any autopair plugin installed, but I am also pretty nooby, so here is my list of plugins (from :PackerStatus)

• alpha-nvim • calendar-vim • coq.artifacts • coq.thirdparty • coq_nvim • everforest • feline.nvim • fzf • fzf.vim • gitsigns.nvim • goyo.vim • limelight.vim • nvim-cursorline • nvim-lspconfig • nvim-lspfuzzy • nvim-startup.lua • nvim-treesitter • nvim-web-devicons • packer.nvim • playground • plenary.nvim • popup.nvim • sqlite.lua • telekasten.nvim • telescope-frecency.nvim • telescope-fzf-native.nvim • telescope-media-files.nvim • telescope.nvim • vim-dadbod • vimwiki • vista.vim • which-key.nvim

j-steinbach avatar Apr 26 '22 21:04 j-steinbach

Update: I think for me this is related to vimwiki. There seems to be a binding for <Tab> predefined. I have both Telekasten and VimWiki enabled, and both work on Markdown .md files.. That means depending on which was active in the buffer <Tab> was working or not :/

j-steinbach avatar Apr 27 '22 14:04 j-steinbach

I wonder if it's possible for coq_nvim to enable the completion menu only with ctrl+n and ctrl+p. I'm sure not everyone needs to tab complete and it would respect more the "natural" way of doing completions in vim/neovim/. Then, coq_nvim which is a general plugin wouldn't conflict with vimwiki.

ino <silent><expr> <Tab>   pumvisible() ? "\<C-n>" : "\<Tab>"

This setting is the default setting for coq_nvim if you don't specify your personal keybinds. See docs/KEYBIND.md

axelcalixte avatar Apr 27 '22 14:04 axelcalixte

Update: I think for me this is related to vimwiki. There seems to be a binding for <Tab> predefined. I have both Telekasten and VimWiki enabled, and both work on Markdown .md files.. That means depending on which was active in the buffer <Tab> was working or not :/

happens to me and I don't have that plugin

yavko avatar May 13 '22 05:05 yavko

But (based on my experience) it should be a similar issue: Some other plugin likely uses the same mapping for <Tab>.

  • Check which plugins map to the keybinding. For example with :Telescope keymaps -> search for <Tab>.
  • Does it always happen in the same filetype? Does it sometimes happen in the same filetype? (I.e. for me in .md files)
  • Try disabling all the plugins that affect that file. Try to disabling all the plugins except Coq.
  • Try mapping the Coq keybind to something besides <Tab>, to check if it works then.

I hope that helps.

E: And for the collective wisdom you could also maybe post a list of all your plugins.

j-steinbach avatar May 13 '22 09:05 j-steinbach

But (based on my experience) it should be a similar issue: Some other plugin likely uses the same mapping for <Tab>.

* Check which plugins map to the keybinding. For example with `:Telescope keymaps` -> search for `<Tab>`.

* Does it always happen in the same filetype? Does it sometimes happen in the same filetype? (I.e. for me in `.md` files)

* Try disabling all the plugins that affect that file. Try to disabling all the plugins except Coq.

* Try mapping the Coq keybind to something besides `<Tab>`, to check if it works then.

I hope that helps.

E: And for the collective wisdom you could also maybe post a list of all your plugins.

for me it just happens everywhere, also image

yavko avatar May 13 '22 15:05 yavko