BowlerHatLLC / vscode-as3mxml

ActionScript & MXML language extension for Visual Studio Code. Develop apps for Adobe AIR, Adobe Flash Player, or Apache Royale.
https://as3mxml.com/
Apache License 2.0
256 stars 39 forks source link

asformat: Error formatting MXML files #701

Open esidegallery opened 1 year ago

esidegallery commented 1 year ago

If the Script tag contents of an MXML file becomes too long (which isn't very long at all), formatting will break. Deleting code will allow it to work again. This occurs with both CRLF and LF line endings, though CRLF seems to be a little more sensitive than LF. Behaviour is quite inconsistent, as I can re-add code after it breaks and it will still work - up to a point at least.

Animation

Here is the output from the error: Error.txt

And this is the file used in the animation above: TileList.mxml.txt

I am using a Windows PC, and I have a feeling this error doesn't occur in macOS.

joshtynjala commented 1 year ago

Interesting! It's a stack overflow while using a regular expression in Java.

joshtynjala commented 1 year ago

I was able to reproduce a couple of times on macOS, but it's happening very inconsistently. It seems to happen every time on Windows.

joshtynjala commented 1 year ago

apache/royale-compiler@255bb4d040755184be0dfb176ac5608061bd1305

esidegallery commented 5 months ago

Is this now just a matter of waiting for the next Royale Compiler release?

joshtynjala commented 5 months ago

Is this now just a matter of waiting for the next Royale Compiler release?

Yes.