Fork me on GitHub
#cursive
<
2020-07-31
>
lsenjov00:07:43

Is there a command to trigger stub generation?

onetom04:07:38

i missed that the other day too... also, i have a monorepo with 4-5 clojure projects in it now and im being asked 4-5 times whether i want to generate stubs. that would be great if i could just say yes 1 time 🙂

cfleming05:07:37

There isn’t, but there should be. You can provoke the check by refreshing your lein/deps project from the corresponding toolwindow as a workaround.

👍 6
cfleming05:07:11

@U086D6TBN You should only be asked once for that, I think. Do you mean you have multiple deps projects in a single IntelliJ project?

onetom05:07:40

yes. i have multiple deps modules

onetom05:07:50

if i understand correctly, we should version control the .idea/clojure-deps.xml files. they contain system aliases though, which might not be present on other systems. those are not transferrable to other machines and iirc they got cleaned up automatically, resulting in an unnecessary churn in changes to this file. what can we do about it? would it make sense to put the system aliases into a different file, which can be gitignored?

onetom05:07:24

of course turning aliases on and off might also result in changes to the .iml files of other the intellij deps modules, eg:

-    <orderEntry type="library" name="Deps: vlaaad/reveal:d0fe22" level="project" />
+    <orderEntry type="library" name="Deps: Local vlaaad/reveal" level="project" />
i have no idea what to do about that.

onetom05:07:12

and the alias checkboxes are still buggy. if i click them nothing seems to happen, but if i move up/down in the alias tree, then they update and reflect the new state. initially i thought it should be just my system, but i've seen the same behaviour on 3 other machines too, so i think it's a bug

onetom06:07:33

hmmm... my run configurations i put in .run/ are not showing up amongst the other ones, which are still under .idea/runConfigurations. how can i make cursive aware of the ones in .run/ ?

cfleming06:07:12

I’m not sure, actually. How are you putting them under .run/?

cfleming06:07:25

Oh, I see - there’s a “Store configuration file in…” option - I think that’s new, or at least I don’t remember seeing it previously.

onetom06:07:52

originally they were added under the old location, then the other day i clicked on that cog next to the Store as project file and changed the path to .run

onetom06:07:13

oh, that's not a cursive feature?

cfleming06:07:20

Could you file an issue for that? I’m not sure what’s going on there. It looks to me like they’re expecting run configs to be in one location, rather than two.

cfleming06:07:24

No, that’s IntelliJ doing that.

cfleming06:07:38

But that you can now specify what that location should be.

onetom06:07:19

aaah... so that's supposed to be a per-project option, not a per run-config! it's not clear from the UI...

onetom06:07:57

beacuse it shows different paths for the different run configs

onetom06:07:28

so the references to the run configs are stored in workspace.xml, which is not under version control (and correctly so), so im not sure how this new feature is meant to work... 😕 also, i think i've started intellij community editor over this project recently and that might have tangled these settings up, since i had some python run configs too, which are not supported under the CE

onetom06:07:26

workspace.xml has this kind of magic too, to deal with chaning the run config location:

<component name="ChangeListManager">
    <list default="true" id="73adb5ea-abbc-47f9-83c2-475bd4854522" name="Default Changelist" comment="Reveal integration and documentation">
      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/Datomic_testbed.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.run/Datomic testbed.run.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/Recurrence_REPL.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.run/Recurrence REPL.run.xml" afterDir="false" />
...
    </list>

onetom06:07:58

i've also noticed that one of those files have a lot of repetition in them. smells like a bug:

xml
<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="Rule Crib" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
    <module name="rule-crib" />
    <setting name="replType" value="NREPL" />
    <setting name="execution" value="DEPS" />
    <setting name="jvmArgs" value="" />
    <setting name="parameters" value="" />
    <setting name="workingDir" value="$PROJECT_DIR$/rule-crib" />
    <setting name="profiles" value="" />
    <setting name="aliases" value="datomic-peer,expect,dev" />
    <setting name="fixLineNumbers" value="false" />
    <method v="2" />
  </configuration>
  <configuration default="false" name="Rule Crib" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
    <module name="rule-crib" />
    <setting name="replType" value="NREPL" />
    <setting name="execution" value="DEPS" />
    <setting name="jvmArgs" value="" />
    <setting name="parameters" value="" />
    <setting name="workingDir" value="$PROJECT_DIR$/rule-crib" />
    <setting name="profiles" value="" />
    <setting name="aliases" value="datomic-peer,expect,dev" />
    <setting name="fixLineNumbers" value="false" />
    <method v="2" />
  </configuration>
  <configuration default="false" name="Rule Crib" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
    <module name="rule-crib" />
    <setting name="replType" value="NREPL" />
    <setting name="execution" value="DEPS" />
    <setting name="jvmArgs" value="" />
    <setting name="parameters" value="" />
    <setting name="workingDir" value="$PROJECT_DIR$/rule-crib" />
    <setting name="profiles" value="" />
    <setting name="aliases" value="datomic-peer,expect,dev" />
    <setting name="fixLineNumbers" value="false" />
    <method v="2" />
  </configuration>
  <configuration default="false" name="Rule Crib" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
    <module name="rule-crib" />
    <setting name="replType" value="NREPL" />
    <setting name="execution" value="DEPS" />
    <setting name="jvmArgs" value="" />
    <setting name="parameters" value="" />
    <setting name="workingDir" value="$PROJECT_DIR$/rule-crib" />
    <setting name="profiles" value="" />
    <setting name="aliases" value="datomic-peer,expect,dev" />
    <setting name="fixLineNumbers" value="false" />
    <method v="2" />
  </configuration>
  <configuration default="false" name="Rule Crib" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
    <module name="rule-crib" />
    <setting name="replType" value="NREPL" />
    <setting name="execution" value="DEPS" />
    <setting name="jvmArgs" value="" />
    <setting name="parameters" value="" />
    <setting name="workingDir" value="$PROJECT_DIR$/rule-crib" />
    <setting name="profiles" value="" />
    <setting name="aliases" value="datomic-peer,expect,dev" />
    <setting name="fixLineNumbers" value="false" />
    <method v="2" />
  </configuration>
  <configuration default="false" name="Rule Crib" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
    <module name="rule-crib" />
    <setting name="replType" value="NREPL" />
    <setting name="execution" value="DEPS" />
    <setting name="jvmArgs" value="" />
    <setting name="parameters" value="" />
    <setting name="workingDir" value="$PROJECT_DIR$/rule-crib" />
    <setting name="profiles" value="" />
    <setting name="aliases" value="datomic-peer,expect,kaocha,dev" />
    <setting name="fixLineNumbers" value="false" />
    <method v="2" />
  </configuration>
</component>

Empperi07:07:01

Seems like structural editing choices don't show up anymore in the taskbar. Even though they are selected to be shown. Disabling the selection and re-enabling it won't matter.

cfleming01:08:10

Which version of Cursive are you using? There was a bug with this which was fixed in 1.9.2.

Empperi05:08:21

@U0567Q30W sorry, missed your question but I had answered that just in the next message 🙂 The version was 1.9.3-2020.2

Empperi05:08:55

Just got an update to 1.9.4-eap1-2020.2 where this issue seems to have gone away 👍

Empperi07:07:49

Version 1.9.3-2020.2

Trevor15:07:44

On OSX what's the key binding to send the currently highlighted form (even if it's nested inside another form?) to the REPL? I'm using <CMD>+p and that's great but would be cool to send just a nested bit of the form I'm failing to find it so I figured I'd just ask, thanks!

cfleming01:08:47

There isn’t one for “surrounding sexp”, but if you have a form selected then all the “Send xxx to REPL” actions will send that instead of what they would normally send. So you can select the form using Alt-up arrow and then use Cmd-P.

3
onetom09:08:22

I've also assigned Ctrl-Enter (aka Cmd-Shift-P) to Eval top form and Ctrl-Shift-Enter to Eval form before caret, so I can just move to the end of a form and Ctrl-Shift-Enter just that. it's often followed by a Ctrl-Enter to eval the whole, containing form too if I were happy with the evaluation result of the sub-form.

onetom09:08:26

on that note, i often find myself wanting to evaluate a sub-form, which comes right after my cursor. i was wondering if it would be possible to create a composite action, which does all this at once. if there is an ambiguity, maybe a popup can show the alternatives, just like the variable extraction popup. the rules could be similar to how the Alt-Up Extend Selection decides what to highlight, but favoring sequences as opposed to individual tokens. in other words, when i press ctrl-shift-enter, i would like it to be the combination of a more greedy alt-up + ctrl-enter.

onetom09:08:31

i could describe such an action as Eval around caret or Eval in caret's vincinity

cfleming00:08:01

The problem with these sorts of actions is the combinatorial explosion of <form selection>/<how to eval>/<what to do with the results>. Lots of people have asked for an eval which puts the result in a comment in the source file. So I’m planning to extend the REPL commands feature to allow people to build the particular commands they want out of component pieces.

👍 3