@@ -7307,16 +7307,11 @@ Return a nested alist keyed by symbol names. e.g.
7307
7307
7308
7308
(defun lsp-server-present? (final-command)
7309
7309
"Check whether FINAL-COMMAND is present."
7310
- ;; executable-find only gained support for remote checks after 27 release
7311
- (or (and (cond
7312
- ((not (file-remote-p default-directory))
7313
- (executable-find (cl-first final-command)))
7314
- ((version<= "27.0" emacs-version)
7315
- (with-no-warnings (executable-find (cl-first final-command) (file-remote-p default-directory))))
7316
- (t))
7317
- (prog1 t
7318
- (lsp-log "Command \"%s\" is present on the path." (s-join " " final-command))))
7319
- (ignore (lsp-log "Command \"%s\" is not present on the path." (s-join " " final-command)))))
7310
+ (let ((binary-found? (executable-find (cl-first final-command) t)))
7311
+ (if binary-found?
7312
+ (lsp-log "Command \"%s\" is present on the path." (s-join " " final-command))
7313
+ (lsp-log "Command \"%s\" is not present on the path." (s-join " " final-command)))
7314
+ binary-found?))
7320
7315
7321
7316
(defun lsp--value-to-string (value)
7322
7317
"Convert VALUE to a string that can be set as value in an environment
@@ -7464,7 +7459,7 @@ process listening for TCP connections on the provided port."
7464
7459
(port (lsp--find-available-port host (cl-incf lsp--tcp-port)))
7465
7460
(command (funcall command-fn port))
7466
7461
(final-command (if (consp command) command (list command)))
7467
- (_ (unless (executable-find (cl-first final-command) )
7462
+ (_ (unless (lsp-server-present? final-command)
7468
7463
(user-error (format "Couldn't find executable %s" (cl-first final-command)))))
7469
7464
(process-environment
7470
7465
(lsp--compute-process-environment environment-fn))
@@ -7477,7 +7472,7 @@ process listening for TCP connections on the provided port."
7477
7472
(set-process-query-on-exit-flag tcp-proc nil)
7478
7473
(set-process-filter tcp-proc filter)
7479
7474
(cons tcp-proc proc)))
7480
- :test? (lambda () (executable-find (cl-first (funcall command-fn 0) )))))
7475
+ :test? (lambda () (lsp-server-present? (funcall command-fn 0)))))
7481
7476
7482
7477
(defalias 'lsp-tcp-server 'lsp-tcp-server-command)
7483
7478
@@ -7528,7 +7523,7 @@ should return the command to start the LS server."
7528
7523
(set-process-filter tcp-client-connection filter)
7529
7524
(set-process-sentinel tcp-client-connection sentinel)
7530
7525
(cons tcp-client-connection cmd-proc)))
7531
- :test? (lambda () (executable-find (cl-first (funcall command-fn 0) )))))
7526
+ :test? (lambda () (lsp-server-present? (funcall command-fn 0)))))
7532
7527
7533
7528
(defalias 'lsp-tramp-connection 'lsp-stdio-connection)
7534
7529
@@ -8062,7 +8057,7 @@ nil."
8062
8057
(if (and (f-absolute? path)
8063
8058
(f-exists? path))
8064
8059
path
8065
- (executable-find path))))
8060
+ (executable-find path t ))))
8066
8061
8067
8062
(defun lsp-package-path (dependency)
8068
8063
"Path to the DEPENDENCY each of the registered providers."
@@ -8095,7 +8090,8 @@ nil."
8095
8090
(f-join lsp-server-install-dir "npm" package
8096
8091
(cond ((eq system-type 'windows-nt) "")
8097
8092
(t "bin"))
8098
- path))))
8093
+ path)
8094
+ t)))
8099
8095
(unless (and path (f-exists? path))
8100
8096
(error "The package %s is not installed. Unable to find %s" package path))
8101
8097
path))
0 commit comments