As emerged during the discussion of PR #295 some jsdoc tags (like @module, @typedef and @callback) should not be attatched to specific code nodes but rather they should provide information to other parts of the code documentation.
In broad terms a possible approach could be to extend the tagDefs with something like
Where globalTransforms is an array of services (similar to the already implemented transforms property) that should be run after all the other jsdoc tags have been collected.
However there might be some difficulties: one is the folllowing (outlined by @petebacondarwin). Consider the following code:
/**
* @module
*/
/**
* Description of foo().
*/
function foo() {}
Then I think that both comment blocks will be processed with respect to a single doc that has the foo() function as its codeNode.
We need to find a good way to distinguish JSDOC comments that should not apply to code nodes (but rather to the file, the whole doc collection or something else...).
As emerged during the discussion of PR #295 some jsdoc tags (like
@module
,@typedef
and@callback
) should not be attatched to specific code nodes but rather they should provide information to other parts of the code documentation.In broad terms a possible approach could be to extend the tagDefs with something like
Where
globalTransforms
is an array of services (similar to the already implementedtransforms
property) that should be run after all the other jsdoc tags have been collected.However there might be some difficulties: one is the folllowing (outlined by @petebacondarwin). Consider the following code:
Then I think that both comment blocks will be processed with respect to a single doc that has the foo() function as its codeNode. We need to find a good way to distinguish JSDOC comments that should not apply to code nodes (but rather to the file, the whole doc collection or something else...).
What do you think?