diff --git a/phpinspect-buffer.el b/phpinspect-buffer.el index bfd603c..058d31c 100644 --- a/phpinspect-buffer.el +++ b/phpinspect-buffer.el @@ -518,7 +518,7 @@ use." (interactive) (when phpinspect-current-buffer (let ((buffer phpinspect-current-buffer)) - (pop-to-buffer (generate-new-buffer "phpinspect-buffer-tree")) + (pop-to-buffer (generate-new-buffer "phpinspect-buffer-index")) (insert (pp-to-string (phpinspect--index-tokens (phpinspect-buffer-parse buffer 'no-interrupt)))) (read-only-mode)))) diff --git a/phpinspect-imports.el b/phpinspect-imports.el index f2329ab..6a5f251 100644 --- a/phpinspect-imports.el +++ b/phpinspect-imports.el @@ -185,7 +185,16 @@ that there are import (\"use\") statements for them." (interactive) (if phpinspect-current-buffer (let* ((buffer phpinspect-current-buffer) - (tree (phpinspect-buffer-parse buffer)) + ;; use buffer-reparse to ensure fully structurally correct + ;; tree. (at the time of writing, incremental parsing has some + ;; limitations causing reused tokens to lose their special meaning + ;; when they are reused. For example the "class" keyword being + ;; reused as just a word instead of a special keyword marking the + ;; start of a class) + ;; + ;; FIXME: Change to buffer-parse when this particular problem in + ;; incremental parsing has been solved + (tree (phpinspect-buffer-reparse buffer)) (index (phpinspect--index-tokens tree nil (phpinspect-buffer-location-resolver buffer))) (classes (alist-get 'classes index))