From 93b815d71a9b24cb309385c14274ec6c5a46b123 Mon Sep 17 00:00:00 2001 From: Hugo Thunnissen Date: Wed, 14 Aug 2024 17:22:37 +0200 Subject: [PATCH] Index used traits (juste use of type, no actual functionality outside of that) --- phpinspect-index.el | 4 ++++ test/test-index.el | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) 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 "