LoginSignup
1
1

More than 1 year has passed since last update.

EmacsでPHP(php-mode+lsp-mode)

Posted at

Emacsにphp-modeとlsp-modeを導入したい、ということで。

こちらを使ってみます。

利用にあたっては、PHP自体とNode.jsがローカルにインストールされている必要があるみたいです。

php-modeは、MELPAからインストール。

lsp-modeそのものは、設定済みとします。

あとは、php-modeのhookにlsp-modeを設定して

(use-package lsp-mode
  :ensure t
  :commands (lsp lsp-deferred)
  :hook (php-mode . lsp-deferred))

PHPのソースコードを開くと、Language Serverをダウンロードするか聞かれます。

補完候補は一択で、iphとするとPHPのLanguage Serverがダウンロードされます。

emacs-lspのページからリンクされている、こちらのLanguage Serverです。

これで補完などが有効になります。

image.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1