-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Custom indentation for some functions #80
Comments
Unfortunately not. Can you share how it is done in Cursive? The way I would like to support this is to have |
I think I can add the support with a reasonable amount of effort. I'll look
into it, I think it sounds important.
My question about Cursive was about about how the user can configure it.
But it will not matter too much because the options are limited in vs code
anyway. 😀
|
It would be awesome, thanks for looking at it. I know it is hard to find the time. Cursive offers numbers that you can choose to configure the indentation. They start from 0 which would indent the next line from the symbol you are defining, 1 for the parameters, and so on. It also has the |
Is that project you have a Leiningen project, @felipethome ? I want to know so that I can prioritize the path to fixing this. |
Yes! I think right now Cursive only supports Leiningen, though they are starting to have support for deps.edn in the EAP version |
Would configuring cljfmt in your lein project work for you? I am currently working on a rework of the ontype formatting for calva (and various other calva-fmt issues), and once the core is in place (hopefully in a week or so due to christmas) I will be adding support for customisation from the project.clj. |
I believe it would. The nice thing about adding to project.clj is that other people would automatically use the same indentation configuration. |
+1 for this feature, the possibility to configure custom macros with it owns identation configurations. |
Yes, this has been allowed to wait for quite long. A reason that is so is that I had hoped we should have consolidated Calva on the new formatter, but we still have them both. If anyone feel the urge to fix this, I will be happy to provide some context and pointers into the code. It shouldn't be too hard. Both formatters actually base their indentation on a |
yes this is usually spelled in our projects in a
|
@PEZ could there at least be two modes for indentation, one that follows regular lisp indentation others might be used to, and one with less aggressive nesting? lots of devs using vscode come from JS land, and so that sort of formatting might be more familiar/appealing I particularly like the formatting @tonsky described here: https://www.youtube.com/watch?v=l1b7Da2DnPo (relevant part starts at 42:18) |
I am a big fan of that proposal actually. I tried to implement it immediately when he published the blog post, even. However, I ran across a bug in cljfmt. The bug is fixed since a long while though, so it can be tried again. Without making any new promises about this... it really should be fixed. I will have a new look. |
I've just caught up on the thread, and I was a little unclear on the latest position. Is there a way to pass custom function names or rules to |
There soon will be. Please help test #546 |
This is now finally released. Please see: https://calva.readthedocs.io/en/latest/formatting.html Sorry for the insane delay. And thanks to @nbardiuk for making such a well-thought-through implementation! |
With Cursive it is possible to configure the indentation for each function individually. Is it possible to do the same with Calva?
The text was updated successfully, but these errors were encountered: