This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # boot (227)
- # carry (1)
- # cljs-dev (3)
- # cljsjs (2)
- # cljsrn (19)
- # clojars (2)
- # clojure (93)
- # clojure-belgium (1)
- # clojure-dev (2)
- # clojure-italy (1)
- # clojure-spec (22)
- # clojure-uk (5)
- # core-async (15)
- # cursive (33)
- # emacs (8)
- # ethereum (1)
- # hoplon (3)
- # jobs (2)
- # leiningen (1)
- # off-topic (24)
- # om (32)
- # perun (1)
- # protorepl (1)
- # re-frame (13)
- # reagent (53)
- # rethinkdb (4)
- # ring-swagger (1)
- # vim (12)
- # yada (14)
@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!
@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.
@puzzler Just to be clear, is your problem is that Ctrl-Enter doesn’t send the command immediately, or that Enter does send immediately?
@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).
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?
@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.
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.
What is the difference between setting the "resolution" and setting the "indentation"? Is that just two different ways of accomplishing the same thing?
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.
Those parameters will be aligned, then everything following them will be assumed to be body forms, and will be indented two spaces.
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".
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.
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.
Also, when the lightbulb pops up, the most convenient way to see the options is Alt-Enter rather than clicking.
I’ll see if I can figure out the triangle issue, I might not have seen that since I never click the bulb.
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.
Maybe you just know the "right" way to interpret, so you never noticed the triangles.
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?
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.
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.
Or, at least, all it lets you do is turn on and off the indentation overall, I think.
Yes. You can see the indentation configuration under Settings->Editor->Code Style->Clojure->Form Parameters, and the resolution configuration under Settings->Languages & Frameworks->Clojure->Symbol Resolution.
Neither of those currently allow editing the forms, because of my fear of JTables - that’s on my list to fix.
Is there any way to "unteach" something you've added to the indentation configuration?
Not currently, due to the aforementioned JTable fear. You can reconfigure the form to the correct indentation, though.
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?
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.