rokucommunity / brighterscript-formatter

A code formatter for BrighterScript (and BrightScript)
MIT License
15 stars 5 forks source link

Comment indentation wrong before "else if" #68

Open zeronil opened 1 year ago

zeronil commented 1 year ago

Formatter aligns a comment above an "else if" with the code in the conditional block rather than with "else if" statement. If an "else if" appears directly below a comment, then the comment should be aligned with the "else if".

2023-01-11_12-43-49
TwitchBronBron commented 1 year ago

The same thing happens in the typescript formatter and the C# formatters. However, I'd be open to seeing this added as an option for the formatter. Would you have any interested in helping? The change would need to happen in this file in the brighterscript-formatter project.

TypeScript typescript-indent

C# csharp-indent

TwitchBronBron commented 1 year ago

Moving this issue into brighterscript-formatter since that's where the logic would be implemented.