Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Stop Flycheck on completing #300

Closed
kumar8600 opened this Issue · 15 comments

3 participants

@kumar8600

I think this is easy to implement. Just suppress flycheck-handle-change (at line 959 from flycheck.el) by defadvice while completing.

@syohex
Owner

Why do you think so ? Is there any problem ?

@kumar8600

Sorry, I don't write long sentences in English well.

Problem:
Flycheck refresh faces after 0.5 seconds progressed in idle (in default).
This behavior often overwrites Auto Complete's face for inline completion.

Auto Complete has been already ac-stop-flymake-on-completing. So, I think similar popular tool needs to cover.

@syohex
Owner

I don't know flycheck well.
Is this issue fixed by applying following patch ?

diff --git a/auto-complete.el b/auto-complete.el
index 0a49171..188acd2 100644
--- a/auto-complete.el
+++ b/auto-complete.el
@@ -1706,10 +1706,15 @@ that have been made before in this function.  When `buffer-undo-list' is
   (unless ac-clear-variables-every-minute-timer
     (setq ac-clear-variables-every-minute-timer (run-with-timer 60 60 'ac-clear-variables-every-minute)))
   (if ac-stop-flymake-on-completing
-      (defadvice flymake-on-timer-event (around ac-flymake-stop-advice activate)
-        (unless ac-completing
-          ad-do-it))
-    (ad-disable-advice 'flymake-on-timer-event 'around 'ac-flymake-stop-advice)))
+      (progn
+        (defadvice flymake-on-timer-event (around ac-flymake-stop-advice activate)
+          (unless ac-completing
+            ad-do-it))
+        (defadvice flycheck-handle-change (around ac-flycheck-stop-advice activate)
+          (unless ac-completing
+            ad-do-it)))
+    (ad-disable-advice 'flymake-on-timer-event 'around 'ac-flymake-stop-advice)
+    (ad-disable-advice 'flycheck-handle-change 'around 'ac-flycheck-stop-advice)))

 ;;;###autoload
 (define-minor-mode auto-complete-mode
@kumar8600

Thank you. It's nice. But I noticed flycheck-handle-idle-change is better than flycheck-handle-change.

@kumar8600

Thank you.

@syohex
Owner

@kumar8600 I have merged #301. Please reopen this issue if you still have problem.
Thanks for reporting.

@syohex syohex closed this
@kumar8600

Sorry, I overlooked behavior when completion is aborted. I'm ready for pull-request. But I'm not a collaborator, so I can't reopen this issue. Please reopen this issue.

@kumar8600 kumar8600 referenced this issue from a commit in kumar8600/auto-complete
@kumar8600 kumar8600 Fixed flycheck workaround when completion is aborted(#300) e0164e7
@syohex syohex reopened this
@kumar8600

Thank you for issue reopening. I pushed pull-request(#302). I fixed behavior when completion is aborted.

Fixed points:

  • I made to start flycheck's syntax checking when completion is aborted too.
    • I add timer to detect completion is aborted.
    • I add user customizable variable to custom above timer's polling interval.
  • I made to load Flymake and Flycheck (if exist) before defadvice.
  • I splited function ac-setup for ac-syntax-checker-workaround because it becomes long.
@kumar8600 kumar8600 referenced this issue from a commit in kumar8600/auto-complete
@kumar8600 kumar8600 Fixed flycheck workaround to don't use defvar-local(#300) c917992
@syohex
Owner

Sorry I revert commit for flycheck. I try to understand flycheck and try to tackle this issue.

(一旦保留とします. 対応していただいたものも travisがコケているようなので
そのあたりを含め理解してから対応を試みることにします)

@kumar8600

Copy

(了解です)

@kumar8600

Oh... I forgot to quote variable name for parameter of make-variable-buffer-local... Sorry...

1c0fd2b

(あ…単に焦ってクオートをつけるのを忘れてただけでした…すみません)

@vincentbernat

What is the status of this issue? I am using flycheck and auto-complete has stopped working. I have enabled ac-flyspell-workaround but without any change.

@syohex
Owner

@vincentbernat I'll try to apply this fix this week end.

@syohex syohex referenced this issue
Merged

Fix for flycheck #343

@syohex syohex closed this
@syohex
Owner

I merged

@kumar8600

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.