as3hx icon indicating copy to clipboard operation
as3hx copied to clipboard

Broken comment with braces

Open ze0nni opened this issue 7 years ago • 4 comments
trafficstars

as3 code for example:

package {
    public class Issue {
        public function Issue() {
            if (true)
            {
                //broken comment{
                doIt();
            }
        }
    }
}

expected result


class Issue
{
    public function new()
    {
            if (true)
            {
                //broken comment{
                doIt();
            }
    }
}

actual result


class Issue
{
    public function new()
    {
            if (true)
            
                //broken comment{{
                doIt();
            }
    }
}

ze0nni avatar Jan 18 '18 12:01 ze0nni

Library from git?

SlavaRa avatar Jan 18 '18 12:01 SlavaRa

Right. Buld from this revision 2a1a0f50ed0a23b9f3d14be53b0341dfaaaebaab

ze0nni avatar Jan 18 '18 12:01 ze0nni

Same thing here. It's actually much worse than decribed, there's no need to have a brace inside the comment, it's enough to simply have a comment right after a brace, which happens very often.

package {
    public class Issue {
        public function Issue() {
            if (true)
            {
                //comment
                doIt();
            }
        }
    }
}

Result:

class Issue {
	public function new() {
		if (true) 
		//comment{
			
			doIt();
		}
	}
}

The brace ends up in the comment, so the .hx doesn't even compile.

Some thing for opening braces of functions:

package {
    public class Issue {
        public function Issue() {
            //comment
            doIt();
        }
    }
}

Result:


class Issue {
	public function new() 
	//comment{
		
		doIt();
	}
}

chatziko avatar Jan 19 '18 17:01 chatziko

Experiencing same trouble

ProdigytTest avatar Feb 03 '18 21:02 ProdigytTest