-
Notifications
You must be signed in to change notification settings - Fork 46
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
Return end position of candidate in match function #92
Conversation
The function should return the position of the end of the candidate that matches prefix. This fixes font-locking in company popup.
@abingham What about this? |
Return end position of candidate in match function
Sorry, I thought I had posted a comment to this earlier and was waiting for a response. It looks like I forgot! My basic question was what the observable effect of this was. I remember that when I wrote the code originally, I couldn't really tell what the return value of this function did. I ended up interpreting the I've merged your change, but I'm still curious: what observable effect can I see that shows what this value does? |
OK, thanks! |
Currently Since the backend doesn't seem to return this info to you, and you do use non-prefix matching, you should probably avoid responding to |
@dgutov Thanks for the explanation. If what you're saying is true, you should consider updating the @ptrv Can you verify that not responding to |
@abingham Not responding to |
OK, then I guess we should just remove that. I'll do that in a bit. |
See #92 for more details on why we made this change.
Wait, I thought you meant when |
With using |
Ah, sorry for the misunderstanding. Just so I'm clear: everything worked fine before I committed c234050, right? If so, I'll undo that change. |
Yes, it was fine |
This is wrong.
|
In the case of |
Ah, so the name of the argument should be different (not
I wonder how that's possible. For instance, if I comment out the Guess I'll have to install ycmd to check. |
Yes, we should definitely rename the argument |
@abingham What do you think about the two versions of highlighting? |
Between the two options you just posted, the second one using To be honest, the highlighting is almost a non-issue for me personally. I don't want it to behave nonsensically, and I'd probably be happy not highlight anything at all. I just want the completion candidates. Knowing how my input matched the candidates doesn't help me, though I'm sensitive to the fact that it might help some users. I guess a sort of ultimate solution would:
AKAIK we can't accomplish (1) for a few reasons:
If the argument passed to the So...hmmm...I'm mostly just thinking out loud now. Let me know if I've got anything wrong! The bottom line is that I'm satisfied with any reasonable solution; the first option listed above doesn't meet that requirement. If it helps, I'm happy with the current solution. |
That would be bad. Better not highlight at all in non-prefix case, I think.
I can add that capability, no problem. So far, though, simply highlighting the part of the string up until the end of the match worked well enough.
Several ways: use
Like mentioned, I find it surprising that omitting the |
...among non-prefix ones. Obsoletes abingham/emacs-ycmd#92. `company-complete-common' was likewise too eager; this fixes it.
Should be fixed now, it was my bug, and it also affected the behavior of When the next Company version is released, you should be able to go back to ignoring |
Great, thanks for your work!
|
I can confirm, that with ignoring Commit c234050 can be brought back |
Also done, I think. But if the description of |
The description of match and its relationship to non-prefix matching is On Mon Nov 24 2014 at 4:28:23 AM Dmitry Gutov notifications@github.com
|
The function should return the position of the end of the candidate that
matches prefix. This fixes font-locking in company popup.