You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using esprima and I've the need of parsing comments. Esprima conveniently provides an array with comments which I'll use along with the jsdoc-api to extract useful info.
Thing is, when using explainSync (and probably other methods but I've only tested explainSync), if only the comment is provided the results are unexpected.
console.log(jsdoc.explainSync({ source: '/** example doclet */ \n var example = true' }));
//Outputs as expected.
console.log(jsdoc.explainSync({ source: '/** example doclet */' }));
/* Outputs:
[ { kind: 'package',
longname: 'package:undefined',
files: [ '/tmp/ebm4dtq81kqhbyb9aa2p72j45l3gcik9.js' ] } ]
*/
Is this expected behaviour?
The text was updated successfully, but these errors were encountered:
jsdoc-api uses jsdoc3 under the hood, not doctrine.. the general rule is "if it works in jsdoc it will work in jsdoc-api".. i don't think your example above is valid jsdoc3 input.. i will check later when i get a moment..
I get that since jsdoc was made to parse entire files and not only comment strings. Since this is named "api" I thought that would be a core function. The code works if I append a piece of valid code on the end of the comment like "var t = true;", however, support for only comment strings is a nice feature.
this project is an API wrapper for jsdoc3, which does not export any library code at all (it is command-line only).. it exists to workaround the design short-comings of jsdoc3 (an old codebase).. maybe that is not clear enough in the docs..
jsdoc3 works with whole js source files.. doctrine works with comment blocks only, but supports less tags.
I'm using esprima and I've the need of parsing comments. Esprima conveniently provides an array with comments which I'll use along with the jsdoc-api to extract useful info.
Thing is, when using explainSync (and probably other methods but I've only tested explainSync), if only the comment is provided the results are unexpected.
Is this expected behaviour?
The text was updated successfully, but these errors were encountered: