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

Completion inside a comment performance issue #413

Open
ville-h opened this issue Oct 11, 2015 · 2 comments
Open

Completion inside a comment performance issue #413

ville-h opened this issue Oct 11, 2015 · 2 comments
Labels

Comments

@ville-h
Copy link

ville-h commented Oct 11, 2015

Completion inside a comment performance varies quite significantly (from 0.01s to ~0.3s)[0] seemingly depending on the context of the comment. Here is test for scenario that I noticed while using emacs+racer:

fn main() {
    // writing in this comment is fine
}


struct A {
}


impl A {
    fn f() {
        // writing in this comment is broken
        let x = 0;
    }


    fn g() {
        // writing in this comment is fine
    }
}

Completion in "// writing in this comment is broken" takes significantly longer than in the other two comments. Removing "let x = 0;" makes it comparably fast.

[0] racer-rust/emacs-racer#6

@phildawes
Copy link
Collaborator

This can probably be fixed by either:

  • the editor realising it's in a comment, and not invoking racer
  • racer quickly returning if the coordinates are in a comment

Doing the latter might be a lot easier than changing each plugin. Does anybody else fancy having a go at this?

@phildawes phildawes added the bug label Oct 19, 2015
@ville-h
Copy link
Author

ville-h commented Oct 21, 2015

It seems that opening the comment with /* doesn't trigger the behaviour. The comment doesn't even have to be terminated with */.

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

No branches or pull requests

2 participants