emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/phpinspect f8bf0b611a 035/126: WIP: List static methods


From: ELPA Syncer
Subject: [elpa] externals/phpinspect f8bf0b611a 035/126: WIP: List static methods when requested
Date: Sat, 12 Aug 2023 00:58:38 -0400 (EDT)

branch: externals/phpinspect
commit f8bf0b611ad5f50eb912e755eeea8e428938dbc2
Author: Hugo Thunnissen <devel@hugot.nl>
Commit: Hugo Thunnissen <devel@hugot.nl>

    WIP: List static methods when requested
---
 phpinspect-class.el | 7 +++++++
 phpinspect.el       | 8 ++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/phpinspect-class.el b/phpinspect-class.el
index d03a21a336..c2918f6ca2 100644
--- a/phpinspect-class.el
+++ b/phpinspect-class.el
@@ -122,6 +122,13 @@
              (phpinspect--class-methods class))
     methods))
 
+(cl-defmethod phpinspect--class-get-static-method-list ((class 
phpinspect--class))
+  (let ((methods))
+    (maphash (lambda (key method)
+               (push method methods))
+             (phpinspect--class-static-methods class))
+    methods))
+
 (cl-defmethod phpinspect--class-update-static-method ((class phpinspect--class)
                                                       (method 
phpinspect--function))
   (let ((existing (gethash (phpinspect--function-name-symbol method)
diff --git a/phpinspect.el b/phpinspect.el
index a6cc848fef..e0eec178b1 100644
--- a/phpinspect.el
+++ b/phpinspect.el
@@ -212,7 +212,9 @@ accompanied by all of its enclosing tokens."
         (when class
           (phpinspect--log "Retrieved class index, starting method collection 
%s (%s)"
                            project-root class-fqn)
-          (phpinspect--class-get-method-list class)))))
+          (if static
+              (phpinspect--class-get-static-method-list class)
+            (phpinspect--class-get-method-list class))))))
 
 (defmacro phpinspect-find-function-in-list (method-name list)
   (let ((break-sym (gensym))
@@ -677,7 +679,9 @@ resolve types of function argument variables."
   (let ((class (phpinspect-get-or-create-cached-project-class
                 (phpinspect-project-root)
                 class-name)))
-    (when class (phpinspect--class-variables class))))
+    ;; TODO return static variables/constants when static is set
+    (when class
+      (phpinspect--class-variables class))))
 
 (defun phpinspect--get-methods-for-class
     (resolvecontext buffer-classes class &optional static)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]