Fork me on GitHub

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


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?


they should appear inline in the code


Type (inc :foo) for example


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


@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


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


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


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


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


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


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


I have 1.12.1-2021.3

Alex Miller (Clojure team)13:01:19

inline eval stuff works


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


I'll try that one

Alex Miller (Clojure team)13:01:25

doesn't seem likely that matters here but dunno


still works here, after intellij was done scanning things


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


@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)


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


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


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


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


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


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


that's a good suggestion

Alex Miller (Clojure team)14:01:29

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


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


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)


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 ?


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


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)


oh, really, that's weird :)


once I rename it back it works


let me try that


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


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


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 :)


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


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


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


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


@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.


: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


@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


@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.


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


glad we solved it then. thanks all

thanks2 1

Release 1.0.0-alpha6 of Fulcrologic’s statecharts library. 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.


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