[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phpinspect 2e487e7810 039/126: Fix resolving of functio
From: |
ELPA Syncer |
Subject: |
[elpa] externals/phpinspect 2e487e7810 039/126: Fix resolving of function argument types |
Date: |
Sat, 12 Aug 2023 00:58:38 -0400 (EDT) |
branch: externals/phpinspect
commit 2e487e78107f840c6f325beb26c71640dd7e9526
Author: Hugo Thunnissen <devel@hugot.nl>
Commit: Hugo Thunnissen <devel@hugot.nl>
Fix resolving of function argument types
---
phpinspect.el | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/phpinspect.el b/phpinspect.el
index ae44c45434..226288ffa2 100644
--- a/phpinspect.el
+++ b/phpinspect.el
@@ -297,7 +297,7 @@ accompanied by all of its enclosing tokens."
(push (nreverse current-sublist) sublists))
(nreverse sublists)))
-(defun phpinspect-get-variable-type-in-function-arg-list (variable-name
arg-list)
+(defun phpinspect-get-variable-type-in-function-arg-list (variable-name
type-resolver arg-list)
"Infer VARIABLE-NAME's type from typehints in
ARG-LIST. ARG-LIST should be a list token as returned by
`phpinspect--list-handler` (see also `phpinspect-list-p`)"
@@ -310,7 +310,8 @@ ARG-LIST. ARG-LIST should be a list token as returned by
(> arg-no 0))
(let ((arg (elt arg-list (- arg-no 1))))
(if (phpinspect-word-p arg)
- (car (last arg))
+ (funcall type-resolver
+ (phpinspect--make-type :name (car (last arg))))
nil)))))
(defun phpinspect-eldoc-function ()
@@ -614,6 +615,7 @@ resolve types of function argument variables."
(phpinspect--log "Variable was assigned with the value of another
variable")
(or (when function-arg-list
(phpinspect-get-variable-type-in-function-arg-list (cadar
last-assignment-value)
+
type-resolver
function-arg-list))
(phpinspect-get-variable-type-in-block resolvecontext
(cadar
last-assignment-value)
@@ -621,8 +623,11 @@ resolve types of function argument variables."
type-resolver
function-arg-list)))
((not assignments)
- (phpinspect--log "No assignments found for variable %s, checking
function arguments" variable-name)
- (phpinspect-get-variable-type-in-function-arg-list variable-name
function-arg-list))))))
+ (phpinspect--log "No assignments found for variable %s, checking
function arguments"
+ variable-name)
+ (phpinspect-get-variable-type-in-function-arg-list variable-name
+ type-resolver
+
function-arg-list))))))
(defun phpinspect-resolve-type-from-context (resolvecontext type-resolver)
- [elpa] externals/phpinspect 56eaa3b36d 046/126: Replace index-thread with more generic and encapsulated worker type, (continued)
- [elpa] externals/phpinspect 56eaa3b36d 046/126: Replace index-thread with more generic and encapsulated worker type, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 0c0c1ca381 059/126: Add test for phpinspect-get-pattern-type-in-block, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect ca8d0972ff 050/126: Implement psr-0 and psr-4 autoloaders, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 1f145665ef 083/126: Exclude "return" from resolvecontext subject + count comma at point for eldoc arg number, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 0ca527dbbd 070/126: Adapt `phpinspect-purge-parser-cache' to new parser caching approach, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 6627f6f76f 073/126: Remove commented parser code, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect e270729e14 088/126: Implement splay tree for overlay storage/lookup, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 94d5b75455 107/126: Add `phpinspect-pipeline-pause-time', ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect e8f486f095 013/126: Improve codestyle and documentation + add tests for indexation, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect c0786db131 040/126: WIP: Index every possibly required type ahead of time., ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 2e487e7810 039/126: Fix resolving of function argument types,
ELPA Syncer <=
- [elpa] externals/phpinspect 2fd575dbf5 044/126: Add drone.yml, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect f013b3c709 036/126: WIP: Support ambiguous typehints, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect ef9a7336cf 049/126: Replace virtual-directory with more general virtual-fs implementation, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect dbf0ec0390 051/126: Transition from index script to autoloader, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 97377c2922 055/126: Fix bugs in phpinspect-fix-imports, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 281c5e4ae6 077/126: Remove some overly verbose logging, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 0596bc52bf 091/126: Optimize splay tree and use it to store token's children, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect ab6954faf5 090/126: Retrieve and wrap metadata using the correct overlay for region, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 389e77eb8b 092/126: Expand existing overlay when possible, ELPA Syncer, 2023/08/12
- [elpa] externals/phpinspect 23245d0158 098/126: Fix some compilation warnings, ELPA Syncer, 2023/08/12