aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-03-14 21:08:37 +0000
committerFlorian Diebold <[email protected]>2019-03-14 21:08:37 +0000
commitc656bf3946268d9d0b87174af6e26d32075dfe01 (patch)
tree8e3b8a3755760de22c6b4f3c003e814a813cf212
parenteb4d6cf25f9ba886f4aa8ee46149af2807baae7f (diff)
Fix ra-emacs-lsp for newest lsp-mode with native json support
-rw-r--r--editors/emacs/ra-emacs-lsp.el9
1 files changed, 4 insertions, 5 deletions
diff --git a/editors/emacs/ra-emacs-lsp.el b/editors/emacs/ra-emacs-lsp.el
index 780182f8a..955703edb 100644
--- a/editors/emacs/ra-emacs-lsp.el
+++ b/editors/emacs/ra-emacs-lsp.el
@@ -58,17 +58,16 @@
58 58
59(defun rust-analyzer--apply-source-change (data) 59(defun rust-analyzer--apply-source-change (data)
60 ;; TODO fileSystemEdits 60 ;; TODO fileSystemEdits
61 (--each (-> data (ht-get "workspaceEdit") (ht-get "documentChanges")) 61 (seq-doseq (it (-> data (ht-get "workspaceEdit") (ht-get "documentChanges")))
62 (rust-analyzer--apply-text-document-edit it)) 62 (rust-analyzer--apply-text-document-edit it))
63 (-when-let (cursor-position (ht-get data "cursorPosition")) 63 (-when-let (cursor-position (ht-get data "cursorPosition"))
64 (let ((filename (rust-analyzer--uri-filename (ht-get cursor-position "textDocument"))) 64 (let ((filename (rust-analyzer--uri-filename (ht-get cursor-position "textDocument")))
65 (position (ht-get cursor-position "position"))) 65 (position (ht-get cursor-position "position")))
66 (find-file filename) 66 (find-file filename)
67 (rust-analyzer--goto-lsp-loc position) 67 (rust-analyzer--goto-lsp-loc position))))
68 )))
69 68
70(defun rust-analyzer--apply-source-change-command (p) 69(defun rust-analyzer--apply-source-change-command (p)
71 (let ((data (-> p (ht-get "arguments") (car)))) 70 (let ((data (-> p (ht-get "arguments") (seq-first))))
72 (rust-analyzer--apply-source-change data))) 71 (rust-analyzer--apply-source-change data)))
73 72
74(lsp-register-client 73(lsp-register-client
@@ -126,7 +125,7 @@
126 "rust-analyzer/extendSelection" 125 "rust-analyzer/extendSelection"
127 (rust-analyzer--extend-selection-params))) 126 (rust-analyzer--extend-selection-params)))
128 (ht-get "selections") 127 (ht-get "selections")
129 (car))) 128 (seq-first)))
130 129
131(defun rust-analyzer--add-er-expansion () 130(defun rust-analyzer--add-er-expansion ()
132 (make-variable-buffer-local 'er/try-expand-list) 131 (make-variable-buffer-local 'er/try-expand-list)