From 5eae689f09e87f6ea6e8262c14732a28dfdc936e Mon Sep 17 00:00:00 2001 From: Hugo Thunnissen Date: Thu, 17 Aug 2023 14:52:20 +0200 Subject: [PATCH] Add separate interactive function to refresh project autoloader --- phpinspect.el | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/phpinspect.el b/phpinspect.el index 411b892..8cb19b4 100644 --- a/phpinspect.el +++ b/phpinspect.el @@ -344,13 +344,11 @@ before the search is executed." (phpinspect-current-project-root)))) (phpinspect-project-get-type-filepath project class index-new))) -(defun phpinspect-index-current-project () - "Index all available FQNs in the current project." - (interactive) - (let* ((project (phpinspect--cache-get-project-create - (phpinspect--get-or-create-global-cache) - (phpinspect-current-project-root))) - (autoloader (phpinspect-project-autoload project))) +(defun phpinspect-project-refresh-autoloader (project) + (interactive (list (phpinspect--cache-get-project-create + (phpinspect--get-or-create-global-cache) + (phpinspect-current-project-root)))) + (let* ((autoloader (phpinspect-project-autoload project))) ;; Update display so that it is clear to the user that emacs is ;; responsive. Otherwise the autoloader refresh thread hogging the cpu will ;; make it look like emacs is not responsive, especially when M-x uses some @@ -358,9 +356,16 @@ before the search is executed." ;; appear frozen while the thread is executing. (redisplay) - (phpinspect-autoloader-refresh autoloader) - (phpinspect-project-enqueue-include-dirs project))) + (phpinspect-autoloader-refresh autoloader))) +(defun phpinspect-index-current-project () + "Index all available FQNs in the current project." + (interactive) + (let* ((project (phpinspect--cache-get-project-create + (phpinspect--get-or-create-global-cache) + (phpinspect-current-project-root)))) + (phpinspect-project-refresh-autoloader project) + (phpinspect-project-enqueue-include-dirs project))) (provide 'phpinspect) ;;; phpinspect.el ends here