Skip to content

Commit

Permalink
Add php-ide-eglot-server-program command
Browse files Browse the repository at this point in the history
  • Loading branch information
zonuexe committed Feb 11, 2023
1 parent dbcd587 commit c9260e6
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion lisp/php-ide.el
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@
;;

;;; Code:
(require 'cl-lib)
(require 'php-project)

(eval-when-compile
(require 'cl-lib)
(require 'php-ide-phpactor)
(defvar eglot-server-programs)
(declare-function lsp-bridge-mode "ext:lsp-bridge" ())
Expand Down Expand Up @@ -136,6 +136,31 @@
:safe (lambda (v) (cl-loop for feature in (if (listp v) v (list v))
always (symbolp feature))))

;;;###autoload
(defcustom php-ide-eglot-executable nil
"Command name or path to the command of Eglot LSP executable."
:tag "PHP-IDE Eglot Executable"
:group 'php-ide
:type '(choice
(const intelephense)
(const phpactor)
string (repeat string))
:safe (lambda (v) (cond
((stringp v) (file-exists-p v))
((listp v) (cl-every #'stringp v))
((assq v php-ide-lsp-command-alist)))))

;;;###autoload
(defun php-ide-eglot-server-program ()
"Return a list of command to execute LSP Server."
(cond
((stringp php-ide-eglot-executable) (list php-ide-eglot-executable))
((listp php-ide-eglot-executable) php-ide-eglot-executable)
((when-let (command (assq php-ide-eglot-executable php-ide-lsp-command-alist))
(cond
((functionp command) (funcall command))
((listp command) command))))))

(defcustom php-ide-mode-lighter " PHP-IDE"
"A symbol of PHP-IDE feature."
:tag "PHP-IDE Mode Lighter"
Expand Down

0 comments on commit c9260e6

Please sign in to comment.