[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phpinspect c50f2ae09b 020/126: Fix resolving of "static
From: |
ELPA Syncer |
Subject: |
[elpa] externals/phpinspect c50f2ae09b 020/126: Fix resolving of "static" and "self" types |
Date: |
Sat, 12 Aug 2023 00:58:37 -0400 (EDT) |
branch: externals/phpinspect
commit c50f2ae09b8805fe670c5f120131684792bc5c7e
Author: Hugo Thunnissen <devel@hugot.nl>
Commit: Hugo Thunnissen <devel@hugot.nl>
Fix resolving of "static" and "self" types
---
phpinspect.el | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/phpinspect.el b/phpinspect.el
index eeb6bc2557..f2d7a5ce1d 100644
--- a/phpinspect.el
+++ b/phpinspect.el
@@ -1166,8 +1166,7 @@ TODO:
(statement (phpinspect--get-last-statement-in-token
enclosing-token))
(type-resolver (phpinspect--make-type-resolver-for-resolvecontext
- resolvecontext
- token-tree))
+ resolvecontext))
(static))
(phpinspect--log "Enclosing token: %s" enclosing-token)
(phpinspect--log "reference token: %s" (car (last statement 2)))
@@ -1478,6 +1477,7 @@ resolve types of function argument variables."
(defun phpinspect--make-type-resolver (types &optional token-tree namespace)
"Little wrapper closure to pass around and resolve types with."
(unless namespace (setq namespace ""))
+
(let* ((inside-class
(if token-tree (or (phpinspect--find-innermost-incomplete-class
token-tree)
(phpinspect--find-class-token token-tree))))
@@ -1487,7 +1487,8 @@ resolve types of function argument variables."
(phpinspect--real-type
types
namespace
- (if (and inside-class-name (or (string= type "self") (string= type
"static")))
+ (if (and inside-class-name (or (string= type "self")
+ (string= type "static")))
(progn
(phpinspect--log "Returning inside class name for %s : %s"
type inside-class-name)
@@ -1937,7 +1938,7 @@ Example configuration:
(defun phpinspect--find-class-token (token)
"Recurse into token tree until a class is found."
- (when (and (listp token) (> 1 (length token)))
+ (when (and (listp token) (> (length token) 1))
(let ((last-token (car (last token))))
(cond ((phpinspect-class-p token) token)
(last-token
@@ -2065,8 +2066,7 @@ static variables and static methods."
phpinspect--buffer-index
(phpinspect--index-tokens token-tree)))
(type-resolver (phpinspect--make-type-resolver-for-resolvecontext
- resolvecontext
- token-tree))
+ resolvecontext))
(method-lister (phpinspect--make-method-lister
resolvecontext
buffer-classes
@@ -2083,7 +2083,7 @@ static variables and static methods."
(funcall method-lister type)))))))
(defun phpinspect--make-type-resolver-for-resolvecontext
- (resolvecontext &optional token-tree)
+ (resolvecontext)
(let ((namespace-or-root
(seq-find #'phpinspect-namespace-or-root-p
(phpinspect--resolvecontext-enclosing-tokens
@@ -2091,7 +2091,9 @@ static variables and static methods."
(phpinspect--make-type-resolver
(phpinspect--uses-to-types
(seq-filter #'phpinspect-use-p namespace-or-root))
- token-tree
+ (seq-find #'phpinspect-class-p
+ (phpinspect--resolvecontext-enclosing-tokens
+ resolvecontext))
(when (phpinspect-namespace-p namespace-or-root)
(cadadr namespace-or-root)))))
@@ -2414,7 +2416,6 @@ located in \"vendor\" folder."
when INDEX-NEW is non-nil, new files are added to the index
before the search is executed."
- (phpinspect--log "%s" (phpinspect--get-project-root))
(when (eq index-new 'index-new)
(with-temp-buffer
(call-process phpinspect-index-executable nil (current-buffer) nil
"index" "--new")))
- [elpa] externals/phpinspect 75562aab35 085/126: Add some tests for edit tracker + patch newly discovered bugs, (continued)
- [elpa] externals/phpinspect 75562aab35 085/126: Add some tests for edit tracker + patch newly discovered bugs, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 135263c533 110/126: Add tests for incremental parsing + fix parser bugs that came to light, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect ea7795c76e 106/126: Remove commented code, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 9b82c0d0f6 111/126: Reimplement `phpinspect-fix-imports' using metadata objects, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect c20df819b8 114/126: Give `phpinspect-buffer' responsibility over buffer indexation, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 04606a4756 121/126: Fix test, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect d51137e58e 112/126: Remove faulty edit tracker code based on wrong deduction, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect db3ec3b67d 124/126: Add custom variables for worker and pipeline pause time, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 50d2bfeebe 002/126: Change indexer's cache dir from/to .cache/{phpns, phpinspect}, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 0b210309e7 041/126: Fix variable suggestion when there are loose dollar signs in the buffer, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect c50f2ae09b 020/126: Fix resolving of "static" and "self" types,
ELPA Syncer <=
- [elpa] externals/phpinspect 1816495538 045/126: Use thread-live-p in stead of thread-alive-p for emacs 28.1 support, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 8d3bd21015 006/126: Add license information, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 811a9a9141 010/126: Add more tests for the parser code, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect b338aa9b75 012/126: Fix most of the byte-compilation warnings, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect f5fe299c01 027/126: Make functions that access the filesystem configurable and add test, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect a6bb09b2b3 026/126: Test and fix static function indexation, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 3838e02820 067/126: Prevent worker thread from associating with the current buffer, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 91e24b97d4 074/126: Make bmap-token-meta error on unexpected input, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 7f76ba4c11 072/126: Fix some bugs introduced by the incremental parsing feature, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 1ec0e0cfa2 078/126: Limit token lookback range and start completion from the first non-blank character, ELPA Syncer, 2023/08/12