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

Syntax Checker does not respect CONFIG:: statements #710

Closed alexpolmans closed 10 months ago

alexpolmans commented 10 months ago

If the same function is defined within conditional code, the whole program gets marked with red underlines because the syntax checker thinks that two functions have been declared with the same name.

package
{
    public class TestClass
    {
CONFIG::desktop {
        public function Test() : void
        {
            trace( "I am desktop" );
        }
    } // end CONFIG::desktop

CONFIG::mobile {
        public function Test() : void
        {
            trace( "I am mobile" );
        }
    } // end CONFIG::desktop
} 

The asconfig.as file has only one of the conditions marked as true.

"define": [
            {
                "name": "CONFIG::mobile",
                "value": "false"
            },
            {
                "name": "CONFIG::desktop",
                "value": "true"
            },

The compiler itself respects the condition and compiles the code.

joshtynjala commented 10 months ago

Try true and false values without the quotes around them.

alexpolmans commented 10 months ago

Thank you Josh. Rookie mistake.