Fork me on GitHub
#calva
<
2020-08-13
>
Jack Arrington12:08:38

Any way to toggle cljs-kondo off? It's super helpful (thanks @borkdude :)) but I personally find it distracting to have a linter running when I'm just trying to hash out an idea. If there's some way to bind it to a shortcut for flipping it on/off that would be swell

borkdude12:08:48

I think you can just disable the extension?

pez12:08:25

File that as an issue on the clj-kondo extension repo, I think it is a good idea. Disabling the extension is not accessible enough, imo.

pez12:08:18

There might be some other extension that allows for switching in and out files. Maybe investigate that first and we can write about it in the Calva docs.

pez12:08:15

That would be more general since then one could have different configs to toggle between.

borkdude12:08:20

What is not accessible about disabling the extension?

borkdude12:08:51

I'm going to say that in the issue as well, so you might save yourself some energy ;)

Jack Arrington12:08:46

I don't if there's a way to configure disabling/enabling the extension to a keyboard shortcut or command palette command, which is what I'd like to do. I don't want to turn off clj-kondo completely, just enable/disable it at will. But I am Sublime Text refugee and don't know my way around VSCode very well yet, so @pez can fill us in if there's some way to do that

borkdude12:08:52

Ah, if you try to disable it, VSCode complains about Calva. But you can disable all plugins with a shortcut I think

pez12:08:52

This is a misconfiguration in Calva. Fixed in the dev version.

borkdude12:08:28

Could you enlighten me what the fix was?

pez12:08:33

Removing an extension dependency on your extension. It should just be bundled.

borkdude13:08:07

Ah, gotcha.

borkdude12:08:11

Well, in that case a shortcut might be justified. Make an issue in the repo

borkdude12:08:31

@mail985 An alternative: is it only one buffer at a time you'd like to do this?

borkdude12:08:49

Then you might do it via namespace local config

borkdude12:08:59

or disable everything in .clj-kondo/config.edn

borkdude12:08:22

with ^:replace {:linters {}}

borkdude13:08:28

OK, @pez informed me that clj-kondo can be disabled in a future version of Calva

pez13:08:08

So that config thing was what I meant with maybe see if some other extension can help with it. Switching in and out .clj-kondo/config.edn variants….

borkdude13:08:48

Btw, since Calva is using clj-kondo as a JVM dependency as well, I think I wouldn't mind if Calva absorbed the clj-kondo LSP server in its own plugin, so it can also be made as a service for other things than diagnostics

borkdude13:08:19

clojure-lsp is now also absorbing/using clj-kondo as a lib

pez13:08:55

Maybe we should absorb clojure-lsp as a lib.

borkdude13:08:05

That would be even more major

pez13:08:29

Absorbing it as an LSP server was too crazy anyway. 😃

borkdude13:08:52

I mean: Calva starts the LSP server, without relying on another extension

borkdude13:08:16

and then you can hack the LSP server any way you want, hook it to commands to do analysis, etc

borkdude13:08:41

e.g.: no need for a REPL to navigate or autocomplete (see anakondo for emacs)

pez13:08:38

Yeah, that’s what the clojure-lsp PR-WIP was about. Going static and then enhance things with the REPL.

bringe16:08:14

Yeah, definitely want to do that in the (maybe near?) future ^

alpox16:08:13

I created a fresh project with lein new luminus +swagger and tried to jack-in from vscode but ended up with this error message: did someone come accross this one yet?

pez16:08:20

Not seen it. Does things still work after it happens?

alpox16:08:46

No, it kinda got stuck there 🙂

alpox16:08:04

It was a simple Leiningen jack-in attempt

alpox16:08:26

I'll try again with a new setup and maybe once again without +swagger

pez16:08:27

Very strange. I'll try the same template and see what happens. (But a bit later, I have to run here.)

alpox16:08:31

Sadly the error message didn't tell me much

alpox16:08:55

Yea, tried fresh with the same - happened again. Now I'll try without +swagger

pez16:08:55

It seems to say that Calva does something wrong. But it is strange...

alpox16:08:45

Happens with a new lein new luminus <projectname> too 😞

pez16:08:46

I don't think you are doing anything wrong. It is extra strange because I've worked a bit with making things smooth with Luminus. See https://calva.io/luminus/

alpox16:08:02

I'll give it a look 🙂 thanks for the reference

alpox16:08:23

Just to go totally sure I tried lein new app <projectname> that one works 😄

alpox16:08:55

Hmm interesting... I got a totally different choice of project types than you in the editor. I wonder where they are taken from?

alpox17:08:12

@pez Ah... bollocks... luminus released template version 3.84 yesterday. 3.83 worked, 3.84 not anymore... The only mentionable change is the upgrade of luminus-http-kit from 0.1.7 to 0.1.8 Changes: https://github.com/luminus-framework/luminus-http-kit/commit/94c799023bccdbc1469b8afec45bc92a988b9ece

alpox17:08:12

@pez Ah... bollocks... luminus released template version 3.84 yesterday. 3.83 worked, 3.84 not anymore... The only mentionable change is the upgrade of luminus-http-kit from 0.1.7 to 0.1.8 Changes: https://github.com/luminus-framework/luminus-http-kit/commit/94c799023bccdbc1469b8afec45bc92a988b9ece

pez18:08:47

Thanks for reporting back! Let's holler at @U050CBXUZ, and wee if he can shed some light on this (pun intended).

yogthos18:08:27

but I don't tend to use http-kit myself, so if that's not correct I'm open to changing that

pez19:08:22

Calva is using pretty ancient cider-nrepl versions. I wonder if that could be the issue... What you say, @U051BLM8F?

