aboutsummaryrefslogtreecommitdiff
path: root/editors/emacs
diff options
context:
space:
mode:
authorTomasKralCZ <[email protected]>2020-01-19 16:51:03 +0000
committerTomasKralCZ <[email protected]>2020-01-19 16:51:03 +0000
commit514df15d9e32e057ba23dda0d4f5c07e82e7ed23 (patch)
tree41e93f63182bae10a7325fc50220f67df79aaece /editors/emacs
parentc3b9a19eb72ae9542272ae7a22ac3fb57c75daca (diff)
parent3a7724e44181ccd5c248589538bd82458b5a9407 (diff)
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer
Diffstat (limited to 'editors/emacs')
-rw-r--r--editors/emacs/rust-analyzer.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/editors/emacs/rust-analyzer.el b/editors/emacs/rust-analyzer.el
index 8ba98bf61..06db4f15f 100644
--- a/editors/emacs/rust-analyzer.el
+++ b/editors/emacs/rust-analyzer.el
@@ -210,9 +210,9 @@
210;; inlay hints 210;; inlay hints
211(defun rust-analyzer--update-inlay-hints (buffer) 211(defun rust-analyzer--update-inlay-hints (buffer)
212 (if (and (rust-analyzer--initialized?) (eq buffer (current-buffer))) 212 (if (and (rust-analyzer--initialized?) (eq buffer (current-buffer)))
213 (lsp-send-request-async 213 (lsp-request-async
214 (lsp-make-request "rust-analyzer/inlayHints" 214 "rust-analyzer/inlayHints"
215 (list :textDocument (lsp--text-document-identifier))) 215 (list :textDocument (lsp--text-document-identifier))
216 (lambda (res) 216 (lambda (res)
217 (remove-overlays (point-min) (point-max) 'rust-analyzer--inlay-hint t) 217 (remove-overlays (point-min) (point-max) 'rust-analyzer--inlay-hint t)
218 (dolist (hint res) 218 (dolist (hint res)
@@ -221,9 +221,16 @@
221 (overlay (make-overlay beg end))) 221 (overlay (make-overlay beg end)))
222 (overlay-put overlay 'rust-analyzer--inlay-hint t) 222 (overlay-put overlay 'rust-analyzer--inlay-hint t)
223 (overlay-put overlay 'evaporate t) 223 (overlay-put overlay 'evaporate t)
224 (overlay-put overlay 'after-string (propertize (concat ": " label) 224 (cond
225 'font-lock-face 'font-lock-comment-face))))) 225 ((string= kind "TypeHint")
226 'tick)) 226 (overlay-put overlay 'after-string (propertize (concat ": " label)
227 'font-lock-face 'font-lock-comment-face)))
228 ((string= kind "ParameterHint")
229 (overlay-put overlay 'before-string (propertize (concat label ": ")
230 'font-lock-face 'font-lock-comment-face)))
231 )
232 )))
233 :mode 'tick))
227 nil) 234 nil)
228 235
229(defvar-local rust-analyzer--inlay-hints-timer nil) 236(defvar-local rust-analyzer--inlay-hints-timer nil)