-
Notifications
You must be signed in to change notification settings - Fork 48
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
Provide an option to disable completion in comments #6
Comments
It seems racer will be called if we're inside a comment. That shouldn't be hard to fix. |
If the only solution to fix the stalling is to turn off completions in comments then make it an on-off setting for those who haven't run into this? Some may find completions inside comments useful. I found it rather curious that the slowdown isn't constant in all comments. If you remove the "let x = 0" from above then the "// writing in this comment is broken" no longer stalls emacs. |
Good point. It might be a racer issue that it stalls. Completion is currently disabled only inside strings. |
Setting company-idle-delay to 0.1 is very aggressive. This assumes that all your company back ends together (plus GC, especially if backends are returning many candidates) take less than 0.1 seconds. We could certainly look at improving performance, but we may not be able to reach 0.1 seconds in all cases. We could disable completion in comments, but it is a useful feature so it'd have to be an option. Can you confirm the issue still occurs when racer is the only back end in company-backends? I'm aware of other backends that behave similarly with an aggressive idle delay. |
What exactly do you want company-backends to be set to? |
I investigated it a bit further. I made sure Then, I used the following macro: (defmacro with-timer (title &rest forms)
"Run the given FORMS, counting the elapsed time.
A message including the given TITLE and the corresponding elapsed
time is displayed."
(declare (indent 1))
(let ((nowvar (make-symbol "now"))
(body `(progn ,@forms)))
`(let ((,nowvar (current-time)))
(message "%s..." ,title)
(prog1 ,body
(let ((elapsed
(float-time (time-subtract (current-time) ,nowvar))))
(message "%s... done (%.3fs)" ,title elapsed)))))) and wrapped it around the call to |
Ok opened issue under racer[0]. A slight annoyance with regards to what values of company-idle-delay are considered "too low". The idle time shouldn't be reset if the key used to invoke racer-complete-at-point is hit too early. Even 0.1s delay is long enough that i often manage to hit tab to try to complete the common part before the 0.1s has passed, thus cancelling the completion and I am left wondering why it doesn't show up. In other words bad usability. |
It's rarely useful. I haven't managed to get completion out of Racer inside a comment. However, completing inside comments can really hurt performance. See #6.
It's rarely useful. I haven't managed to get completion out of Racer inside a comment. However, completing inside comments can really hurt performance. See #6.
Fixed in #60. |
Finally! 👍 |
Emacs stalls while writing in some comments such as the comment: "// writing in this comment is broken" below. Try extending the comment with writing words longer than company-minimum-prefix-length and company-idle-delay "low-enough". Simply start tapping the "a" key repeatedly for example and the letters should appear in chunks. Not sure if this is emacs-racer or racer problem and what repo the issue should have been filed to.
The text was updated successfully, but these errors were encountered: