aboutsummaryrefslogtreecommitdiff
path: root/editors/emacs
diff options
context:
space:
mode:
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)