AdaCore / Ada-IntelliJ

Support for Ada and SPARK languages in IntelliJ IDEA
Apache License 2.0
21 stars 8 forks source link

Trailing spaces from commenter causing builds to fail #56

Open raja-s opened 5 years ago

raja-s commented 5 years ago

The Ada commenter currently returns the comment prefix -- followed by two spaces to follow GNAT coding style. The IDE seems to comment empty lines as well, which results in trailing spaces in those lines causing builds to fail. There does not seem to be a way to implement "dynamic" commenting in the IntelliJ platform, for example a commenter that takes as an argument the line to be commented and returns a prefix to comment that line with, so we need to find another way to solve this. The simplest solution would probably be some hack involving a change listener that figures out which lines were commented and manually strips them from trailing spaces immediately after the comment action.