Skip to content
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

LSP rename errors, when using dressing.nvim vim.ui.input #68

Closed
3 tasks done
BenjaminKern opened this issue Apr 30, 2022 · 8 comments
Closed
3 tasks done

LSP rename errors, when using dressing.nvim vim.ui.input #68

BenjaminKern opened this issue Apr 30, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@BenjaminKern
Copy link

Contributing guidelines

Module(s)

mini.cursorword mini.indentscope

Description

In combation with vim.ui.input from dressing.nvim LSP renaming issues, see attached logs and gif
bug
bug.log

Neovim version

v0.8.0-dev+6-gae325e627

Steps to reproduce

Unfortunately, I am not sure if it is a issue with some mini module or with dressing.nvim (or related to vim/matchparen.vim). In order to reproduce, do a LSP rename more than once in an open buffer, with dressing.nvim, mini.indentscope and mini.cursorword enabled

Expected behavior

I should be able to do a LSP rename more than once, with dressing.nvim enabled.

Actual behavior

I can only do a LSP rename once with with dressing.nvim enabled.

@BenjaminKern BenjaminKern added the bug Something isn't working label Apr 30, 2022
@echasnovski
Copy link
Owner

I briefly had some issues with 'dressing.nvim' in my full setup, but it worked with minimal setup (only 'dressing.nvim' and some 'mini.nvim' module set up).

Could you, please, try to narrow it down to a minimal config that at least somehow indicates that the problem is indeed in some of 'mini.nvim' modules? Something like "Before adding the module it works, but not after"?

@BenjaminKern
Copy link
Author

Sure, I will try to narrow it down. In addition, thanks for this awesome plugin collection!

@echasnovski
Copy link
Owner

echasnovski commented Apr 30, 2022

Thanks.

I think I'll have some time tomorrow to try and find whether it is a 'mini.nvim' issue.

By the way, congratulations on your first Github issue! This helps a lot!

@BenjaminKern
Copy link
Author

So I found the culprit, it is related to mini.completion, reproducable with the following config

vim.call('plug#begin', plugged_path)
Plug('echasnovski/mini.nvim')
Plug('neovim/nvim-lspconfig')
Plug('stevearc/dressing.nvim')
vim.call('plug#end')

require('mini.completion').setup()

local on_attach = function(client, bufnr)
end

require('lspconfig').clangd.setup({
  on_attach = on_attach,
})

now move to a symbol which you want rename and call

:lua vim.lsp.buf.rename()

twice to rename the symbol. It will fail on the second try. If you remove the line

require('mini.completion').setup()

from the config everything works as intended.

@BenjaminKern
Copy link
Author

Thanks.

I think I'll have some time tomorrow to try and find whether it is a 'mini.nvim' issue.

By the way, congratulations on your first Github issue! This helps a lot!

Yay loooong time lurker 😄

@echasnovski
Copy link
Owner

So I found the culprit, it is related to mini.completion, reproducable with the following config

Great, thanks! That helped a lot.

I seems like autocompletion from 'mini.completion' doesn't play nice with 'dressing.nvim'. I think it might be due to somewhat complex handling of completion in 'dressing.nvim', but will investigate further.

If you can live without completion in the input, try adding this line to your config:

vim.cmd('au FileType DressingInput lua vim.b.minicompletion_disable = true')

It disables completion altogether in these popups. Meanwhile, I'll try to find a possibly better solution.

@BenjaminKern
Copy link
Author

Nice, I am completely fine with this workaround.

@echasnovski
Copy link
Owner

I looked through 'dressing.nvim' code and it seems that disabling an external completion is the preferred solution at the moment. Opened an issue there to clarify.
Thanks again for tracking this down!

echasnovski added a commit that referenced this issue May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants