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

Comments

Projects
None yet
3 participants
@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

This comment has been minimized.

Owner

abo-abo commented Apr 23, 2017

What's your source of completions for C?

@gnuvince

This comment has been minimized.

gnuvince commented Apr 23, 2017

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

@abo-abo

This comment has been minimized.

Owner

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

This comment has been minimized.

Contributor

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

This comment has been minimized.

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

This comment has been minimized.

Owner

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