Support @arg and @argument synonyms for @param JSDoc tag

- Fix #15477
This commit is contained in:
Joe Chung 2017-05-06 22:11:14 -07:00
parent d483df94ef
commit 64ea6803aa
4 changed files with 112 additions and 0 deletions

View file

@ -6502,6 +6502,8 @@ namespace ts {
case "augments":
tag = parseAugmentsTag(atToken, tagName);
break;
case "arg":
case "argument":
case "param":
tag = parseParamTag(atToken, tagName);
break;

View file

@ -241,6 +241,18 @@ namespace ts {
*/`);
parsesCorrectly("argSynonymForParamTag",
`/**
* @arg {number} name1 Description
*/`);
parsesCorrectly("argumentSynonymForParamTag",
`/**
* @argument {number} name1 Description
*/`);
parsesCorrectly("templateTag",
`/**
* @template T

View file

@ -0,0 +1,49 @@
{
"kind": "JSDocComment",
"pos": 0,
"end": 44,
"tags": {
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 27,
"atToken": {
"kind": "AtToken",
"pos": 8,
"end": 9
},
"tagName": {
"kind": "Identifier",
"pos": 9,
"end": 12,
"text": "arg"
},
"typeExpression": {
"kind": "JSDocTypeExpression",
"pos": 13,
"end": 21,
"type": {
"kind": "NumberKeyword",
"pos": 14,
"end": 20
}
},
"postParameterName": {
"kind": "Identifier",
"pos": 22,
"end": 27,
"text": "name1"
},
"parameterName": {
"kind": "Identifier",
"pos": 22,
"end": 27,
"text": "name1"
},
"comment": "Description"
},
"length": 1,
"pos": 8,
"end": 27
}
}

View file

@ -0,0 +1,49 @@
{
"kind": "JSDocComment",
"pos": 0,
"end": 49,
"tags": {
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
"end": 32,
"atToken": {
"kind": "AtToken",
"pos": 8,
"end": 9
},
"tagName": {
"kind": "Identifier",
"pos": 9,
"end": 17,
"text": "argument"
},
"typeExpression": {
"kind": "JSDocTypeExpression",
"pos": 18,
"end": 26,
"type": {
"kind": "NumberKeyword",
"pos": 19,
"end": 25
}
},
"postParameterName": {
"kind": "Identifier",
"pos": 27,
"end": 32,
"text": "name1"
},
"parameterName": {
"kind": "Identifier",
"pos": 27,
"end": 32,
"text": "name1"
},
"comment": "Description"
},
"length": 1,
"pos": 8,
"end": 32
}
}