-
Notifications
You must be signed in to change notification settings - Fork 368
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
redundant candidates from different source. #32
Comments
@ccshao nvim-cmp respects So you can use the following config for the problem. cmp.setup {
mapping = {
['<C-p>'] = cmp.mapping.prev_item(),
['<C-n>'] = cmp.mapping.next_item(),
['<C-d>'] = cmp.mapping.scroll(-4),
['<C-f>'] = cmp.mapping.scroll(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
})
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'path' },
{ name = 'buffer' },
},
documentation = false,
} |
This looks like there is no difference |
No. The |
It is a source-related customization. See https://github.com/hrsh7th/cmp-buffer
|
Big shock, it's time to adjust my configuration again |
Sorry for confusion. I thoughts it is intuitive way.... TT |
Thanks! May I bother you with another small issue? The reason I put Now the |
@ccshao It is not supported as suitable way but nvim-cmp provides fully customizable vim's completion item by the user.
|
Thanks for the suggestions, sorry I don't know much about vimscript/lua. The above In the example, I would like to get
|
|
I might get the logic, so the
However, now I get duplicated candidates from |
If you don't want to have dup items you can delete formatting section. The cmp will hide dup items by default. |
Strangely I still see the duplicated candidates, with a miminum setting:
To get ride of duplicates, I have to put |
I think |
Hm... Could you share your environment to testing? Language Server |
Note: nvim-lsp source set |
It's may be a bug. I will investigate it. |
I am bit of lost in the settings, so here is the summary, with nvim 0.5.0, all latest plugins, and R language server. setting 1. Works great, no redundant candidates from buffer and lsp.
setting 2. Duplicated items from buffer (indicated by "Text" in the popup)
|
Thank you for your information. I guess the R language server returns items that contain the same duplicated Text entries. I will provide debuggable configuration for it. Please wait. |
@ccshao Could you test with this config? It can be used to detect which source returned the item. |
Then can you try this?
|
Yes. It is understandable to me. Your expected behavior can be realized with the following config maybe.
|
I still get the duplicated candidates from both lsp and buffer with exactly the above settings ... |
Thsnk you and Sorry for annoying. I think the above config dhould work so I will investigate it. |
I just try with a python script with |
I've fixed the bug! f3a5491 Now, You can fully customizable vim' completion item (See |
Thank you very much for bing patience on this small issue! |
How should I config to remove the redundant candidates from popmenu, e.g.
library
from both buffer and lsp, I would like to only keep buffer candidates. Thanks!my settings.
The text was updated successfully, but these errors were encountered: