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

After pressing a key triggering the reparse takes very long #144

Closed
r4nt opened this issue Jan 29, 2015 · 12 comments
Closed

After pressing a key triggering the reparse takes very long #144

r4nt opened this issue Jan 29, 2015 · 12 comments

Comments

@r4nt
Copy link

r4nt commented Jan 29, 2015

When I enter text, it takes multiple seconds for the YCM command to be issued. The following logs are generated by:
export LIBCLANG_TIMING=1
emacs -nw .../snip.cc
Looking at ycmd-server

"Received completion request" comes pretty much instantly when hitting a key, and then it takes 2 seconds until the FileReadyToParse comes in.

2015-01-29 12:54:17,514 - INFO - Received completion request
2015-01-29 12:54:17,515 - DEBUG - Using filetype completion: False
2015-01-29 12:54:19,318 - INFO - Received event notification
2015-01-29 12:54:19,318 - DEBUG - Event name: FileReadyToParse
2015-01-29 12:54:19,319 - INFO - Adding buffer identifiers for file: snip.cc
Reparsing snip.cc: 0.1558 (100.0%) 0.0241 (100.0%) 0.1799 (100.0%) 0.2296 (100.0%)

@Valloric just fyi

@abingham
Copy link
Owner

abingham commented Feb 1, 2015

What are your values for ycmd-parse-conditions and ycmd-idle-change-delay?

@r4nt
Copy link
Author

r4nt commented Feb 2, 2015

Ok, that was a headdesk moment. I had my ycmd-idle-change-delay set to 2 seconds (because of interference of parsing with completion).

The problem is that when I reduce that, I get very very strange behavior from emacs:
(setq company-idle-delay 0)
(setq ycmd-idle-change-delay 0.2)
(add-to-list 'ycmd-parse-conditions 'idle-change)

With this configuration, both completion and re-parsing works fine, but I get super strange artefacts in emacs while doing code completion:
When I type:
someFun
this triggers completion, and then the parsing seems to finish and pulls the line below up, it looks like this:

Element element;

unsigned offset = ...

I type "ele", which triggers completion of "element", and then emacs looks like this:
Element element;
ele unsigned offset = ...

The moment I hit a cursor key, it's back to:
Element element;
ele
unsigned offset = ...

@r4nt
Copy link
Author

r4nt commented Feb 2, 2015

Additional info: only happens in emacs -nw

@abingham
Copy link
Owner

abingham commented Feb 2, 2015

FWIW I'm seeing the same behavior. I'll take a look at it.

@abingham
Copy link
Owner

abingham commented Feb 2, 2015

Are you using flycheck? If so, do you see this problem if you disable flycheck? There seems to be a correlation between flycheck and this behavior, though I don't know the root cause yet.

@r4nt
Copy link
Author

r4nt commented Feb 3, 2015

@abingham - yep, this only happens when the flycheck diagnostic comes back while I'm inside the pop-up for the code completion.

@r4nt
Copy link
Author

r4nt commented Feb 5, 2015

Any ideas? Should I file bugs against flycheck / company? This is pretty much the last piece in the puzzle to have completely awesome code completion and syntax checking (and thanks very much for all your work so far, it's truly amazing :D )

@abingham
Copy link
Owner

abingham commented Feb 5, 2015

Sorry, I haven't had any time to spend on this...just started a new contract. You could try checking with flycheck and/or company to see if there are any known issues. The flycheck guy has told me that he won't support ycmd-related issues because we're doing things of which he doesn't approve (i.e. using flycheck in adventurous ways), but maybe he'll look into it.

Hopefully I'll have some time soon to poke around on this.

And thanks for the gracious words! Thank you, too, for your help making emacs-ycmd the tool that it is. Without patient and persistent colleagues like you I wouldn't have pushed it nearly as far as we have.

@r4nt
Copy link
Author

r4nt commented Feb 5, 2015

Ok, figured out this is flycheck/flycheck#526
Workaround is:
(setq flycheck-indication-mode nil)

@abingham
Copy link
Owner

abingham commented Feb 5, 2015

Brilliant! I'll keep this open as a reminder to myself to add a note to the README.

@r4nt
Copy link
Author

r4nt commented Feb 5, 2015

Even better is:
(when (not (display-graphic-p))
(setq flycheck-indication-mode nil))
I'll probably add that into our local config...

@abingham
Copy link
Owner

I've updated the README with information from this issue, so I think we're done with it.

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

No branches or pull requests

2 participants