Emacs: Check if lsp-ui was loaded
This commit is contained in:
parent
ceb2bb0d3c
commit
8a275aea95
@ -2261,27 +2261,10 @@ These help speed eglot up apparently [[https://www.reddit.com/r/emacs/comments/1
|
|||||||
(evil-global-set-key 'normal (kbd "SPC lD") #'consult-lsp-diagnostics)
|
(evil-global-set-key 'normal (kbd "SPC lD") #'consult-lsp-diagnostics)
|
||||||
(evil-global-set-key 'normal (kbd "SPC lf") #'consult-lsp-file-symbols))
|
(evil-global-set-key 'normal (kbd "SPC lf") #'consult-lsp-file-symbols))
|
||||||
|
|
||||||
;; This function allows us to extract Rust's true function signature
|
|
||||||
;; (cl-defmethod lsp-clients-extract-signature-on-hover (contents (_server-id (eql rust-analyzer)))
|
|
||||||
;; (-let* (((&hash "value") contents)
|
|
||||||
;; (groups (--partition-by (s-blank? it) (s-lines (s-trim value))))
|
|
||||||
;; (sig_group (if (s-equals? "```rust" (car (-third-item groups)))
|
|
||||||
;; (-third-item groups)
|
|
||||||
;; (car groups)))
|
|
||||||
;; (sig (--> sig_group
|
|
||||||
;; (--drop-while (s-equals? "```rust" it) it)
|
|
||||||
;; (--take-while (not (s-equals? "```" it)) it)
|
|
||||||
;; (--map (s-trim it) it)
|
|
||||||
;; (s-join " " it))))
|
|
||||||
;; (lsp--render-element (concat "```rust\n" sig "\n```")))
|
|
||||||
|
|
||||||
;; (require 'lsp-ui)
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Flycheck
|
*** Flycheck
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;; TODO Add wrapping to these functions
|
|
||||||
(require 'flycheck)
|
(require 'flycheck)
|
||||||
(setq flycheck-check-syntax-automatically '())
|
(setq flycheck-check-syntax-automatically '())
|
||||||
(setq flycheck-keymap-prefix (kbd "C-c e"))
|
(setq flycheck-keymap-prefix (kbd "C-c e"))
|
||||||
@ -2291,8 +2274,9 @@ These help speed eglot up apparently [[https://www.reddit.com/r/emacs/comments/1
|
|||||||
|
|
||||||
(defun joe/flycheck-clear ()
|
(defun joe/flycheck-clear ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(when (boundp 'lsp-ui)
|
||||||
(flycheck-clear)
|
(flycheck-clear)
|
||||||
(lsp-ui-sideline--erase))
|
(lsp-ui-sideline--erase)))
|
||||||
|
|
||||||
(add-hook 'after-save-hook #'joe/flycheck-clear)
|
(add-hook 'after-save-hook #'joe/flycheck-clear)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user