@@ -4584,23 +4584,23 @@ SESSION is the currently active session. The function will also
4584
4584
pick only remote enabled clients in case the FILE-NAME is on
4585
4585
remote machine and vice versa."
4586
4586
(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) )))))
4595
4595
(lsp-log "Found the following clients for %s: %s"
4596
4596
file-name
4597
4597
(s-join ", "
4598
4598
(-map (lambda (client)
4599
4599
(format "(server-id %s, priority %s)"
4600
4600
(lsp--client-server-id client)
4601
4601
(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 ))
4604
4604
(selected-clients (if-let (main-client (and main-clients
4605
4605
(--max-by (> (lsp--client-priority it)
4606
4606
(lsp--client-priority other))
0 commit comments