mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-13 00:36:26 +02:00
Merge pull request #15246 from ctrlaltdavid/M21846
Case 21846: Make JSDoc use "@returns {Signal}" instead of "@signal"
This commit is contained in:
commit
13e8baeff9
2 changed files with 8 additions and 26 deletions
|
@ -13,8 +13,8 @@ var self = this;
|
||||||
<code><?js= (kind === 'class' ? 'new ' : '') + name + (data.signatureHead || '') ?></code></a>
|
<code><?js= (kind === 'class' ? 'new ' : '') + name + (data.signatureHead || '') ?></code></a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?js if (data.summary) { ?>
|
<?js if (data.description) { ?>
|
||||||
<?js= summary ?>
|
<?js= description ?>
|
||||||
<?js= this.partial('details.tmpl', data) ?>
|
<?js= this.partial('details.tmpl', data) ?>
|
||||||
<?js } else { ?>
|
<?js } else { ?>
|
||||||
<?js= this.partial('details.tmpl', data) ?>
|
<?js= this.partial('details.tmpl', data) ?>
|
||||||
|
|
|
@ -121,23 +121,14 @@ exports.handlers = {
|
||||||
e.doclet.description = (e.doclet.description ? e.doclet.description : "") + availableIn;
|
e.doclet.description = (e.doclet.description ? e.doclet.description : "") + availableIn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e.doclet.kind === "function" && e.doclet.returns && e.doclet.returns[0].type
|
||||||
|
&& e.doclet.returns[0].type.names[0] === "Signal") {
|
||||||
|
e.doclet.kind = "signal";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Functions for adding @signal custom tag
|
|
||||||
/** @private */
|
|
||||||
function setDocletKindToTitle(doclet, tag) {
|
|
||||||
doclet.addTag( 'kind', tag.title );
|
|
||||||
}
|
|
||||||
|
|
||||||
function setDocletNameToValue(doclet, tag) {
|
|
||||||
if (tag.value && tag.value.description) { // as in a long tag
|
|
||||||
doclet.addTag('name', tag.value.description);
|
|
||||||
} else if (tag.text) { // or a short tag
|
|
||||||
doclet.addTag('name', tag.text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define custom hifi tags here
|
// Define custom hifi tags here
|
||||||
exports.defineTags = function (dictionary) {
|
exports.defineTags = function (dictionary) {
|
||||||
|
|
||||||
|
@ -168,14 +159,5 @@ exports.defineTags = function (dictionary) {
|
||||||
doclet.hifiServerEntity = true;
|
doclet.hifiServerEntity = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// @signal
|
|
||||||
dictionary.defineTag("signal", {
|
|
||||||
mustHaveValue: true,
|
|
||||||
onTagged: function(doclet, tag) {
|
|
||||||
setDocletKindToTitle(doclet, tag);
|
|
||||||
setDocletNameToValue(doclet, tag);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue