Golevka / emacs-clang-complete-async

An emacs plugin to complete C and C++ code using libclang
359 stars 71 forks source link

Repeated "fetching candidates" (windows) #48

Open bood opened 11 years ago

bood commented 11 years ago

On windows, I found sometimes the completion couldn't be shown Clang completion buffer keeps flushing After enabled some "message" traces, I found Message buffer keeps showing "ac-clang-candidate triggered - fetching candidates..."

(defun ac-clang-candidate ()
  (case ac-clang-status
    (idle
     (message "ac-clang-candidate triggered - fetching candidates...")

More debugging shows that somehow after the status set to idle in ac-clang-filter-output at:

    (otherwise
     (setq ac-clang-current-candidate (ac-clang-parse-completion-results proc))
     (message "ac-clang results arrived")
     (setq ac-clang-status 'acknowledged)
     (ac-start :force-init t)
     (ac-update)
     (setq ac-clang-status 'idle) <<<

Then the ac-clang-candidate is somehow called again and triggered ac-clang-filter-output again... This makes a infinite loop and stops the completion working.

I'm able to work around by remove that setq line, not sure how the nature of the problem should be though.

Environment: win7+emacs24.3(official binary)+auto-completion1.3.1