Rename parameterName to name
This commit is contained in:
parent
bcf84f4958
commit
9c102461d9
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)) {
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
"end": 28
|
"end": 28
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"parameterName": {
|
"name": {
|
||||||
"kind": "Identifier",
|
"kind": "Identifier",
|
||||||
"pos": 15,
|
"pos": 15,
|
||||||
"end": 20,
|
"end": 20,
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
"end": 28
|
"end": 28
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"parameterName": {
|
"name": {
|
||||||
"kind": "Identifier",
|
"kind": "Identifier",
|
||||||
"pos": 15,
|
"pos": 15,
|
||||||
"end": 20,
|
"end": 20,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue