[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phpinspect 41d5d2dc55 19/30: Memoize type display name
From: |
ELPA Syncer |
Subject: |
[elpa] externals/phpinspect 41d5d2dc55 19/30: Memoize type display name |
Date: |
Sat, 31 Aug 2024 09:58:53 -0400 (EDT) |
branch: externals/phpinspect
commit 41d5d2dc5560b5f3116efd6023a46a69a5ac0815
Author: Hugo Thunnissen <devel@hugot.nl>
Commit: Hugo Thunnissen <devel@hugot.nl>
Memoize type display name
---
phpinspect-type.el | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/phpinspect-type.el b/phpinspect-type.el
index 7a1610a5dd..adf7238a89 100644
--- a/phpinspect-type.el
+++ b/phpinspect-type.el
@@ -47,6 +47,7 @@
"When the type is a collection, this attribute is set to the type
that the collection is expected to contain")
(-bare-name-sym-slot nil)
+ (-display-name-slot nil)
(category nil
:documentation
"A symbol declaring whether this type is a class,
@@ -252,13 +253,21 @@ NAMESPACE may be nil, or a string with a namespace FQN."
(cl-defmethod phpinspect--display-format-type-name ((name string))
(propertize (phpinspect--format-type-name name) 'face 'font-lock-type-face))
+(define-inline phpinspect--type-format-display-name (type)
+ (inline-letevals (type)
+ (inline-quote
+ (if (phpinspect--type-fully-qualified ,type)
+ ;; Save display name when name is fully qualified, as it won't change
+ ;; again.
+ (with-memoization (phpinspect--type--display-name-slot ,type)
+ (phpinspect--display-format-type-name (phpinspect--type-name
,type)))
+ (phpinspect--display-format-type-name (phpinspect--type-name ,type))))))
+
(cl-defmethod phpinspect--display-format-type-name ((type phpinspect--type))
- (let ((self (phpinspect--format-type-name type)))
- (propertize
- (if (phpinspect--type-contains type)
- (concat self "<" (phpinspect--format-type-name
(phpinspect--type-contains type)) ">")
- self)
- 'face 'font-lock-type-face)))
+ (let ((self (phpinspect--type-format-display-name type)))
+ (if (phpinspect--type-contains type)
+ (concat self "<" (phpinspect--format-type-name
(phpinspect--type-format-display-name type)) ">")
+ self)))
(cl-defmethod phpinspect--display-format-type-name (type)
(cl-assert (not type))
- [elpa] externals/phpinspect updated (85399a6b1d -> 95a29a3982), ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect dd77e3c67b 03/30: Bump version to 1.2.1, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 42ccef5493 10/30: Explicitly test application of trait configuration + fix bugs, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 96dd700be5 08/30: Replace phpinspect--class with new phpinspect-typedef structure, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect a66e35f57c 09/30: Test and improve typedef index reactivity and lazy loading + fix a bunch of bugs, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 41d5d2dc55 19/30: Memoize type display name,
ELPA Syncer <=
- [elpa] externals/phpinspect 870fdb519d 14/30: Optimize process of checking for/loading type dependencies, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect eec48eb6ea 28/30: Add test for update of method names in buffers + fix bug in completion, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect f1066c3c7f 29/30: Remove debug statements, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 223ca2bf54 12/30: Implement use of traits in live-edited buffers, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect b11d017702 01/30: Correctly index the name by which a function return type was referenced as used type, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 692711e34d 20/30: Implement property cells for more reliable property inheritance modeling, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 5f00c9ad8b 22/30: Fix compilation errors and fix tests for phpinspect-imports.el, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 2e6b0e9d2f 15/30: Make handling of corrupt index more robust + convert regexp to constant, ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect 77bd3ebe90 27/30: Use `delete-char' instead of `delete-backward-char', ELPA Syncer, 2024/08/31
- [elpa] externals/phpinspect bf03a87c7f 17/30: Remove obsolete class test, ELPA Syncer, 2024/08/31