Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Feature proposal: enhance tagDefs #298

@lmores

Description

@lmores

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

module.exports = function( ... ) {
  return {
    name: 'myTag',
    global: true,
    globalTransforms: [ ... ],
    ...
  };
};

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...).

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions