How is it possible to access the name of the method (and its arguments) when inserting a YASnippet in a Java (or JavaScript) code block?
The goal is to be able to expand
logm
into (for example):
log("notify() called with: " + "context = [" + context + "]");
if inserted in the body of function:
public void notify(final EventHandlerContext context) {
....
}
(Such a live template exists in IntelliJ IDEA.)
You can evaluate arbitrary lisp code in the snippet. So, if you have a function to grab the method name/arguments it can be called from the snippet code. For example, here is a quick attempt to get the method name -- you could probably find a better function somewhere in
cc-cmdsoreclimlibraries.snippet