jcberquist / commandbox-cfformat

A CommandBox module for formatting CFML component files.
MIT License
22 stars 10 forks source link

incorrect formatting of default methods within interface #155

Open jimmifett opened 8 months ago

jimmifett commented 8 months ago

within an interface, the 'default' keyword gets squished against the next keyword:

interface{
  public default void function someMethod(){

  }
}

becomes

interface{
  public defaultvoid function someMethod(){

  }
}
jcberquist commented 8 months ago

Interesting, I am not aware of default being a valid keyword when declaring a function? Also, you aren't specifying the function keyword. Is this a Java interface? In any case, this syntax is not able to be interpreted by CFFormat (for the reasons above; cfformat does not understand inline Java currently) so it produces that output. It would still be better if it preserved the spacing between words, however.

jimmifett commented 8 months ago

I forgot the function keyword, but yes, default is a keyword for cfc interfaces, i'll adjust the sample

jimmifett commented 8 months ago

https://helpx.adobe.com/coldfusion/developing-applications/building-blocks-of-coldfusion-applications/object-oriented-programming-coldfusion.html

image