commandbox-cfformat icon indicating copy to clipboard operation
commandbox-cfformat copied to clipboard

incorrect formatting of default methods within interface

Open jimmifett opened this issue 1 year ago • 3 comments

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

interface{
  public default void function someMethod(){

  }
}

becomes

interface{
  public defaultvoid function someMethod(){

  }
}

jimmifett avatar Feb 21 '24 17:02 jimmifett

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.

jcberquist avatar Feb 21 '24 18:02 jcberquist

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

jimmifett avatar Feb 21 '24 21:02 jimmifett

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

image

jimmifett avatar Feb 21 '24 21:02 jimmifett