Fork me on GitHub
#releases
<
2022-01-12
>
borkdude12:01:04

clojure-extras v0.4.0 is out! IntelliJ plugin which builds on Cursive with clj-kondo, inline eval, and more.

🚀 2
Alex Miller (Clojure team)13:01:51

How do you actually use it to get clj-kondo linting? That page doesn't mention anything

borkdude13:01:17

It does so by default and you can turn it off under Tool settings

Alex Miller (Clojure team)13:01:18

I installed it and was able to keymap the inline eval

Alex Miller (Clojure team)13:01:30

and they show up in problems I guess?

borkdude13:01:38

they should appear inline in the code

borkdude13:01:50

Type (inc :foo) for example

borkdude13:01:19

but it may take a while before your project is fully set up in intellij due to indexing etc. it's only after cursive is fully started that the plugin will load, I think

borkdude13:01:41

@UQTHDKJ8J may be able to tell your more, he wrote the integration.

Alex Miller (Clojure team)13:01:13

ah, maybe it hadn't indexed yet when I tried it

borkdude13:01:55

note that this indexing has nothing to do with clj-kondo, but it just takes a while before everything launches I think

borkdude13:01:31

make sure to upgrade to 0.4.0 for the better performance

Alex Miller (Clojure team)13:01:43

I just did, not seeing any kondo stuff

borkdude13:01:20

just checking: you did try to provoke a lint warning, like with (inc :foo) ?

borkdude13:01:10

and what do you see under this settings panel?

Alex Miller (Clojure team)13:01:41

I see same under the tools panel, and get no warnings on code like that

borkdude13:01:28

what version of intellij? I'm using IntelliJ IDEA 2021.3.1 (Ultimate Edition) over here

borkdude13:01:41

and do you have Cursive installed?

Alex Miller (Clojure team)13:01:00

2021.2.3 and yes, latest Cursive

Alex Miller (Clojure team)13:01:30

Cursive 1.12.2-eap1-2021.2

borkdude13:01:02

I have 1.12.1-2021.3

Alex Miller (Clojure team)13:01:19

inline eval stuff works

borkdude13:01:21

My IntelliJ knowledge ends here, maybe upgrading helps, else I hope @UQTHDKJ8J will help :)

borkdude13:01:53

I'll try that one

Alex Miller (Clojure team)13:01:25

doesn't seem likely that matters here but dunno

borkdude14:01:55

still works here, after intellij was done scanning things

borkdude14:01:45

perhaps we can try to open the same project, if you're working on something open source

Alex Miller (Clojure team)14:01:55

I mean, I have a half dozen projects open, it doesn't work anywhere

borkdude14:01:54

@UQTHDKJ8J It seems that adding some logging (or whatever is appropriate for a plugin) could be helpful

Alex Miller (Clojure team)14:01:27

it's possible I have turned off whatever feature suggests things generally (I'm not entirely sure what that is called)

borkdude14:01:14

What do you see under problems? I see this.

Alex Miller (Clojure team)14:01:00

I don't see any clj-kondo problems

Alex Miller (Clojure team)14:01:12

no errors in the intellij log

Alex Miller (Clojure team)14:01:28

I tried restarting intellij again too

imre14:01:03

do Cursive's own suggestions work for you, Alex?

imre14:01:33

IntelliJ IDEA 2021.3.1 (Community Edition) Build #IC-213.6461.79, built on December 28, 2021 com.cursiveclojure.cursive (1.12.2-eap1-2021.3) com.github.brcosta.cljstuffplugin (0.4.0) works for me fine

borkdude14:01:37

btw, it's possible to separately disable cursive's suggestions from clj-kondo's according to @UQTHDKJ8J

imre14:01:10

I'm just wondering whether there's some base stuff switched off there

Alex Miller (Clojure team)14:01:12

I do get other problems

Alex Miller (Clojure team)14:01:23

Unused global declaration etc

Alex Miller (Clojure team)14:01:00

in general, that stuff works, I just don't see any of the clj-kondo suggestions from clojure extras

imre14:01:44

