mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-02 14:53:38 -05:00
refactor!(php): remove php-extras
BREAKING CHANGE: The PHP API data file no longer exists on php.net, and there is no substitute, and php-extras is no longer maintained, so this package is defunct and leaves php buffers in an error state. This deprives non-LSP users from eldoc and naive code completion. The alternative is to simply adopt LSP.
This commit is contained in:
@@ -1,8 +1,5 @@
|
|||||||
;;; lang/php/config.el -*- lexical-binding: t; -*-
|
;;; lang/php/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defvar +php--company-backends nil
|
|
||||||
"List of company backends to use in `php-mode'.")
|
|
||||||
|
|
||||||
(defvar +php-default-docker-container "php-fpm"
|
(defvar +php-default-docker-container "php-fpm"
|
||||||
"The default docker container to run commands in.")
|
"The default docker container to run commands in.")
|
||||||
|
|
||||||
@@ -48,13 +45,7 @@
|
|||||||
:return "return"
|
:return "return"
|
||||||
:yield "use")
|
:yield "use")
|
||||||
|
|
||||||
(if (modulep! -lsp)
|
(when (modulep! +lsp)
|
||||||
;; `+php-company-backend' uses `php-extras-company' or
|
|
||||||
;; `company-dabbrev-code', in that order.
|
|
||||||
(when +php--company-backends
|
|
||||||
(set-company-backend! 'php-mode
|
|
||||||
(cons :separate +php--company-backends)
|
|
||||||
'company-dabbrev-code))
|
|
||||||
(when (executable-find "php-language-server.php")
|
(when (executable-find "php-language-server.php")
|
||||||
(setq lsp-clients-php-server-command "php-language-server.php"))
|
(setq lsp-clients-php-server-command "php-language-server.php"))
|
||||||
(add-hook 'php-mode-local-vars-hook #'lsp! 'append))
|
(add-hook 'php-mode-local-vars-hook #'lsp! 'append))
|
||||||
@@ -89,32 +80,6 @@
|
|||||||
"rv" #'php-refactor--rename-local-variable))
|
"rv" #'php-refactor--rename-local-variable))
|
||||||
|
|
||||||
|
|
||||||
(use-package! php-extras
|
|
||||||
:after php-mode
|
|
||||||
:preface
|
|
||||||
(setq php-extras-eldoc-functions-file
|
|
||||||
(concat doom-profile-cache-dir "php-extras-eldoc-functions"))
|
|
||||||
;; We'll set up company support ourselves
|
|
||||||
(advice-add #'php-extras-company-setup :override #'ignore)
|
|
||||||
(add-to-list '+php--company-backends #'php-extras-company)
|
|
||||||
:config
|
|
||||||
;; Silence warning if `php-extras-eldoc-functions-file' hasn't finished
|
|
||||||
;; generating yet.
|
|
||||||
(defun php-extras-load-eldoc ()
|
|
||||||
(require 'php-extras-eldoc-functions php-extras-eldoc-functions-file t))
|
|
||||||
;; Make expensive php-extras generation async
|
|
||||||
(unless (file-exists-p (concat php-extras-eldoc-functions-file ".el"))
|
|
||||||
(message "Generating PHP eldoc files...")
|
|
||||||
(require 'async)
|
|
||||||
(async-start `(lambda ()
|
|
||||||
,(async-inject-variables "\\`\\(load-path\\|php-extras-eldoc-functions-file\\)$")
|
|
||||||
(require 'php-extras-gen-eldoc)
|
|
||||||
(php-extras-generate-eldoc-1 t))
|
|
||||||
(lambda (_)
|
|
||||||
(load (concat php-extras-eldoc-functions-file ".el"))
|
|
||||||
(message "PHP eldoc updated!")))))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package! hack-mode
|
(use-package! hack-mode
|
||||||
:when (modulep! +hack)
|
:when (modulep! +hack)
|
||||||
:mode "\\.hh\\'")
|
:mode "\\.hh\\'")
|
||||||
|
@@ -2,9 +2,6 @@
|
|||||||
;;; lang/php/packages.el
|
;;; lang/php/packages.el
|
||||||
|
|
||||||
(package! psysh :pin "223bf55975d148f65f66bb8980c14c1230f067ff")
|
(package! psysh :pin "223bf55975d148f65f66bb8980c14c1230f067ff")
|
||||||
(package! php-extras
|
|
||||||
:recipe (:host github :repo "arnested/php-extras")
|
|
||||||
:pin "d410c5af663c30c01d461ac476d1cbfbacb49367")
|
|
||||||
(package! php-mode :pin "462b62248f7b3c6550ceea1b44760ddd951ab7ab")
|
(package! php-mode :pin "462b62248f7b3c6550ceea1b44760ddd951ab7ab")
|
||||||
(package! php-refactor-mode :pin "7a794b0618df2882b1bd586fdd698dba0bc5130d")
|
(package! php-refactor-mode :pin "7a794b0618df2882b1bd586fdd698dba0bc5130d")
|
||||||
(package! phpunit :pin "650a50898de1fa4eeb47360b12aeb1126b2448c2")
|
(package! phpunit :pin "650a50898de1fa4eeb47360b12aeb1126b2448c2")
|
||||||
|
Reference in New Issue
Block a user