Rename parameterName to name

This commit is contained in:
Yui T 2017-05-26 19:08:08 -07:00
parent bcf84f4958
commit 9c102461d9
14 changed files with 17 additions and 17 deletions

View file

@ -6682,7 +6682,7 @@ namespace ts {
result.preParameterName = preName; result.preParameterName = preName;
result.typeExpression = typeExpression; result.typeExpression = typeExpression;
result.postParameterName = postName; result.postParameterName = postName;
result.parameterName = postName || preName; result.name = postName || preName;
result.isBracketed = isBracketed; result.isBracketed = isBracketed;
return finishNode(result); return finishNode(result);
} }

View file

@ -2163,7 +2163,7 @@ namespace ts {
/** the parameter name, if provided *after* the type (JSDoc-standard) */ /** the parameter name, if provided *after* the type (JSDoc-standard) */
postParameterName?: Identifier; postParameterName?: Identifier;
/** the parameter name, regardless of the location it was provided */ /** the parameter name, regardless of the location it was provided */
parameterName: Identifier; name: Identifier;
isBracketed: boolean; isBracketed: boolean;
} }

View file

@ -1635,7 +1635,7 @@ namespace ts {
} }
else if (param.name.kind === SyntaxKind.Identifier) { else if (param.name.kind === SyntaxKind.Identifier) {
const name = (param.name as Identifier).text; const name = (param.name as Identifier).text;
return filter(tags, tag => tag.kind === SyntaxKind.JSDocParameterTag && tag.parameterName.text === name); return filter(tags, tag => tag.kind === SyntaxKind.JSDocParameterTag && tag.name.text === name);
} }
else { else {
// TODO: it's a destructured parameter, so it should look up an "object type" series of multiple lines // TODO: it's a destructured parameter, so it should look up an "object type" series of multiple lines
@ -1646,7 +1646,7 @@ namespace ts {
/** Does the opposite of `getJSDocParameterTags`: given a JSDoc parameter, finds the parameter corresponding to it. */ /** Does the opposite of `getJSDocParameterTags`: given a JSDoc parameter, finds the parameter corresponding to it. */
export function getParameterFromJSDoc(node: JSDocParameterTag): ParameterDeclaration | undefined { export function getParameterFromJSDoc(node: JSDocParameterTag): ParameterDeclaration | undefined {
const name = node.parameterName.text; const name = node.name.text;
const grandParent = node.parent!.parent!; const grandParent = node.parent!.parent!;
Debug.assert(node.parent!.kind === SyntaxKind.JSDocComment); Debug.assert(node.parent!.kind === SyntaxKind.JSDocComment);
if (!isFunctionLike(grandParent)) { if (!isFunctionLike(grandParent)) {

View file

@ -34,7 +34,7 @@
"end": 27, "end": 27,
"text": "name1" "text": "name1"
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 22, "pos": 22,
"end": 27, "end": 27,

View file

@ -34,7 +34,7 @@
"end": 32, "end": 32,
"text": "name1" "text": "name1"
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 27, "pos": 27,
"end": 32, "end": 32,

View file

@ -34,7 +34,7 @@
"end": 29, "end": 29,
"text": "name1" "text": "name1"
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 24, "pos": 24,
"end": 29, "end": 29,

View file

@ -34,7 +34,7 @@
"end": 29, "end": 29,
"text": "name1" "text": "name1"
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 24, "pos": 24,
"end": 29, "end": 29,

View file

@ -34,7 +34,7 @@
"end": 30, "end": 30,
"text": "name1" "text": "name1"
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 25, "pos": 25,
"end": 30, "end": 30,

View file

@ -34,7 +34,7 @@
"end": 31, "end": 31,
"text": "name1" "text": "name1"
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 26, "pos": 26,
"end": 31, "end": 31,

View file

@ -34,7 +34,7 @@
"end": 28 "end": 28
} }
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 15, "pos": 15,
"end": 20, "end": 20,

View file

@ -34,7 +34,7 @@
"end": 28 "end": 28
} }
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 15, "pos": 15,
"end": 20, "end": 20,

View file

@ -24,7 +24,7 @@
"end": 18, "end": 18,
"text": "foo" "text": "foo"
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 15, "pos": 15,
"end": 18, "end": 18,

View file

@ -34,7 +34,7 @@
"end": 29, "end": 29,
"text": "name1" "text": "name1"
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 24, "pos": 24,
"end": 29, "end": 29,
@ -73,7 +73,7 @@
"end": 55, "end": 55,
"text": "name2" "text": "name2"
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 50, "pos": 50,
"end": 55, "end": 55,

View file

@ -34,7 +34,7 @@
"end": 29, "end": 29,
"text": "name1" "text": "name1"
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 24, "pos": 24,
"end": 29, "end": 29,
@ -73,7 +73,7 @@
"end": 51, "end": 51,
"text": "name2" "text": "name2"
}, },
"parameterName": { "name": {
"kind": "Identifier", "kind": "Identifier",
"pos": 46, "pos": 46,
"end": 51, "end": 51,