diff --git a/phpinspect-index.el b/phpinspect-index.el index 502b786..a806829 100644 --- a/phpinspect-index.el +++ b/phpinspect-index.el @@ -349,6 +349,10 @@ SCOPE should be a scope token (`phpinspect-scope-p')." (setq comment-before token)) ;; Prevent comments from sticking around too long + ((and (phpinspect-use-p token) (phpinspect-word-p (cadr token))) + ;; FIXME: Actually implement indexation of trait usage. This just + ;; marks the type as used for now. + (push (cadadr token) used-types)) (t (phpinspect--log "Unsetting comment-before") (setq comment-before nil)))) diff --git a/test/test-index.el b/test/test-index.el index 81abf76..4e9c0b5 100644 --- a/test/test-index.el +++ b/test/test-index.el @@ -89,6 +89,8 @@ (phpinspect-parse-string "