alpox19:08:49

I had a little hunch - @U050CBXUZ http-kit change is not the problem. The update of nrepl from 0.7.0 to 0.8.0 is. I was first not sure if that change made it in the 3.84 release but it seems it did. Downgrading nrepl to 0.7.0 fixes this error.

pez20:08:09

But if you use jack-in, then Calva should inject version 0.6.0, and I thought that would override any project setting...

alpox20:08:20

Hmmm thats weird... cause I only change [nrepl "0.8.0"] to [nrepl "0.7.0"] in project.clj and it works

alpox20:08:20

Also, it doesn't work when triggering the command from the command line directly. It works however if I remove this part: -- update-in :plugins conj '[cider/cider-nrepl"0.23.0"]'

pez21:08:39

We should pobably add a calva-jack-in option to the Luminus template. Which doesn't add the editor dependencies to the project.

yogthos21:08:56

interesting, I'm open to roll back nrepl for now if that'd help, but would be nice to get things working with the latest

bozhidar17:08:44

I'm guessing very old versions of cider-nrepl would not work on newer nREPL, but without seeing some more error details it's hard to say.

bozhidar17:08:34

So far only one issue has been discovered in nREPL 0.8 itself - https://github.com/nrepl/nrepl/issues/206 (but I doubt that's related to your problem)

esp118:08:57

How do I navigate history in the Calva output.repl-file window? Alt+Up/Down doesn’t work - it’s moving the text line at the cursor up or down instead (Calva 2.0.119)

pez18:08:00

@esp1 it is being worked on. See some messages above, where @brandon.ringe is asking for help testing hit. ❤️

esp118:08:19

ok cool thanks!

bringe22:08:06

Still ironing out some things with the last vsix I posted, but will post another soon.

👍 1
bringe23:08:04

A fresh new cut of the repl history is ready for testing: https://7555-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.120-fix-740-allow-default-esc-keybind-feature-add-repl-history-e83cb315.vsix In this version: • alt+up/down should only traverse history if the cursor is past the last content in the doc (ignoring whitespace), otherwise these shortcuts map to what they were before, default is move line up/down • If you start typing some test and then start traversing up the history, that text will be there when you traverse back down the history (though it's not saved to history unless evaluated) • If, while traversing the history, you make an edit to a history entry and then keep traversing the history, the edit will be saved in history @esp1 @glebovmaksim and anyone else, testing is appreciated

metal 2
1
bringe23:08:04

A fresh new cut of the repl history is ready for testing: https://7555-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.120-fix-740-allow-default-esc-keybind-feature-add-repl-history-e83cb315.vsix In this version: • alt+up/down should only traverse history if the cursor is past the last content in the doc (ignoring whitespace), otherwise these shortcuts map to what they were before, default is move line up/down • If you start typing some test and then start traversing up the history, that text will be there when you traverse back down the history (though it's not saved to history unless evaluated) • If, while traversing the history, you make an edit to a history entry and then keep traversing the history, the edit will be saved in history @esp1 @glebovmaksim and anyone else, testing is appreciated

metal 2
1
esp123:08:46

great, will try it out! thx!

💯 2
Cris B01:08:49

I'm not really the audience for this as I don't use the REPL prompt much, but this is shaping up nicely.

👍 1
bringe02:08:18

Thanks, I don't either 😄

esp105:08:09

@brandon.ringe thanks so much for this, this makes a huge difference to the usability of the repl!

esp105:08:24

this is working really well for me

esp105:08:13

the one issue i found is when editing a multiline form, alt+down works to move a line down, but alt+up doesn’t work to move a line up.

esp105:08:14

personally tho i’d actually rather alt+up/down always move up/down through history if you’re editing anywhere in the last form.

pez13:08:49

That’s me who has strong opinions to the contrary. I want the editing to be as close to the usual files as it possibly can.

bringe16:08:17

Yeah, I had it that way before 😄

bringe16:08:05

I'll check on that difference you mentioned with up/down

bringe16:08:00

Yeah I normally don't use move line up/down when editing clojure, but @pez does, so this effects his editing of the last form, and I imagine some other users do this too.

bringe16:08:49

A quick page-down, alt+up works though if you're in the last form and not after it

pez16:08:46

Hey, are you outing me as a non-structural heretic! 😃 Haha, yes, I must plead guilty as charged in this case.

😆 1
bringe16:08:51

@esp1 For me, alt+up works to move a line up in a multi-line form. If you can capture maybe a gif and create an issue of your scenario, that would be helpful.

pez16:08:52

There might be a slight bias on my part to it, but really, this is about keeping the editing as regular-file-like as possible. Not just on principle, we have seen where the path of a special REPL editor leads...

pez16:08:40

Sweet gif! Bound to cause a heart attack on some structural purists. 😃

😂 1
bringe16:08:54

I agree, this way makes it more friendly to everyone I think, since you can quickly jump to the end of the form to navigate up in history, and once you navigate, the cursor will be after the form anyway

esp120:08:16

Here’s what I’m seeing:

bringe22:08:18

No idea why this is happening for you :thinking_face: . What OS?

bringe22:08:31

Does move line up work above the prompt for you? And in other files?

bringe22:08:10

@pez do you experience this on Mac?

esp122:08:20

I’m on macOS Catalina 10.15.5

pez06:08:48

On my machine (Catalina 10.15.2) it works exactly as advertised.

👍 1
pez06:08:30

Does alt+up/down work in other files for you, @esp1?

esp118:08:21

FYI I tracked this down to a spurious user keybinding. I removed it and all is working well. Thanks!