|
Lines 28-34
define([
Link Here
|
| 28 |
this.astManager = ASTManager; |
28 |
this.astManager = ASTManager; |
| 29 |
this.cuprovider = CUProvider; |
29 |
this.cuprovider = CUProvider; |
| 30 |
} |
30 |
} |
| 31 |
|
31 |
|
|
|
32 |
/** |
| 33 |
* Check to see if its a ES6 export declaration |
| 34 |
* @param {ASTNode} astNode - any node |
| 35 |
* @returns {boolean} whether the given node represents a export declaration |
| 36 |
* @private |
| 37 |
*/ |
| 38 |
function looksLikeExport(astNode) { |
| 39 |
return astNode.type === "ExportDefaultDeclaration" || astNode.type === "ExportNamedDeclaration" || |
| 40 |
astNode.type === "ExportAllDeclaration" || astNode.type === "ExportSpecifier"; |
| 41 |
} |
| 42 |
|
| 32 |
Objects.mixin(GenerateDocCommand.prototype, { |
43 |
Objects.mixin(GenerateDocCommand.prototype, { |
| 33 |
/** |
44 |
/** |
| 34 |
* @callback |
45 |
* @callback |
|
Lines 72-78
define([
Link Here
|
| 72 |
var template; |
83 |
var template; |
| 73 |
var start = parent.range[0]; |
84 |
var start = parent.range[0]; |
| 74 |
if(parent.type === 'FunctionDeclaration') { |
85 |
if(parent.type === 'FunctionDeclaration') { |
| 75 |
template = this._genTemplate(parent.id.name, parent.params, false, parent.range[0], text); |
86 |
var len = parent.parents.length-1; |
|
|
87 |
var funcParent = parent.parents[len]; |
| 88 |
if (funcParent && looksLikeExport(funcParent)) { |
| 89 |
template = this._genTemplate(parent.id.name, parent.params, false, funcParent.range[0], text); |
| 90 |
start = funcParent.range[0]; |
| 91 |
} else { |
| 92 |
template = this._genTemplate(parent.id.name, parent.params, false, parent.range[0], text); |
| 93 |
} |
| 76 |
} else if(parent.type === 'Property') { |
94 |
} else if(parent.type === 'Property') { |
| 77 |
template = this._genTemplate(parent.key.name ? parent.key.name : parent.key.value, parent.value.params, true, parent.range[0], text); |
95 |
template = this._genTemplate(parent.key.name ? parent.key.name : parent.key.value, parent.value.params, true, parent.range[0], text); |
| 78 |
} else if(parent.type === 'VariableDeclarator') { |
96 |
} else if(parent.type === 'VariableDeclarator') { |