Skip to content

Commit 548d302

Browse files
kermorgantzonuexe
authored andcommitted
check phpactor-find-executable before completion (#106)
also remove useless call to all-completions
1 parent 125bb1c commit 548d302

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

company-phpactor.el

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,15 @@ Here we create a temporary syntax table in order to add $ to symbols."
7979
(defun company-phpactor (command &optional arg &rest ignored)
8080
"`company-mode' completion backend for Phpactor."
8181
(interactive (list 'interactive))
82-
(save-restriction
83-
(widen)
84-
(pcase command
85-
(`post-completion (company-phpactor--post-completion arg))
86-
(`annotation (company-phpactor--annotation arg))
87-
(`interactive (company-begin-backend 'company-phpactor))
88-
(`prefix (company-phpactor--grab-symbol))
89-
(`candidates (all-completions arg (company-phpactor--get-candidates))))))
82+
(when (phpactor-find-executable)
83+
(save-restriction
84+
(widen)
85+
(pcase command
86+
(`post-completion (company-phpactor--post-completion arg))
87+
(`annotation (company-phpactor--annotation arg))
88+
(`interactive (company-begin-backend 'company-phpactor))
89+
(`prefix (company-phpactor--grab-symbol))
90+
(`candidates (company-phpactor--get-candidates))))))
9091

9192
(provide 'company-phpactor)
9293
;;; company-phpactor.el ends here

0 commit comments

Comments
 (0)