Fork me on GitHub
#emacs
<
2022-01-23
>
Ted Ciafardini02:01:38

With Cider - I utilize these two functions primarily:

'cider-eval-defun-at-point
 'cider-pprint-eval-defun-at-point

Ted Ciafardini02:01:21

Sometimes, the focus automatically jumps into the output buffer. Is there a setting or variable I can set that disables this shift of focus?

Ted Ciafardini02:01:52

More cider config:

(setq cider-interactive-eval-output-destination 'output-buffer)
(setq cider-redirect-server-output-to-repl nil)
(setq clojure-toplevel-inside-comment-form t)
(setq cider-repl-pop-to-buffer-on-connect nil)

dpsutton02:01:22

do you send forms to the repl often? the cider-insert-X style functions?

dpsutton02:01:50

if so, that automatically highlights the repl buffer. There's a defcustom to prevent that

Ted Ciafardini02:01:16

no, I prefer to keep things out of the REPL buffer -

Ted Ciafardini02:01:34

most of the time the two fns listed above work fine - but it will randomly hop me over into the output buffer upon eval

dpsutton03:01:56

Then no idea sorry. That was the one thing I could think of that puts you in the repl buffer

ericdallo10:01:21

I think doom-emacs does that by default @edward.ciafardini,.maybe debug what they change

diego.videco17:01:37

I am trying to setup clojure-lsp to use some of it’s feature. But I am getting a conflict with cider , where the arity information that appears at the buttom of the screen gets substituted by and error about the arity of the function bein incomplete. I don’t know how to disable this as it is much less useful than displaying the arity of the function. Any ideas? This I my setting at the moment (I knoew they look messy :S)

(add-hook 'clojure-mode-hook 'lsp)
(add-hook 'clojurescript-mode-hook 'lsp)
(add-hook 'clojurec-mode-hook 'lsp)

(setq gc-cons-threshold (* 100 1024 1024)
      read-process-output-max (* 1024 1024)
      treemacs-space-between-root-nodes nil
      company-minimum-prefix-length 1
      lsp-enable-on-type-formatting nil

      ;; lsp-enable-indentation nil ; uncomment to use cider indentation instead of lsp
      ;; lsp-enable-completion-at-point nil ; uncomment to use cider completion instead of lsp
      )

(setq lsp-lens-enable t)
(setq lsp-signature-mode nil)
(setq lsp-ui-mode nil)
(setq lsp-ui-doc-show-with-cursor nil)
(setq lsp-headerline-breadcrumb-enable nil)
(setq lsp-ui-sideline-enable nil)
(setq lsp-modeline-code-actions-enable nil)
(setq lsp-signature-render-documentation nil)
(setq lsp-signature-auto-activate nil)
(setq lsp-completion-enable nil)
(setq lsp-eldoc-enable-hover nil)

ericdallo18:01:30

yes, let me find the config to use LSP only on that feature

ericdallo18:01:49

This should disable cider eldoc integration to use lsp only:

(setq cider-eldoc-display-for-symbol-at-point nil) ; use lsp

ericdallo18:01:44

and you probably want to enable lsp-eldoc-enable-hover to show the arity of the functions on the bottom

ericdallo18:01:43

Also, I personally like to enable the lsp-modeline-code-actions-enable as the UI change is minimal and very useful to know if there is a code action available on that line

diego.videco18:01:12

Still getting the same arity error displayed on the minibuffer

diego.videco18:01:55

The arity information pops for a second before being replaced by the error message.

ericdallo18:01:11

hum, sounds like a cider feature that I'm not aware of, maybe cider-eldoc-display-context-dependent-info ? try disabling that one

ericdallo18:01:38

also, not sure if cider check that variable only at start, try restarting emacs

diego.videco18:01:44

Actually even when cider is not running I get this error

diego.videco18:01:02

I am using prelude with some custom configurations of my own

ericdallo18:01:38

hum, so maybe it's another package using eldoc :thinking_face:

vemv18:01:21

Cider doesn't add any such linting as eldoc hints, has to be something else

ericdallo18:01:41

yeah, never saw that message on eldoc from cider indeed

ericdallo18:01:24

didn't notice but it's clj-kondo lint stuff but on bottom indeed

ericdallo18:01:47

maybe you don't have flycheck or have your emacs configured to show the diagnostics on the bottom

ericdallo18:01:59

do you have flycheck or flymake installed?

diego.videco18:01:01

yes, I have flycheck

ericdallo18:01:17

whats your lsp-diagnostics-provider ?

diego.videco18:01:04

where do I find that?

ericdallo18:01:28

try M-x describe-variable and type that variable

diego.videco18:01:06

it’s set to auto

ericdallo18:01:25

sounds correct

ericdallo18:01:21

what shows on flycheck-list-errors ? is flycheck-mode enabled on that buffer?

diego.videco18:01:02

if I disable it the error message goes away, and I can see the arity doc

ericdallo18:01:37

odd, so we need to understand why flycheck is showing it on the bottom and not on the buffer

diego.videco18:01:25

does this look right?

ericdallo18:01:21

hum, maybe that lint is from those custom clj-kondo flycheck runners, I'd suggest disabling (or even uninstalling) both clj-kondo-* to check if the issue is fixed

diego.videco18:01:21

but this did

(require 'flycheck)
(setq flycheck-display-errors-function nil)

diego.videco18:01:30

should that be right?

diego.videco18:01:21

I still see the errors with flycheck-list-errors so I suppose that should be fine

ericdallo19:01:43

yes, it should show on flycheck-list-errors

ericdallo19:01:06

not sure, I use doom-emacs which enables all of this by default 😅

ericdallo19:01:12

but yeah, sounds good to me

diego.videco19:01:26

that’s probably why

diego.videco19:01:06

well, thanks for the help, pretty sure I would be getting nowhere without it

ericdallo19:01:32

glad you found it :)

ericdallo19:01:01

BTW, this is the only feature I like from lsp-ui :

diego.videco19:01:20

inlining the error?

ericdallo19:01:39

yeah, it prints the warnings/errors/info on the line when hovering the line: https://emacs-lsp.github.io/lsp-ui/#lsp-ui-sideline

👍 1