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
unexpected completion item list #553
Comments
|
What did you expect? |
|
I expect all items in completion list be A+B. But it is not. Too many items in B(I guess). |
What does that mean? Do you get no completions with |
|
Yes. I set company-minimum-prefix-length to 3. So after '.' there is no completions, because it is not a symbol-char. |
|
OK, so your problem is that with This is working as expected. See the description of |
|
I think there may be something wrong. My problem: A and B is right. C is not. C != A + B. The problem seems to be that: company-minimum-prefix-length is ignored In C case. |
|
Go to step B and type |
|
In B, there should be no completions because company-minimum-prefix-length is 3. |
|
Like its docstring says, To put it differently, it affects whether the completion tooltip is displayed. Not how many completions a backend returns. |
|
I understand now. At that point, company first checks company-clang. It passes the prefix check. So company completion starts. Then it activates all backends in the same group and gathers their candidates, without checking company-minimum-prefix-length. But I would it to check company-minimum-prefix-length or I will need to modify company-abbrev-code and more backends like that. |
|
Maybe you could manage that with only adding an advice to e.g. I could consider this as a feature request if more people wanted it, but so far you're the first, IIRC. |
|
OK. I will try. Thank you. |
…eparately This should help with #1398, #641, #553, #485, #1147, #840 With some of the above already closed, and some describing more serious scenarios than others. Anyway, this is a halfway step to dropping framework-level caching (or moving it to backends). For now this seems like an adequate solution, given that the most "heavy" backend these days is `company-capf`, which disables caching already. Though `company-dabbrev-code` is a close next.
…eparately (#1405) * company--multi-backend-adapter: Consider min prefix in 'candidates' separately This should help with #1398, #641, #553, #485, #1147, #840 With some of the above already closed, and some describing more serious scenarios than others. Anyway, this is a halfway step to dropping framework-level caching (or moving it to backends). For now this seems like an adequate solution (resetting the cache sometimes when the new chars are typed), given that the most "heavy" backend these days is `company-capf`, which disables caching already. Though `company-dabbrev-code` is a close next. Uses new semi-private backend action called 'set-min-prefix', to keep the merging function's backward compatibility, for the sake of external callers.
|
Check out the latest master, the behavior should be improved. |
mode: c-mode
backends: (setq company-backends '((company-clang company-dabbrev-code)))
other setting: (setq company-minimum-prefix-length 3)
version: 0.9.0 and above
struct st_test
{
int long_name_var1;
int long_name_var2;
};
void test()
{
struct st_test st;
The text was updated successfully, but these errors were encountered: