Stephen Friedrich's answer points in the right direction, but a screenshot is not enough to understand how to use the feature. Here is how to get it to work, in a bit more detail:
- In the "Additional formatter classes" box you enter any custom classes that you have created which contain a custom
format()
method. So, in the OP's case, if their myMethod()
method belonged to some com.acme.MyClass
class, then they would enter com.acme.MyClass
there.
That would be all that the OP would need to do if their custom formatting method was called format()
. However, their custom formatting method had a different name, so they would also need to do the second step.
- In the "Additional formatter methods" box you enter the names of any custom methods that you have created which work like
format()
. So, in the OP's case, the string myMethod
would be added there. Note that you are not expected to include a class qualifier, or parentheses, or the arguments, just the name of the method.
From the looks of it, each method name entered in the "Additional formatter methods" box applies to all of the classes entered in the "Additional formatter classes" box, even if only one of the classes actually contains such a method. Furthermore, there will be no error even if none of the classes contains such a method, or if methods with such a name exist, but they do not have the necessary signature of void (String format, Object... arguments)
.
So, it appears that this feature has been implemented in a very hacky way, of the kind that we are not used to seeing from JetBrains. Also it is interesting to note that hackiness in the implementation of a feature makes it harder for the user to figure out how to use the feature.
I think this feature would have best been implemented with an extra annotation on the formatting method. (But let's not argue about this here, this is a Q&A site.)