This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aws-lambda (8)
- # beginners (49)
- # boot (13)
- # braveandtrue (2)
- # cider (12)
- # cljs-dev (15)
- # cljsrn (2)
- # clojure (143)
- # clojure-italy (8)
- # clojure-nl (17)
- # clojure-spec (22)
- # clojure-uk (21)
- # clojurescript (145)
- # code-reviews (1)
- # cursive (33)
- # data-science (14)
- # datomic (25)
- # emacs (3)
- # events (1)
- # fulcro (48)
- # graphql (1)
- # onyx (15)
- # perun (5)
- # play-clj (2)
- # protorepl (1)
- # re-frame (27)
- # remote-jobs (3)
- # ring (3)
- # rum (7)
- # shadow-cljs (87)
- # specter (4)
- # test-check (14)
- # testing (2)
- # tools-deps (9)
There's a detail about Cursive I've been meaning to ask as it pops out out every now and then in discussion within my peers; Does Cursive use IntelliJ's parser/AST tooling for analyzing Clojure code? In these discussions I've had it is usually painted as something Cursive wouldn't actually do which in turns is the cause why most IntelliJ refactorings are not available, at least not in their familiar places.
To be more specific, in one of these discussions the two refactorings were "extract function" and "eliminate duplicates" (it's actually a code analysis tool) and then the discussion sort of went on tangent about how things even work... 🙂 Just asking for clarification, that's all.
Also I don't mean to imply these wouldn't be available, discussions just sometimes tend to be...curious. Sort of technical shower thoughts.
So IntelliJ doesn’t actually provide much for that, since every language is so different. It provides tools to build those things, and base classes for the AST etc, but each language needs its own lexer/parser.
Cursive’s is more or less like a reader, so you get back basically a set of forms, but not decorated for things like
defn or whatever, that’s added on later.
The absence of those refactorings is just because I’ve been busy with other things, no fundamental limitation. Extract/inline binding is there, for example.
And then various ones for moving things around. They’re harder because they require rewriting
ns forms, which is surprisingly hard to do reliably with cljc.
@amann That’s a classic use case for the stubs functionality. It’s not exposed yet to end users, i.e. you can’t yet say “Do that for this and that ns” but that will happen.
Cool. Can you have it load an external file, run some clj, and then 💸 ? Also, if you’re looking for beta testers/folks to improve that, I know of a CI/CD company that would… ❤️ this feature very much! ie, CircleCI would be so happy to have HugSQL #justwork
The one issue with the stubs for this is that there will be no easy way to detect when they need to be updated - that will have to be a manual refresh.
@p-himik Oh yes, my apologies. There’s no support for vector functions at the moment, although I agree it would be useful. I’ll have to take a look and see if I can do that - the issue is reliably identifying that that’s what you’re doing (you might just have a vector with some functions in it, for example).
I cannot make out how to tell Cursive that, when calling a function with multiple parameters and breaking lines between them, that the parameters on following lines should align with the param on the line with the function name.
Not that I like that, but I got beat up in a code review for insufficient indentation. 🙂
I looked at the Clojure preferences and (a) saw no examples with a function with params continued to the next line and (b) could not make out how to use the “Intentions” panel to change anything, or if that is its purpose.
That's what I see with my settings. I'll try to see if I can export them somehow. Note that I do not remember whether I have changed something at some point in time.
@hiskennyness Settings->Editor->Code Style->Clojure->General, uncheck “Default to Only Indent”