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

counsel-company doesn't correctly complete in some instances #969

Closed
gnuvince opened this issue Apr 23, 2017 · 6 comments
Closed

counsel-company doesn't correctly complete in some instances #969

gnuvince opened this issue Apr 23, 2017 · 6 comments

Comments

@gnuvince
Copy link

@gnuvince gnuvince commented Apr 23, 2017

Consider the following Rust program:

fn main() {
    let s = String::new();
    s.ext|
}

When at the cursor (indicated with the |), invoking M-x counsel-company will insert the text extend after ext i.e., the third line becomes s.extextend.

The same behaviour happens in the following C program, but with a slightly different result: the prefix pu is replaced with pput.

#include <stdio.h>
int main(void) {
    pu|
}
  • Emacs 25.2
  • Ivy 9.1 (mepla-stable channel) and 20170416 (melpa channel)
  • Rust-mode, racer-mode, and cargo-mode from melpa (20170411, 20170218, 20170203)
  • Built-in cc-mode
  • company from melpa (20170328)
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Apr 23, 2017

What's your source of completions for C?

@gnuvince
Copy link
Author

@gnuvince gnuvince commented Apr 23, 2017

The variable company-backend is set to nil. Is that what you're looking for?

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Apr 24, 2017

Not really. The completions have to come from somewhere. Which code produces the list, e.g. ("push", "pull", ...)?

@Wilfred
Copy link
Contributor

@Wilfred Wilfred commented Apr 26, 2017

I think you want to look at company-backends rather than company-backend. This is often a buffer-local variable, so look at its value in the relevant buffers.

@gnuvince
Copy link
Author

@gnuvince gnuvince commented Apr 26, 2017

It seems that removing the call to company-complete-common inside counsel-company eliminates the problem in the two example I provided. I don't yet know if it creates other problems elsewhere.

@abo-abo abo-abo closed this in d6ed4af Apr 26, 2017
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Apr 26, 2017

@gnuvince Thanks, please test.

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

Successfully merging a pull request may close this issue.

None yet
3 participants