[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phpinspect 5528aff2a2 01/18: Handle cases where the fil
From: |
ELPA Syncer |
Subject: |
[elpa] externals/phpinspect 5528aff2a2 01/18: Handle cases where the filepath of a type cannot be determined |
Date: |
Fri, 16 Aug 2024 06:58:55 -0400 (EDT) |
branch: externals/phpinspect
commit 5528aff2a21f71eac37c5c378e8e5be0accab872
Author: Hugo Thunnissen <devel@hugot.nl>
Commit: Hugo Thunnissen <devel@hugot.nl>
Handle cases where the filepath of a type cannot be determined
---
phpinspect-autoload.el | 5 +++++
phpinspect-project.el | 9 +++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/phpinspect-autoload.el b/phpinspect-autoload.el
index 95043bf7d1..d556c9c395 100644
--- a/phpinspect-autoload.el
+++ b/phpinspect-autoload.el
@@ -114,6 +114,11 @@ bareword typenames."))
(string-remove-prefix ,dir ,filename))))))))
(defun phpinspect-find-composer-json-files (fs project-root)
+ "Find all composer.json files that are relevant for a project.
+
+Usually, the relevant files are the current project's
+composer.json and the composer.json files of all dependencies in
+the vendor directory."
(let ((cj-path (concat project-root "/composer.json"))
(vendor-dir (concat project-root "/vendor"))
files)
diff --git a/phpinspect-project.el b/phpinspect-project.el
index f3cae30dec..d30b078a15 100644
--- a/phpinspect-project.el
+++ b/phpinspect-project.el
@@ -126,6 +126,10 @@ serious performance hits. Enable at your own risk (:")
(dolist (func (alist-get 'functions (cdr index)))
(phpinspect-project-set-function project func))))
+(cl-defmethod phpinspect-project-add-index ((_project phpinspect-project)
index)
+ (cl-assert (not index))
+ (phpinspect--log "phpinspect-project-add-index: ignoring added nil index"))
+
(cl-defmethod phpinspect-project-set-function
((project phpinspect-project) (func phpinspect--function))
(phpinspect-project-edit project
@@ -305,10 +309,11 @@ before the search is executed."
(condition-case error
(let* ((file (phpinspect-project-get-type-filepath project type))
(visited-buffer (when file (find-buffer-visiting file))))
- (when file
+ (if file
(if visited-buffer
(with-current-buffer visited-buffer
(phpinspect-index-current-buffer))
- (with-temp-buffer (phpinspect-project-index-file project file)))))
+ (with-temp-buffer (phpinspect-project-index-file project file)))
+ (phpinspect--log "Failed to determine filepath for type %s"
(phpinspect--type-name type))))
(file-missing
(phpinspect--log "Failed to find file for type %s: %s" type error)
nil)))
- [elpa] externals/phpinspect updated (3887bc58d4 -> 4ec4c40c9d), ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect d3f100388e 04/18: Resolve property types using other methods when resolving from constructor fails, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 3fff772d8a 03/18: Fix phpinspect-buffer-index-functions test, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect d141f8a6db 08/18: Infer namespace token within import manipulation loop, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 8296641ba9 07/18: Implement removal of unused imports in `phpinspect-fix-imports', ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 93b815d71a 14/18: Index used traits (juste use of type, no actual functionality outside of that), ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 6a175c9e44 06/18: Update a few doc strings in phpinspect-index.el, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 31c6e06934 09/18: Reparse buffer when fixing import (+ add comment explaining why), ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 2e064d52e1 17/18: Implement containing type inference for collection-like class properties, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 5528aff2a2 01/18: Handle cases where the filepath of a type cannot be determined,
ELPA Syncer <=
- [elpa] externals/phpinspect 2520c89680 02/18: Account for tokens after @method annotation when indexing, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect f2f1ac9b84 05/18: Add property types and anonymous function argument types to used-types index, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 130e2c06c5 13/18: Index types used in arrays, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect f1dc699560 11/18: Detect types used with "instanceoff", ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 3a0ce3ac2d 16/18: Fix another infinite recursion bug, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect b6eadfb799 12/18: Make autoload indexation more robust and prevent double indexation, ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect c20f010ee4 10/18: Introduce `phpinspect-buffer-fresh-p' and `phpinspect-buffer-reparse-if-not-fresh', ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 2d93ec7f79 15/18: Fix infinite recursion bug in `phpinspect--get-pattern-type-in-block', ELPA Syncer, 2024/08/16
- [elpa] externals/phpinspect 4ec4c40c9d 18/18: Add eldoc for sigil variables and allow display of multiple eldoc results, ELPA Syncer, 2024/08/16