Closed craig0990 closed 9 years ago
Somehow I knew that after filing this issue, I would find a way to solve my issue, if not the root cause of it. I started again, by cloning both jsdoc
and jsdoc-baseline
locally, running npm link
(plus some symbolic links for nested dependencies with grunt-jsdoc
) and modifying JSDoc directly to output more verbose logging information.
I have now managed to reduce the above code to it's absolute minimum:
exports.astNodeVisitor = {
visitNode: function(node, e, parser, currentSourceName) {
// <code to determine if node (function call) is a class goes here>
var longname = node.arguments[0].value;
e.event = 'jsdocCommentFound';
e.comment = '@class ' + longname;
e.filename = currentSourceName;
e.lineno = node.loc.start.line;
}
}
Just in case this is useful to anyone in future.
Thanks again for an awesome set of tooling!
I've been writing a plugin for JSDoc over the last few weeks (in between an ever-growing list of things to do) and I have succeeded in auto-detecting classes in our framework (JavaScriptMVC 3.2).
However, I am now running into a couple of issues with the
jsdoc-baseline
template (which is *** amazing by the way). I am using thevisitNode
functionality to sete.comment
ande.event
properties as explained by the Making things happen sub-section.If I set
e.comment = '@class ' + longname
, then JSDoc happily ignores my modifications. This appears to be caused by thecreateSymbolDoclet()
function inlib/jsdoc/src/handlers.js
. My modification causes aname
property to be set correctly, then when the method "tries again" it decides to ignore the comment.I've worked around this issue by using
@alias
instead, but this then causes a failure in theprefixReducer()
oflib/jsdoc/path.js
(called bydoclethelper.js
in Baseline), because ultimately, themeta
property of the doclet reaching Baseline does not have a filename set.Here is the stack trace for the latter error:
I have dug around a little bit, and the error is that it is attempting to resolve
undefined
.I have tried:
So I have two questions:
@class
?meta
tag in my plugin to make the Baseline template happy?I can share the plugin (and would ultimately like to do so on GitHub), but I will need to remove the cursing from the inline comments first ;)