lang/php: refactor company init

This commit is contained in:
Henrik Lissner 2020-02-27 23:27:28 -05:00
parent 429decef87
commit 56cba7828c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 11 additions and 12 deletions

View file

@ -2,17 +2,6 @@
(defvar +php-composer-conf (make-hash-table :test 'equal))
;;;###autoload
(defun +php-company-backend (command &optional arg &rest _ignored)
"A delegating company-backend that uses `company-phpactor' if phpactor is
available and installed, or `php-extras-company' otherwise."
(cond ((and (require 'company-phpactor nil t)
(ignore-errors (phpactor-find-executable)))
(company-phpactor command arg))
((and (require 'php-extras nil t)
(file-exists-p (concat php-extras-eldoc-functions-file ".el")))
(php-extras-company command arg))))
;;;###autoload
(defun +php-composer-conf (&optional project-root refresh-p)
"Retrieve the contents of composer.json as an alist. If REFRESH-P is non-nil