-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvim-lsp with mucomplete breaks the repeat command #180
Comments
I had the same issue in Dhall. Did you try adjusting the delay and reopen immediately options? |
Facing the same issue. Pinging @lifepillar for visibility. |
Can someone provide detailed instructions (plugins, configurations, etc.) to reproduce this? |
Here's the config. filetype indent plugin on
syntax on
call plug#begin('~/.local/share/nvim/plugged')
Plug 'lifepillar/vim-mucomplete'
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'neovim/nvim-lspconfig'
call plug#end()
set completeopt-=preview
set completeopt+=menuone,noinsert
set pumheight=4
let g:mucomplete#enable_auto_at_startup=1
let g:mucomplete#minimum_prefix_length=2
lua << EOF
vim.lsp.set_log_level("debug")
local lsp = require("lspconfig")
local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
end
lsp["fortls"].setup({
cmd = {
"fortls",
"--incremental_sync",
"--use_signature_help",
"--lowercase_intrinsics",
},
on_attach = on_attach,
root_dir = lsp.util.root_pattern(".git"),
filetypes = { "fortran" },
settings = { nthreads = 1 },
})
EOF
Here's a fortran file to reproduce the error module test
implicit none
integer, parameter :: N = 128
integer, parameter :: D = 2
real(8) :: length(D)
contains
subroutine tracking_init()
real(8) :: alpha, beta, delta
real(8) :: alpha_test, beta_test, delta_test
end subroutine tracking_init
end module tracking Steps to reproduce:
Here's an asciinema cast showing the issue (renamed to debug.txt) |
Commenting out the line : |
@lifepillar Any updates on this? |
I have tried the config above, but |
@lifepillar |
Yeah, that was it, apparently. Still, when I open a Fortran file, Output of
The cache contains only pairs of lines like this:
|
I think the fortran file needs to be in a git repo. I tested it for a sample fortran file, fortls does not attach to the file unless I put it in a git repo. |
Ok, I can reproduce it. Using your example, after typing This may be tough to debug. |
No, wait, that is not expected, because omni-completion comes first in the completion chain. Unfortunately, setting a delay does not seem to help. Having both A possible workaround is to define a filetype-specific completion chain which enables only the let b:mucomplete_chain=['omni'] in the Fortran buffer. |
It works properly with just the And yes tweaking the delay and reopen settings as suggested by @cideM does not help. |
I think I know what is going on: when the completion chain is The workaround in the documentation (set completion delay and reset If you want keyword completion in your completion chain, you should put it before omni-completion. I.e., any of the following should work:
|
I tested with
which also breaks the dot command, most likely a conflict b/w |
@mjlbach Can you please have a look at it? I can reproduce the error with Do you think we should open an issue in the neovim repository? |
I don't use mucomplete (or any autocompletion), so not sure what you are asking. Maybe related, neovim/neovim#12390. We asynchronously populate the omnifunc results after opening pmenu. The entire implementation is here: https://github.com/mjlbach/neovim/blob/b11e000cec48ce1ea851188b38945fd74ad006e5/runtime/lua/vim/lsp.lua#L1408-L1448 I'm not sure what the issue is (apart from incompatibility with a plugin), as the built-in omnifunc works fine. |
Thanks for the links. To be clear, I was not implying that there is an issue with nvim-lsp: it's just that MUcomplete is intrinsecally incompatible with certain ways of populating the popup menu, e.g., using complete_add(). Likely, the same limitation of MUcomplete applies to nvim-lsp. |
Oh totally, sorry, just wanted to clarify our omnifunc does work, it just might not work within the constraints of your plugin. There's this issue: neovim/neovim#12390 asking for a synchronous omnifunc, which I'm assuming would be compatible with mucomplete |
Hi, thanks for the plugin.
I'm using nvim-lsp and I don't know why, but mucomplete breaks the dot command. Nvim-lsp uses the omni function.
You can see here:
https://asciinema.org/a/FDcDscBWOcHUiffzm0mbSGCsP
The text was updated successfully, but these errors were encountered: