File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 38
38
39
39
(defconst rust-analyzer--action-handlers
40
40
'((" rust-analyzer.applySourceChange" .
41
- (lambda (p ) (rust-analyzer--apply-source-change-command p)))))
41
+ (lambda (p ) (rust-analyzer--apply-source-change-command p)))
42
+ (" rust-analyzer.selectAndApplySourceChange" .
43
+ (lambda (p ) (rust-analyzer--select-and-apply-source-change-command p)))))
42
44
43
45
(defun rust-analyzer--uri-filename (text-document )
44
46
(lsp--uri-to-path (gethash " uri" text-document)))
71
73
(let ((data (-> p (ht-get " arguments" ) (lsp-seq-first))))
72
74
(rust-analyzer--apply-source-change data)))
73
75
76
+ (defun rust-analyzer--select-and-apply-source-change-command (p )
77
+ (let* ((options (-> p (ht-get " arguments" ) (lsp-seq-first)))
78
+ (chosen-option (lsp--completing-read " Select option:" options
79
+ (-lambda ((&hash " label" )) label))))
80
+ (rust-analyzer--apply-source-change chosen-option)))
81
+
74
82
(lsp-register-client
75
83
(make-lsp-client
76
84
:new-connection (lsp-stdio-connection (lambda () rust-analyzer-command))
You can’t perform that action at this time.
0 commit comments