Minor Formatting Issues #607
Replies: 6 comments 4 replies
-
If a statement spans multiple lines, all lines after the first one are indented one extra tab more than the first one. It could be argued that function arguments should be indented an extra tab beyond the parentheses. However, I'm not sure if the token stream differentiates
I think that this is pretty much the same as above. The lines after the first are indented one extra tab. In this case, I think that there's an extra indent for Array items inside
Yeah, it would probably look better if this nested function call's arguments were indented. Again, an extra tab for open parenthesis could cover that.
Hmmm... ActionScript embedded in MXML is supposed to be formatted too. I just gave it a try in one of my projects, and I can't reproduce the issue. For me, the Script tag is indented properly, and the AS3 inside is formatted. Is there any chance that you might have another formatter for XML that is conflicting? |
Beta Was this translation helpful? Give feedback.
-
It seems unlikely. Although, I guess I should double check that I correctly deal with line endings.
Can put together a very simple MXML component where this consistently reproduces? Thanks! |
Beta Was this translation helpful? Give feedback.
-
OK, I set up a fresh install on a Windows 10 Pro x64 VM. The screenshot below shows the configuration. I'm using that version of Java due to issue #507 (perhaps it's been resolved in a subsequent version you're using?) Anyway, I'm getting the same results with this bare-bones project: |
Beta Was this translation helpful? Give feedback.
-
Hey Josh, Installed JDK 11.0.13, and also the very latest JDK for good measure. Neither have fixed the issue for me. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am really loving the new Formatting feature, Josh! There are a few anomalies I noticed, that I can't seem to find a solution for.
This isn't always how I structure my code, but in cases when there are many or long function arguments it is necessary:
The default new-line functionality in VS Code is what I believe one can expect for the structure of code above, however asformat creates an additional indentation for the array contents. For function calls nested within arrays, this indentation is apparently flattened.
Also, the function call closing brackets seem to be indented by one tab extra, though maybe that's the convention.
In MXML files, the opening script tag is de-indented for some reason. (I'm also guessing AS formatting within this tag isn't supported)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions