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

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

[elpa] externals/phpinspect 2052c289e1 1/3: Use `phpinspect--display-for


From: ELPA Syncer
Subject: [elpa] externals/phpinspect 2052c289e1 1/3: Use `phpinspect--display-format-type-name' as standardized propertized string
Date: Fri, 16 Aug 2024 09:58:43 -0400 (EDT)

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

    Use `phpinspect--display-format-type-name' as standardized propertized 
string
    
    - Move `propertize' calls into `phpinspect--display-format-type-name'
    - Use for completion as well as eldoc hints
---
 phpinspect-completion.el | 6 +++---
 phpinspect-eldoc.el      | 7 ++-----
 phpinspect-type.el       | 8 +++++---
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/phpinspect-completion.el b/phpinspect-completion.el
index 45d610be3c..69d1c23d83 100644
--- a/phpinspect-completion.el
+++ b/phpinspect-completion.el
@@ -255,7 +255,7 @@ Returns list of `phpinspect--completion'."
                                 (phpinspect--function-arguments 
completion-candidate)
                                 ", ")
                  ") "
-                 (phpinspect--format-type-name 
(phpinspect--function-return-type completion-candidate)))
+                 (phpinspect--display-format-type-name 
(phpinspect--function-return-type completion-candidate)))
    :annotation (concat " "
                        (phpinspect--type-bare-name
                         (phpinspect--function-return-type 
completion-candidate)))
@@ -266,7 +266,7 @@ Returns list of `phpinspect--completion'."
   ((completion-candidate phpinspect--variable))
   (phpinspect--construct-completion
    :value (phpinspect--variable-name completion-candidate)
-   :meta (phpinspect--format-type-name
+   :meta (phpinspect--display-format-type-name
           (or (phpinspect--variable-type completion-candidate)
               phpinspect--null-type))
    :target completion-candidate
@@ -300,7 +300,7 @@ Returns list of `phpinspect--completion'."
                      (dolist (comp completions)
                        (setq completion 
(phpinspect--completion-list-get-metadata comp-list comp))
                        (push (list comp (phpinspect--prefix-for-completion 
completion)
-                                   (phpinspect--completion-meta completion))
+                                   (concat " " (phpinspect--completion-meta 
completion)))
                              affixated))
                      (nreverse affixated)))
                  :exit-function
diff --git a/phpinspect-eldoc.el b/phpinspect-eldoc.el
index 1a24485767..8208114066 100644
--- a/phpinspect-eldoc.el
+++ b/phpinspect-eldoc.el
@@ -226,8 +226,7 @@ be implemented for return values of 
`phpinspect-eld-strategy-execute'")
                        'face 'font-lock-variable-name-face)
            phpinspect-eldoc-word-width)
           ": "
-          (propertize (phpinspect--display-format-type-name 
(phpinspect--variable-type var))
-                      'face 'font-lock-type-face)))
+          (phpinspect--display-format-type-name (phpinspect--variable-type 
var))))
 
 (cl-defstruct (phpinspect-function-doc (:constructor 
phpinspect-make-function-doc))
   (fn nil
@@ -256,9 +255,7 @@ be implemented for return values of 
`phpinspect-eld-strategy-execute'")
               (phpinspect--function-arguments fn)
               ", ")
              "): "
-             (propertize
-              (phpinspect--display-format-type-name 
(phpinspect--function-return-type fn))
-              'face 'font-lock-type-face))))
+              (phpinspect--display-format-type-name 
(phpinspect--function-return-type fn)))))
 
 (defvar phpinspect-eldoc-strategies (list (phpinspect-make-eld-attribute)
                                           (phpinspect-make-eld-function-args)
diff --git a/phpinspect-type.el b/phpinspect-type.el
index dc55ae143e..3f716371bd 100644
--- a/phpinspect-type.el
+++ b/phpinspect-type.el
@@ -216,13 +216,15 @@ NAMESPACE may be nil, or a string with a namespace FQN."
   (phpinspect--format-type-name (phpinspect--type-name type)))
 
 (cl-defmethod phpinspect--display-format-type-name ((name string))
-  (phpinspect--format-type-name name))
+  (propertize (phpinspect--format-type-name name) 'face 'font-lock-type-face))
 
 (cl-defmethod phpinspect--display-format-type-name ((type phpinspect--type))
   (let ((self (phpinspect--format-type-name type)))
-    (if (phpinspect--type-contains type)
+    (propertize
+     (if (phpinspect--type-contains type)
         (concat self "<" (phpinspect--format-type-name 
(phpinspect--type-contains type)) ">")
-      self)))
+       self)
+     'face 'font-lock-type-face)))
 
 (cl-defstruct (phpinspect--function (:constructor 
phpinspect--make-function-generated)
                                     (:copier phpinspect--copy-function))



reply via email to

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