-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate parinfer functionality #1155
Comments
+1 IMHO this should be the default edit mode for Cursive, since it's much more efficient for new users. |
Yes, this looks very nice indeed. |
Interesting, I would like to see that landing on Cursive at some point. |
👍 👍 👍 👍 👍 I agree with @extesy this is magic. Getting basic paredit without having to use hotkeys is just great |
👍 This would be great to have as an option. One of the things I like about Cursive is that the learning curve isn't too steep (unlike, say, Emacs), and I think this would be an improvement in that direction. |
👍 I'd love to have parinfer available in Cursive. Using it in Atom actually makes me feel like I'm better at writing clojure, since the bit of "syntactic friction" is removed & I'm not dragged out of my mental model of the code by formatting concerns. It's not enough to make me pick Atom over Cursive, but it's the one thing I miss. Just wanted to point out that the "official" parinfer implementation was just split out into a standalone library, with the codemirror stuff in a separate namespace. So that should make it simpler to integrate if you're planning to use the reference implementation. I'm not sure how nicely that would play with the existing structural editing in Cursive, but if you want to treat them as separate mutually exclusive modes, you could probably use the reference implementation and just let it operate on the raw text of the document. |
I too would really love to see parinfer in Cursive. 👍 👍 👍 👍 👍 👍 |
👍 |
3 similar comments
👍 |
👍 |
👍 |
+1 (since I hate working in Atom but like Parinfer's mode better than the existing one in Cursive). Ideally the REPL input would also use it... |
Hard to switch back after getting used to it in atom. |
+1 |
👍 definitely would love to see this integrated! |
👍 Would be great |
👍 |
@shaunlebron and @oakmac - I'm sure you're both already aware of this issue but wanted to ping you just in case. What an awesome combo this would be. |
I want to mention a few recent developments that may make integration easier:
|
Thanks @shaunlebron, that's very helpful. I'll take a look at the JS implementation - I'll probably have to modify it a bit to work in Cursive since Cursive already has its own lexer but it'll be a good base to start from. |
+1 |
1 similar comment
👍 |
Want :D 👍 |
+1 |
2 similar comments
+1 |
👍 |
The only thing that keeps me on Atom. Please make it happen in Cursive! |
👍 |
Hi folks :) I just wrote a JVM port of Parinfer. Should help make this task much easier. |
👍 |
@cursive-ide - do you have any plans on integrating this in? Or is it still in the "nice-to-have" category? I know there are a lot of +1's here, but Parinfer is really a delight to work with and I feel will help advance the adoption of Clojure quite significantly if fully appreciated. |
@damassi Yes, I'm actually working on this now but it's a little tricky to integrate into IntelliJ. It should be in the next release. |
Incredible. Thanks so much @cursive-ide, @oakmac and @shaunlebron! |
👍 |
1 similar comment
+1 |
Oh wow, this is the best news. |
@cursive-ide any idea when the next release will be? |
@vincent-dm Hopefully within a week or so, it's been trickier than I expected. |
@cursive-ide Parinfer integration looks great, thanks for adding it! I see that you have not included paren mode, but I found it useful for preserving identation like in the 5th example on https://shaunlebron.github.io/parinfer/ page. Could you please add an exception for at least that one case? |
@extesy Yes, I'm going to try to make an indentation preserving mode which will work in both paredit mode and with structural editing totally off. |
Do you have to enable parinfer in Cursive in any other way than just switching it on here: I don't notice any difference to "off"? How can I check if it's working? I've seen the animations on parinfer's website but Cursive doesn't behave like that? For example the "Preserve indentation" example doesn't work for me. |
No, that should be it, although a few people have reported having to toggle it twice for some reason. Note that Cursive only implements indent mode, not paren mode (which maintains indentation). So as you indent and dedent code, you should see the parentheses being moved around. See the first example here: http://shaunlebron.github.io/parinfer/ |
Doesn't work for me as well. Indentation doesn't cause parenthesis to move,
|
👍 |
@johanhaleby @j-pb I've just found a bug where parinfer doesn't work correctly in the REPL editor. Were you trying to use it in the REPL editor when it didn't work? |
Actually, I have found at least one case where parinfer broke existing code (shaunlebron/parinfer#106). In this case, parinfer appeared to do nothing because Cursive is not correctly reporting the parinfer error cases. I'll fix that so at least it's obvious why things aren't working. |
I think my REPL was open when I switched to parinfer but I haven't tried using it in the REPL. |
@cursive-ide just to know, have you planed to implement paren mode in the future? |
No. Just the plain editor. cheers Jan
|
@pbaille I hadn't, since I believed that indent mode is the only useful mode for actually editing - paren mode is still used internally. However there's some doubt about this now, and in fact there's some doubt about it in general (see here for an example). For non-indent mode editing modes (paredit, and no structural editing at all), I'm planning to implement a paren-mode lite which will maintain indentation as well as it can. I believe this is the main benefit of paren mode. |
Yes, paren is an essential part of parinfer usability from what I can tell. With just indent mode you end up in trouble in fairly common cases: Indent mode
Now start trying to wrap in a
To fix this, you'd have to adjust the indentation on all the subsequent lines manually so that indent mode will kick in (and auto-format isn't going to do the right thing because it can't know what you really want). |
+1 |
How to use indent mode in Cursive? |
@pate I came here with the same question. Looks like Cursive only implements indent mode, so switching Structural style to 'Parinfier' gives you intent mode. |
@cursive-ide is there a github ticket for the lite paren-mode? keen to subscribe to it ... |
Take a look at examples on https://shaunlebron.github.io/parinfer/index.html - this is pure magic. I really would like cursive to be able to do that.
The text was updated successfully, but these errors were encountered: