How to handle functions beginning with an underscore which are private
In my code we use a code convention that functions beginning with underscore are treated as private functions.
/**
* Custom function name
*
* @param {String} test Test String
* @private
*/
function _customFunctionName( test )
{
}
Currently, I have to manually insert the @private tag at the end of the JSDOC.
I was reading through the ReadMe file of sublime pkg https://github.com/spadgos/sublime-jsdocs#variable-documentation on which docblockr is based upon.
I came across jsdocs_notation_map setting in which we give a map to add arbitary tags. I checked docblockr settings and we also have a similar setting but I have no clue on how to use it.
As per documentation, of notation_map (Array)
An array of notation objects. Each notation object must define either a prefix OR a regex property, and a type property.
I tried giving the following input
[{"prefix": "_","type": "private"}]
But this doesn't work at all.
So, is something similar supported by dockblockr or am using jsdocs_notation_map setting in the wrong way.
There is some code that evaluates this setting.. (get_matching_notations(name)), but to be honest I have not the slightest clue how this code works. But it definitely looks buggy.
@nikhilkalige Do you still know how this is supposed to work?
@MoritzKn Defnitely not.. :(
I was just trying to figure this out as well. The documentation doesn't specify being able to supply with "tags" like the Sublime package does to add the @private tag to a prefix.
+1 except we use the convention of having an underscore at the end on the variable:
class MyClass {
/**
* @param {?Test} test Nullable Test object
* @private
*/
myFunc_(test) {
..
}
}