E.g. when commenting some piece of code, with intention to generate doxygen/phpdoc documentation later, I would like to analyze the declaration of a function I'm commenting on. For example the snippet is right before the piece of code:
- Code: Select all
function myfunc($a, $b)
I imagine I could write a plugin, that would expand it to
- Code: Select all
/**
* ${0}
* @param ${1} $a
* @param ${2} $b
* @return ${3}
*/
If the snippet is inserted right before the declaration of a class, the corresponding snippet would be generated.
I do realize it is possible to implement this function as a shortcut-invoked plugin, but:
- it would look more streamlined when invoked as a snippet
- inserting static text with a plugin would not respect tab-navigation through ${n} placeholders
There is already a related question http://www.sublimetext.com/forum/viewtopic.php?f=6&t=3110&p=14721&hilit=snippet#p14721, but it never had an answer.