Skip to content

Commit b09f28f

Browse files
nanasesszonuexe
authored andcommitted
Use :async to candidates
1 parent c3a41f2 commit b09f28f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

company-phpactor.el

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ Here we create a temporary syntax table in order to add $ to symbols."
7575
"Show additional info (ARG) from phpactor as lateral annotation."
7676
(message (concat " " (get-text-property 0 'annotation arg))))
7777

78+
(defun company-phpactor--get-candidates-async (callback)
79+
"Get completion candidates asynchronously."
80+
(funcall callback (company-phpactor--get-candidates)))
81+
7882
;;;###autoload
7983
(defun company-phpactor (command &optional arg &rest ignored)
8084
"`company-mode' completion backend for Phpactor."
@@ -87,7 +91,9 @@ Here we create a temporary syntax table in order to add $ to symbols."
8791
(`annotation (company-phpactor--annotation arg))
8892
(`interactive (company-begin-backend 'company-phpactor))
8993
(`prefix (company-phpactor--grab-symbol))
90-
(`candidates (company-phpactor--get-candidates))))))
94+
(`candidates
95+
(cons :async (lambda (callback)
96+
(company-phpactor--get-candidates-async callback))))))))
9197

9298
(provide 'company-phpactor)
9399
;;; company-phpactor.el ends here

0 commit comments

Comments
 (0)