cursive

Issues at: https://git.io/cursive-issues
octahedrion 2021-03-19T14:37:32.034800Z

how do I stop Cursive indenting ; comments inside (comment) blocks when I type them on a new line ? It never used to do it. Also inside (comment)s if I delete to go up a line, that line is now indented where it wasn't before

octahedrion 2021-03-20T12:04:35.042800Z

I already have "Default to indent only" and "Force Only Indent for all forms" selected

onetom 2021-03-22T17:00:01.058100Z

I was just looking for this today too

octahedrion 2021-03-23T16:40:36.073500Z

actually I found it's the same for any form inside a (comment) block. I can't work out how to stop it indenting forms

octahedrion 2021-03-23T16:41:17.073700Z

I don't want Cursive to help me with formatting unless I explicitly ask it to

imre 2021-03-19T15:45:45.037300Z

Cursive's static analyzer seems to have an issue with the following, marking the .set calls inside the threading macros (complaining about the missing last arg):

(doto some-object
  (.set "RequiredField" required-field)
  (-> (.set "OptionalField1") (->> (some->> optional-field-1)))
  (-> (.set "OptionalField2") (->> (some->> optional-field-2))))
which is a weird way of saying
(.set some-object "RequiredField" required-field)
(some->> optional-field-1 (.set some-object "OptionalField1"))
(some->> optional-field-2 (.set some-object "OptionalField2"))
some-object
In contrast, clj-kondo seems to be okay with it.

mikejcusack 2021-03-19T17:18:33.037500Z

Yeah, gotta remember that Clojure's notion of symbols makes that more difficult than Java where there IntelliJ can know something is a class/interface just due to naming convention.

mikejcusack 2021-03-19T17:23:09.037800Z

Those settings are in the code style for Clojure in IntelliJ settings

mikejcusack 2021-03-19T17:23:19.038Z

Not sure which specific one is causing that

mikejcusack 2021-03-19T17:23:38.038200Z

Can you provide a complete example?

mikejcusack 2021-03-19T17:25:31.038400Z

Why is this so nested to begin with?

imre 2021-03-19T17:39:29.038600Z

Well, I wanted to see if I can turn the code in the second block into a doto and this is what I ended up having to do

cfleming 2021-03-19T20:32:50.038900Z

clj-kondo actually expands the macros, so it’ll be able to see that that’s ok. I can check what’s happening there, but no guarantees of much effort being spent to support code like that, sorry 🙂

imre 2021-03-19T22:21:54.039100Z

Don't spend time on it, it isn't a particularly useful pattern anyway 😁 Just posted it as I found it interesting

hlship 2021-03-19T23:21:51.039300Z

We're experimenting with converting from project.clj to deps.edn in our very, very large, multi-module project. So far, I haven't managed to get it to work at all; using "New project from existing sources" and then choosing the root folder of my multi-project, Cursive finds no deps to import. Does there need to be a top-level deps.edn file for this to work? What would that look like exactly? IDEA 2020.3, Cursive 1.10.1-2020.3.

hlship 2021-03-19T23:41:48.039500Z

Update: Downloading a fresh copy of my project from Git, into an entirely new folder, worked. Cursive may be storing some project-specific data outside of the project itself -- I had tried deleting the .idea directory of my existing project.

hlship 2021-03-19T23:44:07.039700Z

Then I found out I can't re-create my original project.

hlship 2021-03-19T23:44:31.039900Z

hlship 2021-03-19T23:48:17.040300Z

Now I'm into ~/Library/Caches/JetBrains/IdeaIC2020.3 looking for things to delete.

hlship 2021-03-19T23:52:44.040700Z

Ok, got my original project working again with Leiningen after finding and deleting all .iml files in my workspace.

cfleming 2021-03-19T23:54:35.040900Z

I think the best way to try this out would be to migrate module by module. So I’d pick a leaf module from your tree, un-register it with Leiningen and then File | New… | Module from existing sources and add the deps.edn.

hlship 2021-03-19T23:54:59.041200Z

Jeez! Sorry to spam this! I thought I had started a fresh thread. It's been that kind of day.

cfleming 2021-03-19T23:55:17.041700Z

@hlship we should start a new thread here for your issue since it’s not related to the problem in the other thread.

hlship 2021-03-22T20:22:36.058300Z

We're intending to do a full switch-over from lein to deps, we won't be mixing them. I can imagine making Cursive support something so odd would be painful!

hlship 2021-03-22T20:24:35.058500Z

But, yes, looking forward to :local/root because we often have code changes in a library module and tests in an application module and not having to lein sub install between would be nice (when testing from command line, rather than w/ Cursive).

hlship 2021-03-19T23:56:22.041800Z

Yes, as I noted, I didn't realize I was posting on the existing thread. I think I'm actually in good shape now that I deleted all the .iml files, and the deps.edn issue might have been resolved the same way.

hlship 2021-03-19T23:56:43.042Z

I've got like 30 windows open across two monitors and I feel like I'm going a little bit blind.

cfleming 2021-03-19T23:57:51.042200Z

One thing I’m not sure of is how well the inter-module deps will work if you’re mixing lein and deps projects. I had to do a lot of trickiness to make that work with lein, and deps has its own way of doing that bit. I think what that means is that things might not work totally correctly until the project is fully migrated - this will probably manifest as having to install your deps projects into your local maven repo so lein can find them.