BabylonJS/Spector.js

Source-code beautify `#if` indenting does not respect comments

JannikGM opened this issue · 2 comments

_indentIfdef doesn't check if the preprocessor is at the start of the line or in a comment, so even a line with a comment containing #if will mess up the indentation:

input:

/* #if */
/* #if */
/* #if */
/* #if */
/* #if */

output:

    /* #if */
        /* #if */
            /* #if */
                /* #if */
                    /* #if */

I would say #269 is the best workaround for it as it is hard to figure whether the tokens are in comments or not.

Would be great to have a fully fledged beautifier :-)