Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 252 forks source link

Periodic reparse freezes emacs when enable-unsaved-reparsing is set #683

Closed Nephyrin closed 8 years ago

Nephyrin commented 8 years ago

On Emacs 25.0.93 (git c6077bf), using settings:

  (setq rtags-enable-unsaved-reparsing t)
  (setq rtags-periodic-reparse-timeout 0.5)

The periodic reparses will constantly freeze emacs while in progress. Disabling either setting will fix it -- the issue only arises when both are enabled.

Possibly relevant: Observing rdm's output, --wait is passed to rp for the periodic reparses if and only if enable-unsaved-reparsing set.

juergenhoetzel commented 8 years ago

Possibly relevant: Observing rdm's output, --wait is passed to rp for the periodic reparses if and only if enable-unsaved-reparsing set.

I also hit this issue. I wonder @Andersbakken if the current implementation is correct/as intended:

(defun rtags-reparse-file (&optional buffer force)
  "WAIT-REPARSING : t to wait for reparsing to finish, nil for async (no waiting)."

because the actual invocation of the external rccommand is always sync when rtags-enable-unsaved-reparsing is enabled:

              (rtags-call-rc :path file
                             :timeout rtags-reparse-timeout
                             :unsaved buffer
                             "--silent"
                             "-V" file
                             (if rtags-enable-unsaved-reparsing "--wait")))

thus elisp is blocked. Also I wonder @cslux about the implementation of

(defun flycheck-rtags--start (checker callback)
  (let ((buffer (current-buffer)))
    (rtags-diagnostics)
    (funcall callback 'finished (flycheck-rtags--build-error checker buffer))))

I thought an async reparsing should be started here. And the callback should be called when the actual parsing finished and not immediately. :question:

Andersbakken commented 8 years ago

Sorry about the long delay.

I agree. No reason to wait for the periodic reparse. I think it should be fixed now. Thanks