branch: externals/phpinspect
commit 4041796ee00524c1db720a061c41d8c96149bf81
Author: Hugo Thunnissen <de...@hugot.nl>
Commit: Hugo Thunnissen <de...@hugot.nl>

    Fix compilation errors (move `phpinspect-project-read-type-name' to 
phpinspect-imports.el)
---
 phpinspect-imports.el | 18 ++++++++++++++++++
 phpinspect-project.el | 18 ------------------
 test/test-suggest.el  |  4 +---
 3 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/phpinspect-imports.el b/phpinspect-imports.el
index 9e2505f025..dddbf6578b 100644
--- a/phpinspect-imports.el
+++ b/phpinspect-imports.el
@@ -398,6 +398,24 @@ that there are import (\"use\") statements for them."
               (phpinspect-format-use-statements buffer 
(phpinspect-find-first-use parent))
               (phpinspect-buffer-parse buffer 'no-interrupt)))))))
 
+(defun phpinspect-project-read-type-name (prompt &optional project)
+  "Read a non-fully-qualified type-name using `completing-read'.
+
+PROMPT is passed to `completing-read'.
+
+PROJECT, if provided should be an instance of
+`phpinspect-project'.  If PROJECT is nil, the active project is
+determined using `phpinspect-current-project'."
+  (unless project (setq project (phpinspect-current-project)))
+
+  (phpinspect-intern-name
+   (completing-read
+    prompt
+    (phpinspect-names-to-alist
+     (phpinspect-autoloader-get-type-names
+      (phpinspect-project-autoload project)))
+    nil 'require-match nil 'phpinspect--project-type-name-history)))
+
 (defun phpinspect-insert-type (type-name)
   "Insert TYPE-NAME as string into current buffer.
 
diff --git a/phpinspect-project.el b/phpinspect-project.el
index 79ba9909ba..9eedd87c6c 100644
--- a/phpinspect-project.el
+++ b/phpinspect-project.el
@@ -361,24 +361,6 @@ before the search is executed."
 (defvar phpinspect--project-type-name-history nil
   "History list to use for `phpinspect-project-read-type-name'")
 
-(defun phpinspect-project-read-type-name (prompt &optional project)
-  "Read a non-fully-qualified type-name using `completing-read'.
-
-PROMPT is passed to `completing-read'.
-
-PROJECT, if provided should be an instance of
-`phpinspect-project'.  If PROJECT is nil, the active project is
-determined using `phpinspect-current-project'."
-  (unless project (setq project (phpinspect-current-project)))
-
-  (phpinspect-intern-name
-   (completing-read
-    prompt
-    (phpinspect-names-to-alist
-     (phpinspect-autoloader-get-type-names
-      (phpinspect-project-autoload project)))
-    nil 'require-match nil 'phpinspect--project-type-name-history)))
-
 ;;; INDEX TASK
 (cl-defstruct (phpinspect-index-task
                (:constructor phpinspect-make-index-task-generated))
diff --git a/test/test-suggest.el b/test/test-suggest.el
index 4a79377453..d67570723e 100644
--- a/test/test-suggest.el
+++ b/test/test-suggest.el
@@ -156,9 +156,7 @@ namespace App;
                              (current-buffer)
                              
(phpinspect--make-dummy-composer-project-with-code)))
                 (rctx (phpinspect-buffer-get-resolvecontext buffer (point)))
-                (results (phpinspect-suggest-attributes-at-point rctx t))
-                (types (seq-filter #'phpinspect--type-p results))
-                (words (seq-filter #'phpinspect-suggest-keyword-p results)))
+                (results (phpinspect-suggest-attributes-at-point rctx t))_)
 
         (should (length= results 1))
         (should (equal (list "dont")

Reply via email to