Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental feature: PHP-IDE #709

Merged
merged 9 commits into from
Mar 18, 2023
Merged

Experimental feature: PHP-IDE #709

merged 9 commits into from
Mar 18, 2023

Conversation

zonuexe
Copy link
Member

@zonuexe zonuexe commented Oct 10, 2022

This feature is under development and experimental.
All of these functions, modes and terms are subject to change without notice.

Motivations

There are some IDE-like features / packages for PHP development. PHP-IDE bridges projects and their IDE-like features.

IDE Features

We don't recommend features, but bundle some feature bridges.
They are sorted alphabetically except none.

Configuration

Put follows code into your .emacs (~/.emacs.d/init.el) file:

(defun init-php-mode-setup ()
  (add-hook 'hack-local-variables-hook #'php-ide-mode t t))

(defun init-php-ide-mode-setup (feature activate)
  (pcase feature
    (`lsp-bridge
     (if activate
         (progn (yas-minor-mode +1)
                (corfu-mode -1))
       (yas-minor-mode -1)
       (corfu-mode +1)))))

(with-eval-after-load 'php-ide
  (custom-set-variables
   '(php-ide-features . 'eglot) ;; and/or 'none, 'phpactor, 'lsp-mode
   '(php-ide-eglot-executable "psalm-language-server") ;; or "intelephense", '("php" "vendor/bin/path/to/server")
   ;; If you want to hide php-ide-mode from the mode line, set an empty string
   '(php-ide-mode-lighter ""))

  (add-hook 'php-mode-hook #'init-php-mode-setup)
  (add-hook 'php-ide-mode-functions #'init-php-ide-mode-setup))

If you don't enable IDE support by default, set '(php-ide-feature 'none)

For per project configuration

Put follows code into .dir-locals.el in project directory:

((nil (php-project-root . git))
 (php-mode (php-ide-features . (lsp-mode))))

If you can't put .dir-locals.el in your project directory, consider the sidecar-locals package.

close #656.

@zonuexe zonuexe mentioned this pull request Oct 10, 2022
@zonuexe zonuexe force-pushed the feature/php-ide branch 3 times, most recently from bc64776 to e79e686 Compare November 6, 2022 16:36
@zonuexe zonuexe force-pushed the feature/php-ide branch 5 times, most recently from f704f1c to da3dbfd Compare January 4, 2023 14:23
@zonuexe zonuexe changed the title New feature: PHP-IDE Experimental feature: PHP-IDE Jan 4, 2023
@zonuexe zonuexe force-pushed the feature/php-ide branch 2 times, most recently from 2527014 to 84abbf2 Compare January 4, 2023 17:53
@zonuexe zonuexe force-pushed the feature/php-ide branch 2 times, most recently from c9260e6 to 76af9c4 Compare February 12, 2023 07:37
@zonuexe zonuexe force-pushed the feature/php-ide branch 3 times, most recently from 116120d to 8331d8e Compare March 8, 2023 13:08
@zonuexe zonuexe merged commit c68e18c into master Mar 18, 2023
@zonuexe zonuexe deleted the feature/php-ide branch March 18, 2023 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant