Closed jancbeck closed 8 years ago
you can get that information from the raw jsdoc output, a command like
$ jsdoc lib/your-code.js -X
or are you saying it should be in the jsdoc-parse output too? to support which feature? maybe it should be considered, let me know.
coincidentally, i just received a PR which adds the jsdoc meta
information (which includes line numbers) to the jsdoc-parse output.. i'll let you know once it's available.
I locally applied the PR and it seems to be exactly what I wanted
{
"id": "sync~fallback",
"longname": "sync~fallback",
"name": "fallback",
"scope": "inner",
"kind": "member",
"description": "Call wp.media.model.Attachments.sync or Backbone.sync",
"memberof": "sync",
"meta": {
"range": [
34830,
34902
],
"filename": "media-models.js",
"lineno": 1253,
"path": "/srv/www/developer-reference/htdocs/wp-includes/js",
"code": {
"id": "astnode100003781",
"name": "fallback",
"type": "ConditionalExpression",
"funcscope": "sync",
"value": "",
"paramnames": []
}
},
"order": 53
},
I'm building a documentation with references to the source so the line numbers are essential to associate them.
released in jsdoc-parse v1.2 (and jsdoc2md v1.3).. the json output now has the .meta
property containing line number, path and filename.. let me know if you have any more issues!
How would I get the position of a function or method in the code of a given file?