File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 8484; ;
8585
8686; ;; Code:
87+ (require 'cl-lib )
8788(require 'php-project )
8889
8990(eval-when-compile
90- (require 'cl-lib )
9191 (require 'php-ide-phpactor )
9292 (defvar eglot-server-programs )
9393 (declare-function lsp-bridge-mode " ext:lsp-bridge" ())
136136 :safe (lambda (v ) (cl-loop for feature in (if (listp v) v (list v))
137137 always (symbolp feature))))
138138
139+ ;;;### autoload
140+ (defcustom php-ide-eglot-executable nil
141+ " Command name or path to the command of Eglot LSP executable."
142+ :tag " PHP-IDE Eglot Executable"
143+ :group 'php-ide
144+ :type '(choice
145+ (const intelephense)
146+ (const phpactor)
147+ string (repeat string))
148+ :safe (lambda (v ) (cond
149+ ((stringp v) (file-exists-p v))
150+ ((listp v) (cl-every #'stringp v))
151+ ((assq v php-ide-lsp-command-alist)))))
152+
153+ ;;;### autoload
154+ (defun php-ide-eglot-server-program ()
155+ " Return a list of command to execute LSP Server."
156+ (cond
157+ ((stringp php-ide-eglot-executable) (list php-ide-eglot-executable))
158+ ((listp php-ide-eglot-executable) php-ide-eglot-executable)
159+ ((when-let (command (assq php-ide-eglot-executable php-ide-lsp-command-alist))
160+ (cond
161+ ((functionp command) (funcall command))
162+ ((listp command) command))))))
163+
139164(defcustom php-ide-mode-lighter " PHP-IDE"
140165 " A symbol of PHP-IDE feature."
141166 :tag " PHP-IDE Mode Lighter"
You can’t perform that action at this time.
0 commit comments