Merge pull request #15246 from ctrlaltdavid/M21846

Case 21846: Make JSDoc use "@returns {Signal}" instead of "@signal"
This commit is contained in:
Shannon Romano 2019-03-22 09:51:28 -07:00 committed by GitHub
commit 13e8baeff9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 26 deletions

View file

@ -13,8 +13,8 @@ var self = this;
<code><?js= (kind === 'class' ? 'new ' : '') + name + (data.signatureHead || '') ?></code></a>
</td>
<td>
<?js if (data.summary) { ?>
<?js= summary ?>
<?js if (data.description) { ?>
<?js= description ?>
<?js= this.partial('details.tmpl', data) ?>
<?js } else { ?>
<?js= this.partial('details.tmpl', data) ?>

View file

@ -121,23 +121,14 @@ exports.handlers = {
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
exports.defineTags = function (dictionary) {
@ -168,14 +159,5 @@ exports.defineTags = function (dictionary) {
doclet.hifiServerEntity = true;
}
});
// @signal
dictionary.defineTag("signal", {
mustHaveValue: true,
onTagged: function(doclet, tag) {
setDocletKindToTitle(doclet, tag);
setDocletNameToValue(doclet, tag);
}
});
};
};