|
29 | 29 | (require 'f) |
30 | 30 | (require 'tree-widget) |
31 | 31 | (require 'request) |
| 32 | +(require 'cl-lib) |
32 | 33 |
|
33 | 34 | (defgroup lsp-java nil |
34 | 35 | "JDT emacs frontend." |
@@ -560,10 +561,10 @@ NOT-FOUND-MESSAGE will be used if there is no matching action." |
560 | 561 | (let ((actions (cl-remove-if-not |
561 | 562 | (lambda (item) (string-match regexp (gethash "title" item))) |
562 | 563 | (lsp-get-or-calculate-code-actions)))) |
563 | | - (case (length actions) |
| 564 | + (pcase (length actions) |
564 | 565 | (0 (error (or not-found-message "Unable to find action"))) |
565 | 566 | (1 (lsp-execute-code-action (car actions))) |
566 | | - (t (lsp-execute-code-action (lsp--select-action actions)))))) |
| 567 | + (_ (lsp-execute-code-action (lsp--select-action actions)))))) |
567 | 568 |
|
568 | 569 | (defun lsp-java-extract-to-local-variable (arg) |
569 | 570 | "Extract local variable refactoring. |
@@ -844,13 +845,13 @@ PROJECT-URI uri of the item." |
844 | 845 |
|
845 | 846 | (cl-defmethod lsp-execute-command |
846 | 847 | ((_server (eql jdtls)) (command (eql java.show.references)) params) |
847 | | - (if-let (refs (third params)) |
| 848 | + (if-let (refs (cl-third params)) |
848 | 849 | (xref--show-xrefs (lsp--locations-to-xref-items refs) nil) |
849 | 850 | (user-error "No references"))) |
850 | 851 |
|
851 | 852 | (cl-defmethod lsp-execute-command |
852 | 853 | ((_server (eql jdtls)) (command (eql java.show.implementations)) params) |
853 | | - (if-let (refs (third params)) |
| 854 | + (if-let (refs (cl-third params)) |
854 | 855 | (xref--show-xrefs (lsp--locations-to-xref-items refs) nil) |
855 | 856 | (user-error "No implementations"))) |
856 | 857 |
|
@@ -897,10 +898,10 @@ PROJECT-URI uri of the item." |
897 | 898 | :headers '(("Accept" . "application/vnd.initializr.v2.1+json")) |
898 | 899 | :success (cl-function |
899 | 900 | (lambda (&key data &allow-other-keys) |
900 | | - (flet ((ask (message key) (alist-get 'id |
901 | | - (lsp--completing-read message |
902 | | - (alist-get 'values (alist-get key data)) |
903 | | - (-partial 'alist-get 'name))))) |
| 901 | + (cl-flet ((ask (message key) (alist-get 'id |
| 902 | + (lsp--completing-read message |
| 903 | + (alist-get 'values (alist-get key data)) |
| 904 | + (-partial 'alist-get 'name))))) |
904 | 905 | (condition-case _err |
905 | 906 | (-let* ((group-id (read-string "Enter group name: " "com.example")) |
906 | 907 | (artifact-id (read-string "Enter artifactId: " "demo")) |
@@ -934,7 +935,7 @@ PROJECT-URI uri of the item." |
934 | 935 | rest)) |
935 | 936 | (if (-contains? deps dep) |
936 | 937 | (setq deps (remove dep deps)) |
937 | | - (pushnew dep deps))) |
| 938 | + (cl-pushnew dep deps))) |
938 | 939 | (let ((download-url (format "%sstarter.zip?type=%s&language=%s&groupId=%s&artifactId=%s&packaging=%s&bootVersion=%s&baseDir=%s&dependencies=%s" |
939 | 940 | base-url type language group-id artifact-id packaging boot-version artifact-id (s-join "," deps)))) |
940 | 941 | (message "Downloading template from %s" download-url) |
|
0 commit comments