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

keyword_length option for other sources #17

Open
fastbodin opened this issue Nov 26, 2021 · 4 comments
Open

keyword_length option for other sources #17

fastbodin opened this issue Nov 26, 2021 · 4 comments

Comments

@fastbodin
Copy link

Hi there,

Again, thank you for all your work on this plugin. A while ago you kindly fixed an issue I raised here

hrsh7th/nvim-cmp#444

I was wondering how difficult it would be to add this sort of feature to other sources? Like nvim-lsp or latex-symbols for example?

Thanks again!

@Shougo
Copy link

Shougo commented Nov 26, 2021

Your description is hard to understand for me.
Can you describe the feature more clearly?
It is keyword length sort?

Note: It seems keyword length option in buffer source for other sources.

@fastbodin
Copy link
Author

Apologies, I thought referencing the original issue would make it clear. I hope the following is makes it clear.

In the (resolved) issue referenced above, I was asking if it was possible to add a configuration to sources that would exclude all suggestions of words that were less than X characters in length (the feature being able to change the value of X). After this request, this configuration was added to

https://github.com/hrsh7th/cmp-buffer

The new option was keyword_length. So, if add the following to my cmp_config

sources = cmp.config.sources({
{ name = 'buffer', option = {keyword_length = 6} }
}

then all words of length < 6 are not included as suggestions in the drop down menu.

This has been a fantastic feature for me. This has been implemented as a configuration option in buffer sources but I was wondering if it is possible to add it as a configuration option in other sources like

https://github.com/hrsh7th/cmp-nvim-lsp

or

https://github.com/kdheepak/cmp-latex-symbols

for instance.

I should also note, I (qualitatively) have found this feature has decreased the lag I sometimes experience while typing when I am working in a really large file. This is partially why I was interested in having this feature in other sources.

@Shougo
Copy link

Shougo commented Nov 26, 2021

OK. The description is clear.

Note: The issue title is not clear for me.
It should be renamed.

My suggestion is:
keyword_length option for other sources

@fastbodin fastbodin changed the title Repeat of keyword length keyword_length option for other sources Nov 26, 2021
@fastbodin
Copy link
Author

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants