[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phpinspect f9f12590e8 6/8: Handle cases where declarati
From: |
ELPA Syncer |
Subject: |
[elpa] externals/phpinspect f9f12590e8 6/8: Handle cases where declarations do not contain a name |
Date: |
Mon, 14 Aug 2023 15:58:29 -0400 (EDT) |
branch: externals/phpinspect
commit f9f12590e8c106dd804d96bee9926c4dd84b0051
Author: Hugo Thunnissen <devel@hugot.nl>
Commit: Hugo Thunnissen <devel@hugot.nl>
Handle cases where declarations do not contain a name
---
phpinspect-project.el | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/phpinspect-project.el b/phpinspect-project.el
index 0eb3ac8ce8..6f8b228fff 100644
--- a/phpinspect-project.el
+++ b/phpinspect-project.el
@@ -189,20 +189,23 @@ indexed by the absolute paths of the files they're
watching."))
(cl-defmethod phpinspect-project-add-class
((project phpinspect-project) (indexed-class (head
phpinspect--indexed-class)) &optional index-imports)
- (let* ((class-name (phpinspect--type-name-symbol
- (alist-get 'class-name (cdr indexed-class))))
- (class (gethash class-name
- (phpinspect-project-class-index project))))
- (unless class
- (setq class (phpinspect--make-class-generated :project project)))
-
- (when index-imports
- (phpinspect-project-enqueue-imports
- project (alist-get 'imports (cdr indexed-class))))
-
- (phpinspect--class-set-index class indexed-class)
- (puthash class-name class (phpinspect-project-class-index project))
- (phpinspect-project-add-class-attribute-types-to-index-queue project
class)))
+ (if (not (alist-get 'class-name (cdr indexed-class)))
+ (phpinspect--log "Error: Class with declaration %s does not have a name"
(alist-get 'declaration indexed-class))
+ ;; Else
+ (let* ((class-name (phpinspect--type-name-symbol
+ (alist-get 'class-name (cdr indexed-class))))
+ (class (gethash class-name
+ (phpinspect-project-class-index project))))
+ (unless class
+ (setq class (phpinspect--make-class-generated :project project)))
+
+ (when index-imports
+ (phpinspect-project-enqueue-imports
+ project (alist-get 'imports (cdr indexed-class))))
+
+ (phpinspect--class-set-index class indexed-class)
+ (puthash class-name class (phpinspect-project-class-index project))
+ (phpinspect-project-add-class-attribute-types-to-index-queue project
class))))
(cl-defmethod phpinspect-project-set-class
((project phpinspect-project) (class-fqn phpinspect--type) (class
phpinspect--class))
- [elpa] externals/phpinspect updated (7c76cbcc54 -> f1e4a5be7d), ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect 8b6dc2eb38 1/8: Catch composer json format errors and notify user, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect 71531b7996 5/8: Define free variables + use condition-case-unless-debug, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect f1e4a5be7d 8/8: Remove debug statement for company backend, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect 6e5e2e3a07 3/8: Exclude comments from eldoc statement, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect 2ff9919e44 4/8: Add debug statements + use condition-case-unless-debug for token indexation, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect 633b08809e 2/8: Only retrieve/update class when a name has been declared for it, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect f6cc199886 7/8: When debugging, forward worker errors to main thread, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect f9f12590e8 6/8: Handle cases where declarations do not contain a name,
ELPA Syncer <=