-
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
Code indentation fix in rules #26
Comments
yes please. |
:) |
…ion is inserted, by next line is aligned relatively to ':'
Now next line is aligned relative to ':' and no line continuation is inserted. I think better to align rule parameter values relative to rule parameter name start pos + indent, but not clear how to fix this at the moment. |
Hey, I am not sure I understand everything, but this looks like it might be useful! Just to re-iterate what I would expect to happen: |
Let me show you an example:
After my previous commit. If you press 'Enter', you will get
instead of
Yes, agree, I'd like to get:
P.S: Example updated, the initial version was incorrect |
Hmmm, that may be worse than before? |
I think not worse because we don't need '\' here and moving caret back to prev line to delete '\' is more annoying. |
Hmm, currently when I start with this:
and hit enter, I get this:
I then have to hit space four times to get a sensible indent. Am I on an outdated version of the plugin? |
Ok, correct my minimal example was too minimal, indeed for
you will get
I was talking about the case:
or
When I want to add new param to the existing single line definition, I don't want to get
And the desired behavior should be
At the moment I've implemented a partial fix which doesn't insert line continuation
|
Ah! Yes, that's an improvement :D |
@winni2k Updated plugin is available in JetBrains Plugins Repository and could be installed using Preferences|Plugins |
Just a bit of feedback on our conversation above: I've started using this version of the plugin, and I love that the |
I am still quite happy with this plugin, but I have a request for an improvement: When I use rule bla:
shell:
"""cats""" then the code is reformatted as: rule bla:
shell:
"""cats""" with an indentation of five spaces. I see this happening a lot. Is there any way to constrain the indents to be four spaces? |
@winni2k At the moment you cannot change that. You get 5 space indentation because This issue is likely to be connected with #16. Snakemake language support reuses parts of We are going to work on these 2 issues during this summer. |
Hi! Any progress on this? |
@lpla Yes, there is some progress, you can configure the formatter to keep constant indent independent on section keyword length. To do this:
reformat code will behave like: The formatter is still not ideal, but to my mind, it works quite ok and this issue isn't critical at the moment. |
Thanks for the workaround! This has been driving me insane. |
Related API docs - https://www.jetbrains.org/intellij/sdk/docs/reference_guide/custom_language_support/code_formatting.html We need own formatting model builder base extending Also we want to get See tests examples in |
Code indentation fix in rules for new line after:
The text was updated successfully, but these errors were encountered: