Fork me on GitHub
#cursive
<
2016-10-02
>
shaun-mahood00:10:31

@puzzler: I looked at all my config and couldn't find anything obvious. I may have smart parens on, here's how my repl behaves - open paren creates a closing paren, enter goes to next line, ctrl-enter executes. I have structural editong turned off in the bottom right of the screen. Wish I could be more help!

puzzler01:10:44

@shaun-mahood Right, I think that's the distinction. I have it set up so that typing an open paren does not create a closing paren. And that seems to break the Enter/Ctrl-Enter behavior in the REPL.

cfleming03:10:17

@puzzler I’ll try to reproduce that and fix it.

cfleming03:10:50

@puzzler Just to be clear, is your problem is that Ctrl-Enter doesn’t send the command immediately, or that Enter does send immediately?

puzzler05:10:21

@cfleming Both Enter and Ctrl-Enter send the command immediately, so there's no way to do multi-line entry (without manually adding an extra right-paren and then keyboarding back to before the right-paren).

puzzler23:10:02

Instructing cursive about the indentation settings for a macro doesn't seem to work the way I remember it working, or the way that is explained in the Cursive documentation. When clicking on the "lightbulb" for the macro, instead of letting me type a number of characters to indent, it takes me to a completely different dialog box under the indentation settings in the settings panel and shows an example of how "while" would be re-indented (even though I clicked on something other than while), but there doesn't seem to be any way to edit this box or add a new construct or make any changes. What am I missing?

cfleming23:10:24

@puzzler I’m not sure why it would work in the way you describe. I’m in the middle of a merge, when I’m done I’ll check that.

puzzler23:10:01

Hmmm, I was clicking on the little triangle arrowhead at the right to see the options, but it looks like that is the wrong thing to do. If you click to the left of the triangle it works more as expected. Confusing, but I think I might have it figured out now.

puzzler23:10:10

What is the difference between setting the "resolution" and setting the "indentation"? Is that just two different ways of accomplishing the same thing?

cfleming23:10:06

No, the indentation just sets the indentation rules.

cfleming23:10:56

BTW one point on that - the number is not the number of spaces to indent the form, it’s the number of parameters to treat as special.

cfleming23:10:42

Those parameters will be aligned, then everything following them will be assumed to be body forms, and will be indented two spaces.

puzzler23:10:46

Interesting. So what is resolution? It seems like resolution is also an indenting thing, a way to say "indent this form like this other common form".

cfleming23:10:46

No, resolution refers to symbol resolution. So if you have a let-like macro form you’ve defined, you can say that your form should resolve its local variables in the same way as let.

cfleming23:10:36

That requires that your form conforms to the grammar for let, so it only works for forms that are very similar syntactically to their built-in counterparts.

cfleming23:10:26

Also, when the lightbulb pops up, the most convenient way to see the options is Alt-Enter rather than clicking.

cfleming23:10:57

I’ll see if I can figure out the triangle issue, I might not have seen that since I never click the bulb.

puzzler23:10:30

Alt-Enter shows the same thing as clicking on the lightbulb: misleading triangles at the right end of the option which take you to the wrong dialog.

puzzler23:10:46

Maybe you just know the "right" way to interpret, so you never noticed the triangles.

puzzler23:10:19

Is there a way to see all the forms you've "taught" to cursive? Is there a way to teach it something that persists across projects?

cfleming23:10:11

Oh, I see - you’re referring to the arrow in the popup menu, not the arrow on the lightbulb itself. Yes, that will show further options for each item, often allowing you to disable the relevant inspection, or configure it, etc.

puzzler23:10:49

Right, I thought that arrow was the only thing to click on. It gives you an option to "configure indentation" which is what I thought I needed to click, but it takes you somewhere that doesn't do anything.

puzzler23:10:28

Or, at least, all it lets you do is turn on and off the indentation overall, I think.

cfleming23:10:57

Yes. You can see the indentation configuration under Settings-&gt;Editor-&gt;Code Style-&gt;Clojure-&gt;Form Parameters, and the resolution configuration under Settings-&gt;Languages &amp; Frameworks-&gt;Clojure-&gt;Symbol Resolution.

cfleming23:10:35

Neither of those currently allow editing the forms, because of my fear of JTables - that’s on my list to fix.

cfleming23:10:13

Oh, and those settings should both persist across projects.

puzzler23:10:01

Is there any way to "unteach" something you've added to the indentation configuration?

cfleming23:10:00

Not currently, due to the aforementioned JTable fear. You can reconfigure the form to the correct indentation, though.

puzzler23:10:10

What is the difference between 0 and indent?

cfleming23:10:49

There probably isn’t one, now that I think about it.

cfleming23:10:09

Both will cause all forms after the head symbol to be indented two spaces.

puzzler23:10:24

Hmmm, so is there a way to get back to something working like functions do by default, i.e., things line up under the first parameter?

cfleming23:10:25

That’s something I realised was missing, and will add for the next EAP, now that you mention it. Functions internally have essentially Integer.MAX_VALUE parameters - the best approximation available in the UI right now is to set that to 9. I’ll add a “Function” option there which will do the right thing.