Fork me on GitHub
#cursive
<
2019-05-03
>
Jacob Haag13:05:51

With intelij, for certain languages you can use an "intention" to generate the outline of a test for a desired function. Does this capability exist for Clojure and if not is it something that's been considered to add to Cursive? https://www.jetbrains.com/help/idea/create-tests.html

manutter5113:05:16

If you right-click on a function and select Go To -> Test, it will give you the option of creating the test if it does not already exist.

Jacob Haag13:05:36

Ah neat, it's pretty minimal but is nice none the less

mhuebert13:05:28

I just updated to the latest cursive and notice that bracket highlighting has changed, so that “outer brackets” are preferred to “inner brackets”. Was this an intentional change?

mhuebert13:05:31

i believe the previous behavour was aligned with what “Extend selection” would select

conan15:05:11

this is a good way of describing it

manutter5113:05:03

Yes, that happened with a recent version and it’s a known issue. I think the underlying issue is something that changed in IntelliJ, and we’re waiting for JetBrains to fix it?

Jacob Haag15:05:36

How would I go about finding unused re-frame subscriptions w/ intelij and cursive? I tried using Analyze | Inspect Code but it doesn't pick up subscriptions lie

(re-frame/reg-sub
   ::foo
   ____)

p-himik18:05:53

I don't think you can do anything apart from the full-text search or usages search (which can be slower than just full-text search).

cfleming22:05:36

Yes, there isn’t a very good solution for this right now, unfortunately. The global “Unused declaration” inspection doesn’t work for Clojure code, and I haven’t investigated why yet.

kenny16:05:24

Cursive doesn't seem to always persist the REPL history. I'm on Ubuntu. When I restart my computer, only some very old REPL history is shown. If I close IntelliJ before shutting down, however, it will persist correctly.

cfleming22:05:33

Unfortunately I don’t think there’s much I can do about this, it’s just IntelliJ’s persistence mechanism. Do you find that other settings are also lost when shutting down like this?

kenny22:05:42

I don't change other settings often enough. I'd expect settings to not be affected by this because in order to change those, I need to explicitly hit the Save button. The REPL history seems like it'd be saved in the same way regular files are saved. I do not have the problem of lost data when changing files.

cfleming22:05:52

@mhuebert Yes, this is an unfortunate IntelliJ regression. The original issue was here: https://youtrack.jetbrains.com/issue/IDEA-210104, when that wasn’t fixed completely, https://youtrack.jetbrains.com/issue/IDEA-211720 was the follow-up.

mhuebert22:05:54

@cfleming thanks for the links, happy to know it is being worked on by IntelliJ. I find the current behaviour confusing.

👍 4
cfleming22:05:48

Yes, it’s definitely super confusing. I suspect it’s not as bad for non-Lisp languages which don’t have tons of close parens stacked up, but for Clojure it’s very hard to figure out what’s going on.

👍 8