|
41 | 41 | ;;
|
42 | 42 | ;; - none
|
43 | 43 | ;; Does not launch any IDE features.
|
| 44 | +;; - eglot |
| 45 | +;; https://github.com/joaotavora/eglot |
44 | 46 | ;; - lsp-mode
|
45 | 47 | ;; https://emacs-lsp.github.io/lsp-mode/
|
46 | 48 | ;; https://github.com/emacs-lsp/lsp-mode
|
|
95 | 97 | (phpactor :test (lambda () (and (require 'phpactor nil t) (featurep 'phpactor)))
|
96 | 98 | :activate php-ui-phpactor-activate
|
97 | 99 | :deactivate php-ui-phpactor-activate)
|
| 100 | + (eglot :test (lambda () (and (require 'eglot nil t) (featurep 'eglot))) |
| 101 | + :activate eglot-ensure |
| 102 | + :deactivate eglot--managed-mode-off) |
98 | 103 | (lsp-mode :test (lambda () (and (require 'lsp nil t) (featurep 'lsp)))
|
99 | 104 | :activate lsp
|
100 | 105 | :deactivate lsp-workspace-shutdown)))
|
|
105 | 110 | :prefix "php-ui-"
|
106 | 111 | :group 'php)
|
107 | 112 |
|
| 113 | +(defcustom php-ui-eglot-executable nil |
| 114 | + "A symbol of PHP-UI feature" |
| 115 | + :tag "PHP-UI Eglot Executable" |
| 116 | + :group 'php-ui |
| 117 | + :type '(repeat string) |
| 118 | + :safe (lambda (v) (or (stringp v) (listp v)))) |
| 119 | + |
108 | 120 | (defcustom php-ui-feature nil
|
109 | 121 | "A symbol of PHP-UI feature"
|
110 | 122 | :tag "PHP-UI Feature"
|
|
146 | 158 | (let ((php-ui-feature feature))
|
147 | 159 | (php-ui-mode +1)))
|
148 | 160 |
|
| 161 | +;;;###autoload |
| 162 | +(defun php-ui-eglot-server-program () |
| 163 | + "Return a list of command to execute LSP Server." |
| 164 | + (if (stringp php-ui-eglot-executable) |
| 165 | + (list php-ui-eglot-executable) |
| 166 | + php-ui-eglot-executable)) |
| 167 | + |
| 168 | +(defun php-ui--eglot-current-server () |
| 169 | + (php-project-get-root-dir)) |
| 170 | + |
149 | 171 | (defun php-ui--activate-buffer (ui-plist)
|
150 | 172 | "Activate php-ui implementation by UI-PLIST."
|
151 | 173 | (funcall (plist-get ui-plist :activate)))
|
|
0 commit comments