Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20034,7 +20034,7 @@ namespace ts {
function checkJSDocAugmentsTag(node: JSDocAugmentsTag): void {
const classLike = getJSDocHost(node);
if (!isClassDeclaration(classLike) && !isClassExpression(classLike)) {
error(classLike, Diagnostics.JSDoc_augments_is_not_attached_to_a_class_declaration);
error(classLike, Diagnostics.JSDoc_0_is_not_attached_to_a_class, idText(node.tagName));
return;
}

Expand All @@ -20049,7 +20049,7 @@ namespace ts {
if (extend) {
const className = getIdentifierFromEntityNameExpression(extend.expression);
if (className && name.escapedText !== className.escapedText) {
error(name, Diagnostics.JSDoc_augments_0_does_not_match_the_extends_1_clause, idText(name), idText(className));
error(name, Diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause, idText(node.tagName), idText(name), idText(className));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3519,11 +3519,11 @@
"category": "Error",
"code": 8021
},
"JSDoc '@augments' is not attached to a class declaration.": {
"JSDoc '@{0}' is not attached to a class.": {
"category": "Error",
"code": 8022
},
"JSDoc '@augments {0}' does not match the 'extends {1}' clause.": {
"JSDoc '@{0} {1}' does not match the 'extends {2}' clause.": {
"category": "Error",
"code": 8023
},
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/jsdocAugments_notAClass.errors.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/b.js(3,10): error TS8022: JSDoc '@augments' is not attached to a class declaration.
/b.js(3,10): error TS8022: JSDoc '@augments' is not attached to a class.


==== /b.js (1 errors) ====
class A {}
/** @augments A */
function b() {}
~
!!! error TS8022: JSDoc '@augments' is not attached to a class declaration.
!!! error TS8022: JSDoc '@augments' is not attached to a class.