Skip to content

Commit 620bbd7

Browse files
authored
fix: remove obsoleted if/when-let and shadowed dynamic variable (#4612)
1 parent 9509148 commit 620bbd7

33 files changed

+127
-121
lines changed

clients/lsp-autotools.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
makefile-bsdmake-mode
4242
makefile-imake-mode)
4343
"List of major mode that work with Autotools."
44-
:type 'list
44+
:type '(list symbol)
4545
:group 'lsp-autotools)
4646

4747
(defun lsp-autotools--download-server (_client callback error-callback update?)

clients/lsp-awk.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"Command to run the AWK language server."
3737
:group 'lsp-awk
3838
:risky t
39-
:type 'list)
39+
:type '(list string))
4040

4141
(lsp-register-client
4242
(make-lsp-client

clients/lsp-camel.el

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
;; Directory in which the servers will be installed. Lsp Server Install Dir: ~/.emacs.d/.cache/camells
2121
(defcustom lsp-camel-jar-file (f-join lsp-server-install-dir "camells" lsp-camel-jar-name)
2222
"Camel Language server jar command."
23-
:type 'string
2423
:group 'lsp-camel
2524
:type 'file
2625
:package-version '(lsp-mode . "9.0.0"))
@@ -36,7 +35,7 @@
3635
'camells
3736
'(:system lsp-camel-jar-file)
3837
`(:download :url lsp-camel-jar-download-url
39-
:store-path lsp-camel-jar-file))
38+
:store-path lsp-camel-jar-file))
4039

4140
(defcustom lsp-camel-server-command `("java" "-jar" , lsp-camel-jar-file)
4241
"Camel server command."
@@ -51,16 +50,16 @@
5150

5251
(lsp-register-client
5352
(make-lsp-client :new-connection (lsp-camel--create-connection)
54-
:activation-fn (lsp-activate-on "xml" "java")
55-
:priority 0
56-
:server-id 'camells
57-
:add-on? t
58-
:multi-root t
59-
:initialized-fn (lambda (workspace)
60-
(with-lsp-workspace workspace
61-
(lsp--set-configuration (lsp-configuration-section "camel"))))
62-
:download-server-fn (lambda (_client callback error-callback _update?)
63-
(lsp-package-ensure 'camells callback error-callback))))
53+
:activation-fn (lsp-activate-on "xml" "java")
54+
:priority 0
55+
:server-id 'camells
56+
:add-on? t
57+
:multi-root t
58+
:initialized-fn (lambda (workspace)
59+
(with-lsp-workspace workspace
60+
(lsp--set-configuration (lsp-configuration-section "camel"))))
61+
:download-server-fn (lambda (_client callback error-callback _update?)
62+
(lsp-package-ensure 'camells callback error-callback))))
6463

6564
(lsp-consistency-check lsp-camel)
6665

clients/lsp-clangd.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Information comes from the clang.llvm.org website."
168168
(url-retrieve (format
169169
"https://clang.llvm.org/extra/clang-tidy/checks/%s.html" error-id)
170170
(lambda (status)
171-
(if-let ((error-status (plist-get status :error)))
171+
(if-let* ((error-status (plist-get status :error)))
172172
(lsp-cpp-flycheck-clang-tidy--explain-error
173173
#'insert
174174
(format
@@ -185,7 +185,7 @@ Information comes from the clang.llvm.org website."
185185
"Explain a clang-tidy ERROR by scraping documentation from llvm.org."
186186
(unless (fboundp 'libxml-parse-html-region)
187187
(error "This function requires Emacs to be compiled with libxml2"))
188-
(if-let ((clang-tidy-error-id (flycheck-error-id error)))
188+
(if-let* ((clang-tidy-error-id (flycheck-error-id error)))
189189
(condition-case err
190190
(lsp-cpp-flycheck-clang-tidy--show-documentation clang-tidy-error-id)
191191
(error

clients/lsp-clojure.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
(expand-file-name "~/.gitlibs/libs"))
9595
"LSP clojure dirs that should be considered library folders."
9696
:group 'lsp-clojure
97-
:type 'list)
97+
:type '(list string))
9898

9999
(defcustom lsp-clojure-test-tree-position-params nil
100100
"The optional test tree position params.
@@ -434,7 +434,7 @@ Focus on it if IGNORE-FOCUS? is nil."
434434
NOTIFICATION is the test tree notification data received from server.
435435
It updates the test tree view data."
436436
(when (require 'lsp-treemacs nil t)
437-
(when-let (buffer (find-buffer-visiting (lsp--uri-to-path uri)))
437+
(when-let* ((buffer (find-buffer-visiting (lsp--uri-to-path uri))))
438438
(with-current-buffer buffer
439439
(setq lsp-clojure--test-tree-data notification)
440440
(when (get-buffer-window lsp-clojure--test-tree-buffer-name)
@@ -593,16 +593,16 @@ Focus on it if IGNORE-FOCUS? is nil."
593593
(let ((info (lsp-clojure-server-info-raw)))
594594
(save-match-data
595595
(when (functionp 'cider-connect-clj)
596-
(when-let (port (and (string-match "\"port\":\\([0-9]+\\)" info)
597-
(match-string 1 info)))
596+
(when-let* ((port (and (string-match "\"port\":\\([0-9]+\\)" info)
597+
(match-string 1 info))))
598598
(cider-connect-clj `(:host "localhost"
599599
:port ,port)))))))
600600

601601
;; Cider integration
602602

603603
(defun lsp-clojure-semantic-tokens-refresh (&rest _)
604604
"Force refresh semantic tokens."
605-
(when-let ((workspace (and lsp-semantic-tokens-enable
605+
(when-let* ((workspace (and lsp-semantic-tokens-enable
606606
(lsp-find-workspace 'clojure-lsp (buffer-file-name)))))
607607
(--each (lsp--workspace-buffers workspace)
608608
(when (lsp-buffer-live-p it)

clients/lsp-cobol.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ This is only for development use."
106106
(defun lsp-cobol-start-ls ()
107107
"Start the COBOL language service."
108108
(interactive)
109-
(when-let ((exe (lsp-cobol--executable))
109+
(when-let* ((exe (lsp-cobol--executable))
110110
((lsp--port-available "localhost" lsp-cobol-port)))
111111
(lsp-async-start-process #'ignore #'ignore exe)))
112112

clients/lsp-csharp.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ Returns :elements from omnisharp:CodeStructureResponse."
213213

214214
(defun lsp-csharp--code-element-stack-on-l-c (l c elements)
215215
"Return omnisharp:CodeElement stack at L (line) and C (column) in ELEMENTS tree."
216-
(when-let ((matching-element (seq-find (lambda (el)
216+
(when-let* ((matching-element (seq-find (lambda (el)
217217
(-when-let* (((&omnisharp:CodeElement :ranges) el)
218218
((&omnisharp:RangeList :full?) ranges))
219219
(lsp-csharp--l-c-within-range l c full?)))
@@ -266,7 +266,7 @@ PRESENT-BUFFER will make the buffer be presented to the user."
266266

267267
(defun lsp-csharp--test-message (message)
268268
"Emit a MESSAGE to lsp-csharp test run buffer."
269-
(when-let ((existing-buffer (get-buffer lsp-csharp-test-run-buffer-name))
269+
(when-let* ((existing-buffer (get-buffer lsp-csharp-test-run-buffer-name))
270270
(inhibit-read-only t))
271271
(with-current-buffer existing-buffer
272272
(save-excursion
@@ -309,7 +309,7 @@ PRESENT-BUFFER will make the buffer be presented to the user."
309309
(defun lsp-csharp-run-last-tests ()
310310
"Re-run test(s) that were run last time."
311311
(interactive)
312-
(if-let ((last-test-method-framework (lsp-session-get-metadata "last-test-method-framework"))
312+
(if-let* ((last-test-method-framework (lsp-session-get-metadata "last-test-method-framework"))
313313
(last-test-method-names (lsp-session-get-metadata "last-test-method-names")))
314314
(lsp-csharp--start-tests last-test-method-framework last-test-method-names)
315315
(message "lsp-csharp: No test method(s) found to be ran previously on this workspace")))
@@ -430,7 +430,7 @@ See https://github.com/OmniSharp/omnisharp-roslyn/wiki/Configuration-Options"
430430
(when lsp-csharp-solution-file
431431
(list "-s" (expand-file-name lsp-csharp-solution-file)))))
432432
#'(lambda ()
433-
(when-let ((binary (lsp-csharp--language-server-path)))
433+
(when-let* ((binary (lsp-csharp--language-server-path)))
434434
(f-exists? binary))))
435435
:activation-fn (lsp-activate-on "csharp")
436436
:server-id 'omnisharp

clients/lsp-cucumber.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This is only for development use."
4141
(defcustom lsp-cucumber-active-modes
4242
'( feature-mode)
4343
"List of major mode that work with Cucumber language server."
44-
:type 'list
44+
:type '(list symbol)
4545
:group 'lsp-cucumber)
4646

4747
(lsp-defcustom lsp-cucumber-features

clients/lsp-eslint.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ stored."
243243

244244
(defun lsp--find-eslint ()
245245
(or
246-
(when-let ((workspace-folder (lsp-find-session-folder (lsp-session) default-directory)))
246+
(when-let* ((workspace-folder (lsp-find-session-folder (lsp-session) default-directory)))
247247
(let ((eslint-local-path (f-join workspace-folder "node_modules" ".bin"
248248
(if (eq system-type 'windows-nt) "eslint.cmd" "eslint"))))
249249
(when (f-exists? eslint-local-path)
@@ -374,7 +374,7 @@ to allow or deny it.")
374374
(setq lsp-eslint--stored-libraries (lsp--read-from-file lsp-eslint-library-choices-file)))
375375

376376
(lsp-defun lsp-eslint--confirm-local (_workspace (&eslint:ConfirmExecutionParams :library-path) callback)
377-
(if-let ((option-alist '(("Always" 4 . t)
377+
(if-let* ((option-alist '(("Always" 4 . t)
378378
("Yes" 4 . nil)
379379
("No" 1 . nil)
380380
("Never" 1 . t)))

clients/lsp-glsl.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"Command to run the GLSL language server."
3737
:group 'lsp-glsl
3838
:risky t
39-
:type 'list)
39+
:type '(list string))
4040

4141
(lsp-register-client
4242
(make-lsp-client

0 commit comments

Comments
 (0)