Skip to content

Commit

Permalink
feat(lineNumber): enable from comment
Browse files Browse the repository at this point in the history
  • Loading branch information
h13i32maru committed Jun 11, 2017
1 parent abd3d34 commit c997a54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esdoc",
"version": "1.0.0-alpha.7",
"version": "1.0.0-alpha.8",
"description": "Good Documentation Generator For JavaScript",
"author": {
"name": "h13i32maru",
Expand Down
11 changes: 8 additions & 3 deletions src/Doc/AbstractDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,14 @@ export default class AbstractDoc {
* decide `lineNumber`.
*/
_$lineNumber() {
const node = this._node;
if (node.loc) {
this._value.lineNumber = node.loc.start.line;
const tag = this._find(['@lineNumber']);
if (tag) {
this._value.lineNumber = parseInt(tag.tagValue, 10);
} else {
const node = this._node;
if (node.loc) {
this._value.lineNumber = node.loc.start.line;
}
}
}

Expand Down

0 comments on commit c997a54

Please sign in to comment.