-
-
Notifications
You must be signed in to change notification settings - Fork 226
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
Allow company-mode to wait for a backend with special value of prefix before proceeding to the next #992
Comments
Okay, but.
This is the normal case. Non-nil prefix means "I can complete here", and then an empty completion table means that there are in fact no completions, period. Especially for a backend like LSP, which uses smart external processes, and not just tea leaves and guessing. Is there a particular reason you need this? |
We have several questions on I feel it would be natural for backend that return no completion item should pass the control to next one. One possible problem is that if a backend is return no completion item due to interrupted by input, we should not pass the control to next one in that case though. |
In general, that's not my impression. If a high-quality backend returns no completions, doesn't that mean that indeed there are none? And completions offered by the fallback to |
Let put this another way, for example I have an backend that suggest high quality completion item, but does nothing in comment, and I want to have something else like |
Normally, the "high-quality" backend would then see if it's inside a comment in its See The corresponding c-a-p-f behavior will be returning |
This seems like another issue: #806 For example, in a function, I want to declare a variable and I'm typing its name. In this case, |
This is indeed similar to |
I'm not sure it's the best approach, to have a backend decide whether it's non-exclusive (which is the approach At least in this case, LSP should probably indeed be "exclusive", with an option (okay) for the user to override this. |
Open per emacs-lsp/lsp-mode#1611 (comment)
This is especially useful for
capf
since it has to return prefix before hand andcompany-capf
is based on that to determine if it should be used or not.However in the case of programmed completion, most
capf
will not know if it has any completion item when it return prefix bounds and just quickly return symbol bounds, thus preventcompany-mode
to go to next backends.Perhaps
:company-prefix
property can be re-used and pass special value so thatcompany-mode
will wait to see if there's any completion item from that backend before going to the next.The text was updated successfully, but these errors were encountered: