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
10 changes: 6 additions & 4 deletions src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7017,10 +7017,12 @@ namespace ts {
comments.push(text);
indent += text.length;
}
if (initialMargin) {
if (initialMargin !== undefined) {
// jump straight to saving comments if there is some initial indentation
pushComment(initialMargin);
state = JSDocState.SavingComments;
if (initialMargin !== "") {
pushComment(initialMargin);
}
state = JSDocState.SawAsterisk;
}
let tok = token() as JSDocSyntaxKind;
loop: while (true) {
Expand Down Expand Up @@ -7558,7 +7560,7 @@ namespace ts {
const typeParameter = <TypeParameterDeclaration>createNode(SyntaxKind.TypeParameter);
typeParameter.name = parseJSDocIdentifierName(Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);
finishNode(typeParameter);
skipWhitespace();
skipWhitespaceOrAsterisk();
typeParameters.push(typeParameter);
} while (parseOptionalJsdoc(SyntaxKind.CommaToken));

Expand Down
44 changes: 25 additions & 19 deletions tests/baselines/reference/quickInfoDisplayPartsParameters.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts",
"position": 9
"position": 33
},
"quickInfo": {
"kind": "function",
"kindModifiers": "",
"textSpan": {
"start": 9,
"start": 33,
"length": 3
},
"displayParts": [
Expand Down Expand Up @@ -153,19 +153,25 @@
"kind": "keyword"
}
],
"documentation": []
"documentation": [],
"tags": [
{
"name": "return",
"text": "*crunch*"
}
]
}
},
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts",
"position": 13
"position": 37
},
"quickInfo": {
"kind": "parameter",
"kindModifiers": "",
"textSpan": {
"start": 13,
"start": 37,
"length": 5
},
"displayParts": [
Expand Down Expand Up @@ -208,13 +214,13 @@
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts",
"position": 28
"position": 52
},
"quickInfo": {
"kind": "parameter",
"kindModifiers": "",
"textSpan": {
"start": 28,
"start": 52,
"length": 13
},
"displayParts": [
Expand Down Expand Up @@ -257,13 +263,13 @@
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts",
"position": 52
"position": 76
},
"quickInfo": {
"kind": "parameter",
"kindModifiers": "",
"textSpan": {
"start": 52,
"start": 76,
"length": 20
},
"displayParts": [
Expand Down Expand Up @@ -306,13 +312,13 @@
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts",
"position": 87
"position": 111
},
"quickInfo": {
"kind": "parameter",
"kindModifiers": "",
"textSpan": {
"start": 87,
"start": 111,
"length": 9
},
"displayParts": [
Expand Down Expand Up @@ -363,13 +369,13 @@
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts",
"position": 114
"position": 138
},
"quickInfo": {
"kind": "parameter",
"kindModifiers": "",
"textSpan": {
"start": 114,
"start": 138,
"length": 5
},
"displayParts": [
Expand Down Expand Up @@ -412,13 +418,13 @@
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts",
"position": 135
"position": 159
},
"quickInfo": {
"kind": "parameter",
"kindModifiers": "",
"textSpan": {
"start": 135,
"start": 159,
"length": 13
},
"displayParts": [
Expand Down Expand Up @@ -461,13 +467,13 @@
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts",
"position": 164
"position": 188
},
"quickInfo": {
"kind": "parameter",
"kindModifiers": "",
"textSpan": {
"start": 164,
"start": 188,
"length": 20
},
"displayParts": [
Expand Down Expand Up @@ -510,13 +516,13 @@
{
"marker": {
"fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts",
"position": 200
"position": 224
},
"quickInfo": {
"kind": "parameter",
"kindModifiers": "",
"textSpan": {
"start": 200,
"start": 224,
"length": 9
},
"displayParts": [
Expand Down
15 changes: 8 additions & 7 deletions tests/cases/fourslash/quickInfoDisplayPartsParameters.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/// <reference path='fourslash.ts'/>

////function /*1*/foo(/*2*/param: string, /*3*/optionalParam?: string, /*4*/paramWithInitializer = "hello", .../*5*/restParam: string[]) {
//// /*6*/param = "Hello";
//// /*7*/optionalParam = "World";
//// /*8*/paramWithInitializer = "Hello";
//// /*9*/restParam[0] = "World";
////}
//// /** @return *crunch* */
//// function /*1*/foo(/*2*/param: string, /*3*/optionalParam?: string, /*4*/paramWithInitializer = "hello", .../*5*/restParam: string[]) {
//// /*6*/param = "Hello";
//// /*7*/optionalParam = "World";
//// /*8*/paramWithInitializer = "Hello";
//// /*9*/restParam[0] = "World";
//// }

verify.baselineQuickInfo();
verify.baselineQuickInfo();