Skip to main content
WilliamDSpherexx
Known Participant
August 2, 2017
해결됨

Format code button breaking code

  • August 2, 2017
  • 1 답변
  • 399 조회

I have an issue that I've come upon twice now and curious if anyone has a better workaround than what I do.

I use the format code button constantly to make sure i haven't broken something recently however certain lines of code it literally breaks... I think its using < or > in a use such as below::

var args: Vector.<String> = new Vector.<String>();

becomes (note spaces)

var args: Vector. < String > = new Vector. < String > ();

What I have been doing is just adding //the code again so i can quickly copy paste back what it should be....

so i would have this:

var args: Vector.<String> = new Vector.<String>();//var args: Vector.<String> = new Vector.<String>();

after hitting format code button this:

var args: Vector. < String > = new Vector. < String > ();//var args: Vector.<String> = new Vector.<String>();

then i would copy the commented text from the right to the left.   Saves me a few keystrokes per line.

I'm sure somebody has a better solution for me .... I don't see a preference that would fix this.... (already tried turning off "add space after keywords")

이 주제는 답변이 닫혔습니다.
최고의 답변: ClayUUID

Looks like the code formatter is mistaking the brackets around the variable type for mathematical operators. I blame AS3's ridiculous vector syntax. Anyway, since it results in invalid code, this is definitely a bug. Report it here:

Feature Request/Bug Report Form

1 답변

ClayUUID답변
Legend
August 2, 2017

Looks like the code formatter is mistaking the brackets around the variable type for mathematical operators. I blame AS3's ridiculous vector syntax. Anyway, since it results in invalid code, this is definitely a bug. Report it here:

Feature Request/Bug Report Form

Colin Holgate
Inspiring
August 2, 2017

I reported the auto format with vectors issue years ago, but no harm in it being reported outside of the prerelease.