feat(clojure): improve default variables when +lsp
This commit is contained in:
parent
ffe8226a5c
commit
d9e66630b5
2 changed files with 22 additions and 7 deletions
|
@ -47,9 +47,10 @@
|
||||||
(add-transient-hook! #'cider-stacktrace-render-cause (cider--stacktrace-adapt-to-theme))
|
(add-transient-hook! #'cider-stacktrace-render-cause (cider--stacktrace-adapt-to-theme))
|
||||||
:config
|
:config
|
||||||
(add-hook 'cider-mode-hook #'eldoc-mode)
|
(add-hook 'cider-mode-hook #'eldoc-mode)
|
||||||
(set-lookup-handlers! '(cider-mode cider-repl-mode)
|
(unless (featurep! +lsp)
|
||||||
:definition #'+clojure-cider-lookup-definition
|
(set-lookup-handlers! '(cider-mode cider-repl-mode)
|
||||||
:documentation #'cider-doc)
|
:definition #'+clojure-cider-lookup-definition
|
||||||
|
:documentation #'cider-doc))
|
||||||
(set-popup-rules!
|
(set-popup-rules!
|
||||||
'(("^\\*cider-error*" :ignore t)
|
'(("^\\*cider-error*" :ignore t)
|
||||||
("^\\*cider-repl" :quit nil :ttl nil)
|
("^\\*cider-repl" :quit nil :ttl nil)
|
||||||
|
@ -80,6 +81,14 @@
|
||||||
;; See https://github.com/clojure-emacs/cider/issues/1872
|
;; See https://github.com/clojure-emacs/cider/issues/1872
|
||||||
cider-repl-pop-to-buffer-on-connect 'display-only)
|
cider-repl-pop-to-buffer-on-connect 'display-only)
|
||||||
|
|
||||||
|
(when (featurep! +lsp)
|
||||||
|
(setq cider-eldoc-display-for-symbol-at-point nil
|
||||||
|
cider-font-lock-dynamically nil)
|
||||||
|
(add-hook! 'cider-mode-hook
|
||||||
|
(defun +clojure--cider-disable-completion ()
|
||||||
|
"Use lsp completion instead of cider."
|
||||||
|
(remove-hook 'completion-at-point-functions #'cider-complete-at-point))))
|
||||||
|
|
||||||
;; Error messages emitted from CIDER is silently funneled into *nrepl-server*
|
;; Error messages emitted from CIDER is silently funneled into *nrepl-server*
|
||||||
;; rather than the *cider-repl* buffer. How silly. We might want to see that
|
;; rather than the *cider-repl* buffer. How silly. We might want to see that
|
||||||
;; stuff and who's going to check *nrepl-server* on every startup? I've got a
|
;; stuff and who's going to check *nrepl-server* on every startup? I've got a
|
||||||
|
@ -234,13 +243,18 @@
|
||||||
(use-package! clj-refactor
|
(use-package! clj-refactor
|
||||||
:hook (clojure-mode . clj-refactor-mode)
|
:hook (clojure-mode . clj-refactor-mode)
|
||||||
:config
|
:config
|
||||||
(set-lookup-handlers! 'clj-refactor-mode
|
(unless (featurep! +lsp)
|
||||||
:references #'cljr-find-usages)
|
(set-lookup-handlers! 'clj-refactor-mode
|
||||||
|
:references #'cljr-find-usages))
|
||||||
|
(when (featurep! +lsp)
|
||||||
|
(setq cljr-add-ns-to-blank-clj-files nil))
|
||||||
(map! :map clojure-mode-map
|
(map! :map clojure-mode-map
|
||||||
:localleader
|
:localleader
|
||||||
:desc "refactor" "R" #'hydra-cljr-help-menu/body))
|
:desc "refactor" "R" #'hydra-cljr-help-menu/body))
|
||||||
|
|
||||||
|
|
||||||
|
;; clojure-lsp already uses clj-kondo under the hood
|
||||||
(use-package! flycheck-clj-kondo
|
(use-package! flycheck-clj-kondo
|
||||||
:when (featurep! :checkers syntax)
|
:when (and (featurep! :checkers syntax)
|
||||||
|
(not (featurep! +lsp)))
|
||||||
:after flycheck)
|
:after flycheck)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||||
;;; lang/clojure/doctor.el
|
;;; lang/clojure/doctor.el
|
||||||
|
|
||||||
(when (featurep! :checkers syntax)
|
(when (and (featurep! :checkers syntax)
|
||||||
|
(not (featurep! +lsp)))
|
||||||
(unless (executable-find "clj-kondo")
|
(unless (executable-find "clj-kondo")
|
||||||
(warn! "Couldn't find clj-kondo. flycheck-clj-kondo will not work.")))
|
(warn! "Couldn't find clj-kondo. flycheck-clj-kondo will not work.")))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue