Skip to content

Commit 1d388e0

Browse files
committed
Convert --when-let to -when-let in lsp--find-clients
1 parent 9951059 commit 1d388e0

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lsp-mode.el

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4584,23 +4584,23 @@ SESSION is the currently active session. The function will also
45844584
pick only remote enabled clients in case the FILE-NAME is on
45854585
remote machine and vice versa."
45864586
(let ((remote? (file-remote-p file-name)))
4587-
(--when-let (->> lsp-clients
4588-
hash-table-values
4589-
(-filter (-lambda (client)
4590-
(and (or (-some-> client lsp--client-activation-fn (funcall buffer-file-name buffer-major-mode))
4591-
(and (not (lsp--client-activation-fn client))
4592-
(-contains? (lsp--client-major-modes client) buffer-major-mode)
4593-
(eq (---truthy? remote?) (---truthy? (lsp--client-remote? client)))))
4594-
(-some-> client lsp--client-new-connection (plist-get :test?) funcall)))))
4587+
(-when-let (matching-clients (->> lsp-clients
4588+
hash-table-values
4589+
(-filter (-lambda (client)
4590+
(and (or (-some-> client lsp--client-activation-fn (funcall buffer-file-name buffer-major-mode))
4591+
(and (not (lsp--client-activation-fn client))
4592+
(-contains? (lsp--client-major-modes client) buffer-major-mode)
4593+
(eq (---truthy? remote?) (---truthy? (lsp--client-remote? client)))))
4594+
(-some-> client lsp--client-new-connection (plist-get :test?) funcall))))))
45954595
(lsp-log "Found the following clients for %s: %s"
45964596
file-name
45974597
(s-join ", "
45984598
(-map (lambda (client)
45994599
(format "(server-id %s, priority %s)"
46004600
(lsp--client-server-id client)
46014601
(lsp--client-priority client)))
4602-
it)))
4603-
(-let* (((add-on-clients main-clients) (-separate 'lsp--client-add-on? it))
4602+
matching-clients)))
4603+
(-let* (((add-on-clients main-clients) (-separate 'lsp--client-add-on? matching-clients))
46044604
(selected-clients (if-let (main-client (and main-clients
46054605
(--max-by (> (lsp--client-priority it)
46064606
(lsp--client-priority other))

0 commit comments

Comments
 (0)