I'm assuming clj-kondo works well in your project when invoked from the command line?

borkdude14:01:26

that's a good suggestion

Alex Miller (Clojure team)14:01:29

I didn't think I needed to have anything set up ?

borkdude14:01:18

no, but just as a sanity check if clj-kondo doesn't crash on your project or so.

borkdude14:01:24

let me produce a clj invocation for you

Alex Miller (Clojure team)14:01:54

I did not have anything already installed or set up (as it said it was built-in)

danieroux14:01:03

I have clj-kondo working from cmdline, and up to now I’ve had it working with the file-watchers plugin too. I’ve switched that off, and now I expected -extras to kick in, which is has not.

Alex Miller (Clojure team)14:01:04

something like clj -Sdeps '{:deps {clj-kondo/clj-kondo {:mvn/version "2021.12.19"}}}' -m clj-kondo.main --lint src ?

borkdude14:01:09

clj -Sdeps '{:deps {clj-kondo/clj-kondo {:mvn/version "2021.12.19"}}}' -M -m clj-kondo.main --lint src

imre14:01:23

it appears if I rename the .clj-kondo folder in my project root I don't get kondo suggestions anymore

Alex Miller (Clojure team)14:01:37

that works from terminal (trying in tools.deps.alpha)

borkdude14:01:38

oh, really, that's weird :)

imre14:01:45

once I rename it back it works

borkdude14:01:50

let me try that

borkdude14:01:37

hmm, I get the same thing. that's actually pretty weird :)

borkdude14:01:51

so, @U064X3EF3 can you try to make a .clj-kondo directory in your project?

brcosta14:01:53

Hi guys, trying to follow the thread, @U08BJGV6E this is definitely a problem, I think this is hardcoded in the plugin code, I need to fix it :)

borkdude14:01:00

normally you would put a .clj-kondo/config.edn there

imre14:01:02

even weirder, if I rename config.edn inside, that isn't a problem and suggestions still work

Alex Miller (Clojure team)14:01:24

if I make a .clj-kondo directory, it starts working

brcosta14:01:47

Also, I’m not forwarding clj-kondo errors to intellij, so the user can’t tell this is the error

borkdude14:01:14

@UQTHDKJ8J Just curious, why is the plugin reading the .clj-kondo directory?

borkdude14:01:30

@U064X3EF3 Feel free to ping me via DM or #clj-kondo if you want help setting up clj-kondo on repos like tools.deps.alpha etc to get correct linting with respect to macros, etc.

brcosta14:01:54

:config-dir is hardcoded to ProjectBashPath/.clj-kondo, my bad, I think this one got there when I was trying to fix that dependencies problem with cursive way back

borkdude14:01:11

@UQTHDKJ8J you don't need to set the config dir manually, clj-kondo figures that out automatically, assuming that it is started in the right working directory

borkdude14:01:51

@UQTHDKJ8J if you send along the complete filename (absolute file path) then clj-kondo walks up the filename until it finds a .clj-kondo directory, that should be a robust solution if you're linting one file at a time. https://github.com/clj-kondo/clj-kondo/blob/67e992aa6c92e6675997e5558729d6efd2db51c6/src/clj_kondo/core.clj#L107

brcosta14:01:43

Yeah, I’m already sending the absolute filename, seems like an easy fix 🙂

borkdude14:01:02

glad we solved it then. thanks all

thanks2 1
tony.kay22:01:51

Release 1.0.0-alpha6 of Fulcrologic’s statecharts library. https://github.com/fulcrologic/statecharts This version contains a few bug fixes, and refines the external event queue to include an extra parameter. This is a minor breaking change (you can jsut add an _ arg to your handlers and otherwise ignore it). The default data model in the simple provider also changed to flat, because the scoped data model leads to subtle bugs in statecharts that are hard to reason about. This is also a potential breaking change if you were relying on scoping in the internal data model. You can easily specify the scoped model as an argument so it is a trivial fix.

Aleed22:01:35

very thankful for your work in making the state charts and state management faculties more modular and independent of fulcro’s rendering. will be giving them a go in my next project!

👍 1