From ddf17e0a76cfeb57c76a9a3d7bce3cfea3d51294 Mon Sep 17 00:00:00 2001 From: csigs Date: Fri, 18 Feb 2022 02:49:24 -0800 Subject: [PATCH 1/5] LEGO: Merge pull request 47948 LEGO: Merge pull request 47948 --- .../diagnosticMessages.generated.json.lcl | 18 +++---- .../diagnosticMessages.generated.json.lcl | 54 +++++++++++++++---- .../diagnosticMessages.generated.json.lcl | 54 +++++++++++++++---- .../diagnosticMessages.generated.json.lcl | 18 +++---- .../diagnosticMessages.generated.json.lcl | 18 +++---- .../diagnosticMessages.generated.json.lcl | 54 +++++++++++++++---- .../diagnosticMessages.generated.json.lcl | 18 +++---- .../diagnosticMessages.generated.json.lcl | 18 +++---- .../diagnosticMessages.generated.json.lcl | 18 +++---- .../diagnosticMessages.generated.json.lcl | 18 +++---- 10 files changed, 198 insertions(+), 90 deletions(-) diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index 7df963646c6..28c4377a71e 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -546,15 +546,6 @@ - - - - - - - - - @@ -13806,6 +13797,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index 770080a391f..7e45b9cd9fa 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -555,15 +555,6 @@ - - - - - - - - - @@ -4569,6 +4560,24 @@ + + + + + + + + + + + + + + + + + + @@ -11034,6 +11043,15 @@ + + + + + + + + + @@ -13788,6 +13806,15 @@ + + + + + + + + + @@ -16335,6 +16362,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index 9d76364a5c0..14f377492a2 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -555,15 +555,6 @@ - - - - - - - - - @@ -4572,6 +4563,24 @@ + + + + + + + + + + + + + + + + + + @@ -11037,6 +11046,15 @@ + + + + + + + + + @@ -13791,6 +13809,15 @@ + + + + + + + + + @@ -16338,6 +16365,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index 9403acca71a..72592161c79 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -555,15 +555,6 @@ - - - - - - - - - @@ -13818,6 +13809,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index cce6cbb1c40..799121ebb3d 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -546,15 +546,6 @@ - - - - - - - - - @@ -13806,6 +13797,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index 1fb3b24d0f4..d0abdfd1568 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -546,15 +546,6 @@ - - - - - - - - - @@ -4560,6 +4551,24 @@ + + + + + + + + + + + + + + + + + + @@ -11025,6 +11034,15 @@ + + + + + + + + + @@ -13779,6 +13797,15 @@ + + + + + + + + + @@ -16326,6 +16353,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index bb9cc7e545b..d53c2aa1383 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -546,15 +546,6 @@ - - - - - - - - - @@ -13806,6 +13797,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 5bf1bb8d7b8..6bef0d778ab 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -539,15 +539,6 @@ - - - - - - - - - @@ -13793,6 +13784,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index 1a2e9a35490..55a70f8d5ad 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -539,15 +539,6 @@ - - - - - - - - - @@ -13796,6 +13787,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index fb4d3e9e9d9..81d47b99142 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -545,15 +545,6 @@ - - - - - - - - - @@ -13805,6 +13796,15 @@ + + + + + + + + + From db226a80e8d951ad331d6b82bc933009c89866a8 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 18 Feb 2022 20:03:48 +0100 Subject: [PATCH 2/5] Remove unnecessary check in getNarrowableTypeForReference (#47953) * Remove unnecessary check in getNarrowableTypeForReference * Add regression test --- src/compiler/checker.ts | 2 +- tests/baselines/reference/correlatedUnions.js | 53 +++++++++++++ .../reference/correlatedUnions.symbols | 78 +++++++++++++++++++ .../reference/correlatedUnions.types | 71 +++++++++++++++++ tests/cases/compiler/correlatedUnions.ts | 28 +++++++ 5 files changed, 231 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index dec85fc4e84..88798760f3a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -25081,7 +25081,7 @@ namespace ts { const substituteConstraints = !(checkMode && checkMode & CheckMode.Inferential) && someType(type, isGenericTypeWithUnionConstraint) && (isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode)); - return substituteConstraints ? mapType(type, t => t.flags & TypeFlags.Instantiable && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t) : type; + return substituteConstraints ? mapType(type, t => t.flags & TypeFlags.Instantiable ? getBaseConstraintOrType(t) : t) : type; } function isExportOrExportExpression(location: Node) { diff --git a/tests/baselines/reference/correlatedUnions.js b/tests/baselines/reference/correlatedUnions.js index b42a48c68a0..f1e13f44170 100644 --- a/tests/baselines/reference/correlatedUnions.js +++ b/tests/baselines/reference/correlatedUnions.js @@ -181,6 +181,34 @@ function f3(funcs: Funcs, key: K, arg: ArgMap[K]) { function f4(x: Funcs[keyof ArgMap], y: Funcs[K]) { x = y; } + +// Repro from #47890 + +interface MyObj { + someKey: { + name: string; + } + someOtherKey: { + name: number; + } +} + +const ref: MyObj = { + someKey: { name: "" }, + someOtherKey: { name: 42 } +}; + +function func(k: K): MyObj[K]['name'] | undefined { + const myObj: Partial[K] = ref[k]; + if (myObj) { + return myObj.name; + } + const myObj2: Partial[keyof MyObj] = ref[k]; + if (myObj2) { + return myObj2.name; + } + return undefined; +} //// [correlatedUnions.js] @@ -282,6 +310,21 @@ function f3(funcs, key, arg) { function f4(x, y) { x = y; } +var ref = { + someKey: { name: "" }, + someOtherKey: { name: 42 } +}; +function func(k) { + var myObj = ref[k]; + if (myObj) { + return myObj.name; + } + var myObj2 = ref[k]; + if (myObj2) { + return myObj2.name; + } + return undefined; +} //// [correlatedUnions.d.ts] @@ -398,3 +441,13 @@ declare function f1(funcs: Funcs, key: K, arg: ArgMap[K] declare function f2(funcs: Funcs, key: K, arg: ArgMap[K]): void; declare function f3(funcs: Funcs, key: K, arg: ArgMap[K]): void; declare function f4(x: Funcs[keyof ArgMap], y: Funcs[K]): void; +interface MyObj { + someKey: { + name: string; + }; + someOtherKey: { + name: number; + }; +} +declare const ref: MyObj; +declare function func(k: K): MyObj[K]['name'] | undefined; diff --git a/tests/baselines/reference/correlatedUnions.symbols b/tests/baselines/reference/correlatedUnions.symbols index 040c3983e95..16fa17e1a4f 100644 --- a/tests/baselines/reference/correlatedUnions.symbols +++ b/tests/baselines/reference/correlatedUnions.symbols @@ -675,3 +675,81 @@ function f4(x: Funcs[keyof ArgMap], y: Funcs[K]) { >y : Symbol(y, Decl(correlatedUnions.ts, 179, 59)) } +// Repro from #47890 + +interface MyObj { +>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1)) + + someKey: { +>someKey : Symbol(MyObj.someKey, Decl(correlatedUnions.ts, 185, 17)) + + name: string; +>name : Symbol(name, Decl(correlatedUnions.ts, 186, 14)) + } + someOtherKey: { +>someOtherKey : Symbol(MyObj.someOtherKey, Decl(correlatedUnions.ts, 188, 5)) + + name: number; +>name : Symbol(name, Decl(correlatedUnions.ts, 189, 19)) + } +} + +const ref: MyObj = { +>ref : Symbol(ref, Decl(correlatedUnions.ts, 194, 5)) +>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1)) + + someKey: { name: "" }, +>someKey : Symbol(someKey, Decl(correlatedUnions.ts, 194, 20)) +>name : Symbol(name, Decl(correlatedUnions.ts, 195, 14)) + + someOtherKey: { name: 42 } +>someOtherKey : Symbol(someOtherKey, Decl(correlatedUnions.ts, 195, 26)) +>name : Symbol(name, Decl(correlatedUnions.ts, 196, 19)) + +}; + +function func(k: K): MyObj[K]['name'] | undefined { +>func : Symbol(func, Decl(correlatedUnions.ts, 197, 2)) +>K : Symbol(K, Decl(correlatedUnions.ts, 199, 14)) +>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1)) +>k : Symbol(k, Decl(correlatedUnions.ts, 199, 37)) +>K : Symbol(K, Decl(correlatedUnions.ts, 199, 14)) +>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1)) +>K : Symbol(K, Decl(correlatedUnions.ts, 199, 14)) + + const myObj: Partial[K] = ref[k]; +>myObj : Symbol(myObj, Decl(correlatedUnions.ts, 200, 9)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1)) +>K : Symbol(K, Decl(correlatedUnions.ts, 199, 14)) +>ref : Symbol(ref, Decl(correlatedUnions.ts, 194, 5)) +>k : Symbol(k, Decl(correlatedUnions.ts, 199, 37)) + + if (myObj) { +>myObj : Symbol(myObj, Decl(correlatedUnions.ts, 200, 9)) + + return myObj.name; +>myObj.name : Symbol(name, Decl(correlatedUnions.ts, 186, 14), Decl(correlatedUnions.ts, 189, 19)) +>myObj : Symbol(myObj, Decl(correlatedUnions.ts, 200, 9)) +>name : Symbol(name, Decl(correlatedUnions.ts, 186, 14), Decl(correlatedUnions.ts, 189, 19)) + } + const myObj2: Partial[keyof MyObj] = ref[k]; +>myObj2 : Symbol(myObj2, Decl(correlatedUnions.ts, 204, 9)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1)) +>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1)) +>ref : Symbol(ref, Decl(correlatedUnions.ts, 194, 5)) +>k : Symbol(k, Decl(correlatedUnions.ts, 199, 37)) + + if (myObj2) { +>myObj2 : Symbol(myObj2, Decl(correlatedUnions.ts, 204, 9)) + + return myObj2.name; +>myObj2.name : Symbol(name, Decl(correlatedUnions.ts, 186, 14), Decl(correlatedUnions.ts, 189, 19)) +>myObj2 : Symbol(myObj2, Decl(correlatedUnions.ts, 204, 9)) +>name : Symbol(name, Decl(correlatedUnions.ts, 186, 14), Decl(correlatedUnions.ts, 189, 19)) + } + return undefined; +>undefined : Symbol(undefined) +} + diff --git a/tests/baselines/reference/correlatedUnions.types b/tests/baselines/reference/correlatedUnions.types index ae141337576..3a4d9500707 100644 --- a/tests/baselines/reference/correlatedUnions.types +++ b/tests/baselines/reference/correlatedUnions.types @@ -624,3 +624,74 @@ function f4(x: Funcs[keyof ArgMap], y: Funcs[K]) { >y : Funcs[K] } +// Repro from #47890 + +interface MyObj { + someKey: { +>someKey : { name: string; } + + name: string; +>name : string + } + someOtherKey: { +>someOtherKey : { name: number; } + + name: number; +>name : number + } +} + +const ref: MyObj = { +>ref : MyObj +>{ someKey: { name: "" }, someOtherKey: { name: 42 }} : { someKey: { name: string; }; someOtherKey: { name: number; }; } + + someKey: { name: "" }, +>someKey : { name: string; } +>{ name: "" } : { name: string; } +>name : string +>"" : "" + + someOtherKey: { name: 42 } +>someOtherKey : { name: number; } +>{ name: 42 } : { name: number; } +>name : number +>42 : 42 + +}; + +function func(k: K): MyObj[K]['name'] | undefined { +>func : (k: K) => MyObj[K]['name'] | undefined +>k : K + + const myObj: Partial[K] = ref[k]; +>myObj : Partial[K] +>ref[k] : MyObj[K] +>ref : MyObj +>k : K + + if (myObj) { +>myObj : Partial[K] + + return myObj.name; +>myObj.name : string | number +>myObj : { name: string; } | { name: number; } +>name : string | number + } + const myObj2: Partial[keyof MyObj] = ref[k]; +>myObj2 : { name: string; } | { name: number; } | undefined +>ref[k] : { name: string; } | { name: number; } +>ref : MyObj +>k : K + + if (myObj2) { +>myObj2 : { name: string; } | { name: number; } + + return myObj2.name; +>myObj2.name : string | number +>myObj2 : { name: string; } | { name: number; } +>name : string | number + } + return undefined; +>undefined : undefined +} + diff --git a/tests/cases/compiler/correlatedUnions.ts b/tests/cases/compiler/correlatedUnions.ts index 546d511034b..f6b4086f03f 100644 --- a/tests/cases/compiler/correlatedUnions.ts +++ b/tests/cases/compiler/correlatedUnions.ts @@ -183,3 +183,31 @@ function f3(funcs: Funcs, key: K, arg: ArgMap[K]) { function f4(x: Funcs[keyof ArgMap], y: Funcs[K]) { x = y; } + +// Repro from #47890 + +interface MyObj { + someKey: { + name: string; + } + someOtherKey: { + name: number; + } +} + +const ref: MyObj = { + someKey: { name: "" }, + someOtherKey: { name: 42 } +}; + +function func(k: K): MyObj[K]['name'] | undefined { + const myObj: Partial[K] = ref[k]; + if (myObj) { + return myObj.name; + } + const myObj2: Partial[keyof MyObj] = ref[k]; + if (myObj2) { + return myObj2.name; + } + return undefined; +} From 92204983f4c08b3b9ef03bd72dba0c0346690b85 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 18 Feb 2022 15:09:15 -0500 Subject: [PATCH 3/5] Standardized aka.ms links for tsc and tsconfig (#47129) * Standardized aka.ms links for tsc and tsconfig * Three missed baselines * Three last baselines * Went back to aka.ms/tsconfig --- src/compiler/commandLineParser.ts | 2 +- src/compiler/diagnosticMessages.json | 3 +-- src/executeCommandLine/executeCommandLine.ts | 6 +++--- .../tsConfig/Default initialized TSConfig/tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../Initialized TSConfig with files options/tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../does-not-add-color-when-NO_COLOR-is-set.js | 2 +- ...OutputsSkipped-when-host-can't-provide-terminal-width.js | 2 +- ...elp-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js | 2 +- .../declarationDir-is-specified.js | 2 +- .../when-outDir-and-declarationDir-is-specified.js | 2 +- .../when-outDir-is-specified.js | 2 +- .../with-outFile.js | 2 +- ...tDir-or-outFile-is-specified-with-declaration-enabled.js | 2 +- .../without-outDir-or-outFile-is-specified.js | 2 +- 21 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 89d131508cb..f04945739b5 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -2498,7 +2498,7 @@ namespace ts { const result: string[] = []; result.push(`{`); result.push(`${tab}"compilerOptions": {`); - result.push(`${tab}${tab}/* ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file)} */`); + result.push(`${tab}${tab}/* ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)} */`); result.push(""); // Print out each row, aligning all the descriptions on the same column. for (const entry of entries) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 0418b54a2ed..de7903443b0 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -5852,7 +5852,6 @@ "code": 6930 }, - "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", "code": 7005 @@ -6911,7 +6910,7 @@ "category": "Message", "code": 95109 }, - "Visit https://aka.ms/tsconfig.json to read more about this file": { + "Visit https://aka.ms/tsconfig to read more about this file": { "category": "Message", "code": 95110 }, diff --git a/src/executeCommandLine/executeCommandLine.ts b/src/executeCommandLine/executeCommandLine.ts index cbdba05b3ac..a7d776acd80 100644 --- a/src/executeCommandLine/executeCommandLine.ts +++ b/src/executeCommandLine/executeCommandLine.ts @@ -396,7 +396,7 @@ namespace ts { output = [ ...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.COMMAND_LINE_FLAGS), cliCommands, /*subCategory*/ false, /* beforeOptionsDescription */ undefined, /* afterOptionsDescription*/ undefined), - ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.COMMON_COMPILER_OPTIONS), configOpts, /*subCategory*/ false, /* beforeOptionsDescription */ undefined, formatMessage(/*_dummy*/ undefined, Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsconfig-reference")) + ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.COMMON_COMPILER_OPTIONS), configOpts, /*subCategory*/ false, /* beforeOptionsDescription */ undefined, formatMessage(/*_dummy*/ undefined, Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsc")) ]; for (const line of output) { @@ -414,7 +414,7 @@ namespace ts { function printAllHelp(sys: System, compilerOptions: readonly CommandLineOption[], buildOptions: readonly CommandLineOption[], watchOptions: readonly CommandLineOption[]) { let output: string[] = [...getHeader(sys,`${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)]; - output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.ALL_COMPILER_OPTIONS), compilerOptions, /*subCategory*/ true, /* beforeOptionsDescription */ undefined, formatMessage(/*_dummy*/ undefined, Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsconfig-reference"))]; + output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.ALL_COMPILER_OPTIONS), compilerOptions, /*subCategory*/ true, /* beforeOptionsDescription */ undefined, formatMessage(/*_dummy*/ undefined, Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsc"))]; output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.WATCH_OPTIONS), watchOptions, /*subCategory*/ false, getDiagnosticText(Diagnostics.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon))]; output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.BUILD_OPTIONS), buildOptions, /*subCategory*/ false, formatMessage(/*_dummy*/ undefined, Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds"))]; for (const line of output) { @@ -1061,7 +1061,7 @@ namespace ts { sys.writeFile(file, generateTSConfig(options, fileNames, sys.newLine)); const output: string[] = [sys.newLine, ...getHeader(sys,"Created a new tsconfig.json with:")]; output.push(getCompilerOptionsDiffValue(options, sys.newLine) + sys.newLine + sys.newLine); - output.push(`You can learn more at https://aka.ms/tsconfig.json` + sys.newLine); + output.push(`You can learn more at https://aka.ms/tsconfig` + sys.newLine); for (const line of output) { sys.write(line); } diff --git a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json index 56794816baf..57e9a2b7451 100644 --- a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with advanced options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with advanced options/tsconfig.json index 72a3d537f7a..bfa516dee13 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with advanced options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with advanced options/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json index df5bf12f3e9..eb149f81bf6 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json index 9f8f66fa059..8380fa45a09 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json index 9fb8f59be48..894c1e7e6d7 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json index 5bb5a17baa7..0adbea873c5 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json index 56794816baf..57e9a2b7451 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json index 9cc8746737d..6cec9bab660 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json index 865e5f44b27..b26e448a84b 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/does-not-add-color-when-NO_COLOR-is-set.js index ab599544b79..be6c3dace7f 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/does-not-add-color-when-NO_COLOR-is-set.js @@ -145,7 +145,7 @@ Emit additional JavaScript to ease support for importing CommonJS modules. This type: boolean default: false -You can learn about all of the compiler options at https://aka.ms/tsconfig-reference +You can learn about all of the compiler options at https://aka.ms/tsc exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped diff --git a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index 61b34a30544..b4bc812a9da 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -145,7 +145,7 @@ Emit additional JavaScript to ease support for importing CommonJS modules. This type: boolean default: false -You can learn about all of the compiler options at https://aka.ms/tsconfig-reference +You can learn about all of the compiler options at https://aka.ms/tsc exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped diff --git a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index 61b34a30544..b4bc812a9da 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -145,7 +145,7 @@ Emit additional JavaScript to ease support for importing CommonJS modules. This type: boolean default: false -You can learn about all of the compiler options at https://aka.ms/tsconfig-reference +You can learn about all of the compiler options at https://aka.ms/tsc exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js index 620e1d32717..f3473b25e37 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js @@ -21,7 +21,7 @@ interface Array { length: number; [n: number]: T; } //// [/user/username/projects/myproject/tsconfig.json] { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js index 729c53bff01..e7d593a417c 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js @@ -21,7 +21,7 @@ interface Array { length: number; [n: number]: T; } //// [/user/username/projects/myproject/tsconfig.json] { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-is-specified.js index 818170668e7..581a85f5183 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-is-specified.js @@ -21,7 +21,7 @@ interface Array { length: number; [n: number]: T; } //// [/user/username/projects/myproject/tsconfig.json] { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/with-outFile.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/with-outFile.js index 8ffe44ddab3..fd153355bec 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/with-outFile.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/with-outFile.js @@ -21,7 +21,7 @@ interface Array { length: number; [n: number]: T; } //// [/user/username/projects/myproject/tsconfig.json] { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified-with-declaration-enabled.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified-with-declaration-enabled.js index 9850737466e..1f562d6203f 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified-with-declaration-enabled.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified-with-declaration-enabled.js @@ -21,7 +21,7 @@ interface Array { length: number; [n: number]: T; } //// [/user/username/projects/myproject/tsconfig.json] { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified.js index 3e23fb6d139..d3c9002df9d 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified.js @@ -21,7 +21,7 @@ interface Array { length: number; [n: number]: T; } //// [/user/username/projects/myproject/tsconfig.json] { "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Enable incremental compilation */ From 2477ff915e1ebb7f987018f66e345da2e8dd7c21 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 18 Feb 2022 13:30:07 -0800 Subject: [PATCH 4/5] Fix object.assign first param constraint (#40909) * fixes #35621 * undo changes to generated file * undo whitespace fixup attempt * update baselines Co-authored-by: TrejGun --- src/lib/es2015.core.d.ts | 6 ++-- .../conditionalTypeDoesntSpinForever.types | 32 +++++++++---------- ...InternalTypesProduceUniqueTypeParams.types | 8 ++--- .../reference/es2018ObjectAssign.types | 4 +-- .../intersectionsAndEmptyObjects.types | 4 +-- .../unionAndIntersectionInference1.types | 4 +-- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/lib/es2015.core.d.ts b/src/lib/es2015.core.d.ts index 8026b39455a..b42880c8ece 100644 --- a/src/lib/es2015.core.d.ts +++ b/src/lib/es2015.core.d.ts @@ -263,7 +263,7 @@ interface ObjectConstructor { * @param target The target object to copy to. * @param source The source object from which to copy properties. */ - assign(target: T, source: U): T & U; + assign(target: T, source: U): T & U; /** * Copy the values of all of the enumerable own properties from one or more source objects to a @@ -272,7 +272,7 @@ interface ObjectConstructor { * @param source1 The first source object from which to copy properties. * @param source2 The second source object from which to copy properties. */ - assign(target: T, source1: U, source2: V): T & U & V; + assign(target: T, source1: U, source2: V): T & U & V; /** * Copy the values of all of the enumerable own properties from one or more source objects to a @@ -282,7 +282,7 @@ interface ObjectConstructor { * @param source2 The second source object from which to copy properties. * @param source3 The third source object from which to copy properties. */ - assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; /** * Copy the values of all of the enumerable own properties from one or more source objects to a diff --git a/tests/baselines/reference/conditionalTypeDoesntSpinForever.types b/tests/baselines/reference/conditionalTypeDoesntSpinForever.types index e60be08b85d..c1eee6deff8 100644 --- a/tests/baselines/reference/conditionalTypeDoesntSpinForever.types +++ b/tests/baselines/reference/conditionalTypeDoesntSpinForever.types @@ -69,9 +69,9 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {name: instance as TYPE}) as SO_FAR & {name: TYPE} : SO_FAR & { name: TYPE; } >Object.assign({}, soFar, {name: instance as TYPE}) : SO_FAR & { name: TYPE; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{name: instance as TYPE} : { name: TYPE; } @@ -123,9 +123,9 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString} : { storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; } @@ -147,9 +147,9 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{storedAs: PubSubRecordIsStoredInRedisAsA.redisHash} : { storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; } @@ -213,9 +213,9 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {identifier: instance as TYPE}) as SO_FAR & {identifier: TYPE} : SO_FAR & { identifier: TYPE; } >Object.assign({}, soFar, {identifier: instance as TYPE}) : SO_FAR & { identifier: TYPE; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{identifier: instance as TYPE} : { identifier: TYPE; } @@ -265,9 +265,9 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {record: instance as TYPE}) as SO_FAR & {record: TYPE} : SO_FAR & { record: TYPE; } >Object.assign({}, soFar, {record: instance as TYPE}) : SO_FAR & { record: TYPE; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{record: instance as TYPE} : { record: TYPE; } @@ -321,9 +321,9 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance})) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance}) : SO_FAR & { maxMsToWaitBeforePublishing: number; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{maxMsToWaitBeforePublishing: instance} : { maxMsToWaitBeforePublishing: number; } @@ -340,9 +340,9 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0}) : SO_FAR & { maxMsToWaitBeforePublishing: number; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{maxMsToWaitBeforePublishing: 0} : { maxMsToWaitBeforePublishing: number; } @@ -441,9 +441,9 @@ export enum PubSubRecordIsStoredInRedisAsA { >soFar : SO_FAR >Object.assign( {}, buildNameFieldConstructor(soFar), buildIdentifierFieldConstructor(soFar), buildRecordFieldConstructor(soFar), buildStoredAsConstructor(soFar), buildMaxMsToWaitBeforePublishingFieldConstructor(soFar), buildType(soFar) ) as BuildPubSubRecordType : BuildPubSubRecordType >Object.assign( {}, buildNameFieldConstructor(soFar), buildIdentifierFieldConstructor(soFar), buildRecordFieldConstructor(soFar), buildStoredAsConstructor(soFar), buildMaxMsToWaitBeforePublishingFieldConstructor(soFar), buildType(soFar) ) : any ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } {}, >{} : {} diff --git a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.types b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.types index ac96422ad5a..4e4bf5b7693 100644 --- a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.types +++ b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.types @@ -39,9 +39,9 @@ export const updateIfChanged = (t: T) => { return Object.assign( >Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }) : ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >(key: K) => >>(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }) : (key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; } @@ -62,9 +62,9 @@ export const updateIfChanged = (t: T) => { >update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })) : T >update : (u: U) => T >Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v }) : U & { [x: string]: Value; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Array.isArray(u) ? [] : {} : undefined[] | {} >Array.isArray(u) : boolean >Array.isArray : (arg: any) => arg is any[] diff --git a/tests/baselines/reference/es2018ObjectAssign.types b/tests/baselines/reference/es2018ObjectAssign.types index f4cc265f67a..e8cc1927c5c 100644 --- a/tests/baselines/reference/es2018ObjectAssign.types +++ b/tests/baselines/reference/es2018ObjectAssign.types @@ -2,9 +2,9 @@ const test = Object.assign({}, { test: true }); >test : { test: boolean; } >Object.assign({}, { test: true }) : { test: boolean; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >{} : {} >{ test: true } : { test: true; } >test : true diff --git a/tests/baselines/reference/intersectionsAndEmptyObjects.types b/tests/baselines/reference/intersectionsAndEmptyObjects.types index 423882a14f3..1c73b23c07d 100644 --- a/tests/baselines/reference/intersectionsAndEmptyObjects.types +++ b/tests/baselines/reference/intersectionsAndEmptyObjects.types @@ -76,9 +76,9 @@ const intersectDictionaries = ( ): F1 & F2 => Object.assign({}, d1, d2); >Object.assign({}, d1, d2) : {} & F1 & F2 ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >{} : {} >d1 : F1 >d2 : F2 diff --git a/tests/baselines/reference/unionAndIntersectionInference1.types b/tests/baselines/reference/unionAndIntersectionInference1.types index 86ed1aa33f6..51683684f2a 100644 --- a/tests/baselines/reference/unionAndIntersectionInference1.types +++ b/tests/baselines/reference/unionAndIntersectionInference1.types @@ -246,9 +246,9 @@ const assign = (a: T, b: U) => Object.assign(a, b); >a : T >b : U >Object.assign(a, b) : T & U ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } >a : T >b : U From b0b8cdafc9d3465b385c62b2f0eeeb6255e6ffdb Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Fri, 18 Feb 2022 23:41:36 +0200 Subject: [PATCH 5/5] feat(44956): remove hyphen separator (#47777) --- src/services/jsDoc.ts | 13 +++- src/testRunner/unittests/tsserver/jsdocTag.ts | 20 +++--- .../jsDocFunctionSignatures6.baseline | 64 +++++++++---------- .../reference/quickInfoJsDocTags3.baseline | 4 +- .../reference/quickInfoJsDocTags4.baseline | 4 +- .../reference/quickInfoJsDocTags5.baseline | 4 +- .../reference/quickInfoJsDocTags6.baseline | 4 +- .../signatureHelpJSDocCallbackTag.baseline | 18 +++--- .../fourslash/server/jsdocCallbackTag.ts | 4 +- .../cases/fourslash/server/jsdocTypedefTag.ts | 2 +- 10 files changed, 73 insertions(+), 64 deletions(-) diff --git a/src/services/jsDoc.ts b/src/services/jsDoc.ts index 43600422a5c..2e6f3b04ddd 100644 --- a/src/services/jsDoc.ts +++ b/src/services/jsDoc.ts @@ -152,14 +152,23 @@ namespace ts.JsDoc { function getDisplayPartsFromComment(comment: string | readonly JSDocComment[], checker: TypeChecker | undefined): SymbolDisplayPart[] { if (typeof comment === "string") { - return [textPart(comment)]; + return [textPart(skipSeparatorFromComment(comment))]; } return flatMap( comment, - node => node.kind === SyntaxKind.JSDocText ? [textPart(node.text)] : buildLinkParts(node, checker) + node => node.kind === SyntaxKind.JSDocText ? [textPart(skipSeparatorFromComment(node.text))] : buildLinkParts(node, checker) ) as SymbolDisplayPart[]; } + function skipSeparatorFromComment(text: string) { + let pos = 0; + if (text.charCodeAt(pos++) === CharacterCodes.minus) { + while (pos < text.length && text.charCodeAt(pos) === CharacterCodes.space) pos++; + return text.slice(pos); + } + return text; + } + function getCommentDisplayParts(tag: JSDocTag, checker?: TypeChecker): SymbolDisplayPart[] | undefined { const { comment, kind } = tag; const namePart = getTagNameDisplayPart(kind); diff --git a/src/testRunner/unittests/tsserver/jsdocTag.ts b/src/testRunner/unittests/tsserver/jsdocTag.ts index 7699c107586..14cdc9df7c4 100644 --- a/src/testRunner/unittests/tsserver/jsdocTag.ts +++ b/src/testRunner/unittests/tsserver/jsdocTag.ts @@ -386,11 +386,11 @@ x(1)` displayPartsForJSDoc: false, tags: [{ name: "param", - text: "y - {@link C}" + text: "y {@link C}" }], documentation: [{ kind: "text", - text: "- " + text: "" }, { kind: "link", text: "{@link " @@ -425,7 +425,7 @@ x(1)` text: " " }, { kind: "text", - text: "- " + text: "" }, { kind: "link", text: "{@link " @@ -461,11 +461,11 @@ x(1)` displayPartsForJSDoc: false, tags: [{ name: "param", - text: "y - {@link C}" + text: "y {@link C}" }], documentation: [{ kind: "text", - text: "- " + text: "" }, { kind: "link", text: "{@link " @@ -496,7 +496,7 @@ x(1)` text: " " }, { kind: "text", - text: "- " + text: "" }, { kind: "link", text: "{@link " @@ -610,7 +610,7 @@ foo` text: " " }, { kind: "text", - text: "- see " + text: "see " }, { kind: "link", text: "{@link " @@ -641,7 +641,7 @@ foo` displayPartsForJSDoc: false, tags: [{ name: "param", - text: "x - see {@link C}", + text: "x see {@link C}", }], }); }); @@ -659,7 +659,7 @@ foo` text: " " }, { kind: "text", - text: "- see " + text: "see " }, { kind: "link", text: "{@link " @@ -686,7 +686,7 @@ foo` displayPartsForJSDoc: false, tags: [{ name: "param", - text: "x - see {@link C}", + text: "x see {@link C}", }], }); }); diff --git a/tests/baselines/reference/jsDocFunctionSignatures6.baseline b/tests/baselines/reference/jsDocFunctionSignatures6.baseline index 2d5e8aebc83..7c147a6ec2c 100644 --- a/tests/baselines/reference/jsDocFunctionSignatures6.baseline +++ b/tests/baselines/reference/jsDocFunctionSignatures6.baseline @@ -52,7 +52,7 @@ "name": "p1", "documentation": [ { - "text": "- A string param", + "text": "A string param", "kind": "text" } ], @@ -81,7 +81,7 @@ "name": "p2", "documentation": [ { - "text": "- An optional param", + "text": "An optional param", "kind": "text" } ], @@ -110,7 +110,7 @@ "name": "p3", "documentation": [ { - "text": "- Another optional param", + "text": "Another optional param", "kind": "text" } ], @@ -143,7 +143,7 @@ "name": "p4", "documentation": [ { - "text": "- An optional param with a default value", + "text": "An optional param with a default value", "kind": "text" } ], @@ -187,7 +187,7 @@ "kind": "space" }, { - "text": "- A string param", + "text": "A string param", "kind": "text" } ] @@ -204,7 +204,7 @@ "kind": "space" }, { - "text": "- An optional param", + "text": "An optional param", "kind": "text" } ] @@ -221,7 +221,7 @@ "kind": "space" }, { - "text": "- Another optional param", + "text": "Another optional param", "kind": "text" } ] @@ -238,7 +238,7 @@ "kind": "space" }, { - "text": "- An optional param with a default value", + "text": "An optional param with a default value", "kind": "text" } ] @@ -308,7 +308,7 @@ "name": "p1", "documentation": [ { - "text": "- A string param", + "text": "A string param", "kind": "text" } ], @@ -337,7 +337,7 @@ "name": "p2", "documentation": [ { - "text": "- An optional param", + "text": "An optional param", "kind": "text" } ], @@ -366,7 +366,7 @@ "name": "p3", "documentation": [ { - "text": "- Another optional param", + "text": "Another optional param", "kind": "text" } ], @@ -399,7 +399,7 @@ "name": "p4", "documentation": [ { - "text": "- An optional param with a default value", + "text": "An optional param with a default value", "kind": "text" } ], @@ -443,7 +443,7 @@ "kind": "space" }, { - "text": "- A string param", + "text": "A string param", "kind": "text" } ] @@ -460,7 +460,7 @@ "kind": "space" }, { - "text": "- An optional param", + "text": "An optional param", "kind": "text" } ] @@ -477,7 +477,7 @@ "kind": "space" }, { - "text": "- Another optional param", + "text": "Another optional param", "kind": "text" } ] @@ -494,7 +494,7 @@ "kind": "space" }, { - "text": "- An optional param with a default value", + "text": "An optional param with a default value", "kind": "text" } ] @@ -564,7 +564,7 @@ "name": "p1", "documentation": [ { - "text": "- A string param", + "text": "A string param", "kind": "text" } ], @@ -593,7 +593,7 @@ "name": "p2", "documentation": [ { - "text": "- An optional param", + "text": "An optional param", "kind": "text" } ], @@ -622,7 +622,7 @@ "name": "p3", "documentation": [ { - "text": "- Another optional param", + "text": "Another optional param", "kind": "text" } ], @@ -655,7 +655,7 @@ "name": "p4", "documentation": [ { - "text": "- An optional param with a default value", + "text": "An optional param with a default value", "kind": "text" } ], @@ -699,7 +699,7 @@ "kind": "space" }, { - "text": "- A string param", + "text": "A string param", "kind": "text" } ] @@ -716,7 +716,7 @@ "kind": "space" }, { - "text": "- An optional param", + "text": "An optional param", "kind": "text" } ] @@ -733,7 +733,7 @@ "kind": "space" }, { - "text": "- Another optional param", + "text": "Another optional param", "kind": "text" } ] @@ -750,7 +750,7 @@ "kind": "space" }, { - "text": "- An optional param with a default value", + "text": "An optional param with a default value", "kind": "text" } ] @@ -820,7 +820,7 @@ "name": "p1", "documentation": [ { - "text": "- A string param", + "text": "A string param", "kind": "text" } ], @@ -849,7 +849,7 @@ "name": "p2", "documentation": [ { - "text": "- An optional param", + "text": "An optional param", "kind": "text" } ], @@ -878,7 +878,7 @@ "name": "p3", "documentation": [ { - "text": "- Another optional param", + "text": "Another optional param", "kind": "text" } ], @@ -911,7 +911,7 @@ "name": "p4", "documentation": [ { - "text": "- An optional param with a default value", + "text": "An optional param with a default value", "kind": "text" } ], @@ -955,7 +955,7 @@ "kind": "space" }, { - "text": "- A string param", + "text": "A string param", "kind": "text" } ] @@ -972,7 +972,7 @@ "kind": "space" }, { - "text": "- An optional param", + "text": "An optional param", "kind": "text" } ] @@ -989,7 +989,7 @@ "kind": "space" }, { - "text": "- Another optional param", + "text": "Another optional param", "kind": "text" } ] @@ -1006,7 +1006,7 @@ "kind": "space" }, { - "text": "- An optional param with a default value", + "text": "An optional param with a default value", "kind": "text" } ] diff --git a/tests/baselines/reference/quickInfoJsDocTags3.baseline b/tests/baselines/reference/quickInfoJsDocTags3.baseline index ab71bea1697..7d4ace62092 100644 --- a/tests/baselines/reference/quickInfoJsDocTags3.baseline +++ b/tests/baselines/reference/quickInfoJsDocTags3.baseline @@ -107,7 +107,7 @@ "kind": "space" }, { - "text": "- x comment", + "text": "x comment", "kind": "text" } ] @@ -124,7 +124,7 @@ "kind": "space" }, { - "text": "- y comment", + "text": "y comment", "kind": "text" } ] diff --git a/tests/baselines/reference/quickInfoJsDocTags4.baseline b/tests/baselines/reference/quickInfoJsDocTags4.baseline index 097ac25f124..21d1f8417ef 100644 --- a/tests/baselines/reference/quickInfoJsDocTags4.baseline +++ b/tests/baselines/reference/quickInfoJsDocTags4.baseline @@ -147,7 +147,7 @@ "kind": "space" }, { - "text": "- x comment", + "text": "x comment", "kind": "text" } ] @@ -164,7 +164,7 @@ "kind": "space" }, { - "text": "- y comment", + "text": "y comment", "kind": "text" } ] diff --git a/tests/baselines/reference/quickInfoJsDocTags5.baseline b/tests/baselines/reference/quickInfoJsDocTags5.baseline index 167f3df4918..ce728153bd0 100644 --- a/tests/baselines/reference/quickInfoJsDocTags5.baseline +++ b/tests/baselines/reference/quickInfoJsDocTags5.baseline @@ -147,7 +147,7 @@ "kind": "space" }, { - "text": "- x comment", + "text": "x comment", "kind": "text" } ] @@ -164,7 +164,7 @@ "kind": "space" }, { - "text": "- y comment", + "text": "y comment", "kind": "text" } ] diff --git a/tests/baselines/reference/quickInfoJsDocTags6.baseline b/tests/baselines/reference/quickInfoJsDocTags6.baseline index 7ab1d074034..290ba10c04f 100644 --- a/tests/baselines/reference/quickInfoJsDocTags6.baseline +++ b/tests/baselines/reference/quickInfoJsDocTags6.baseline @@ -147,7 +147,7 @@ "kind": "space" }, { - "text": "- x comment", + "text": "x comment", "kind": "text" } ] @@ -164,7 +164,7 @@ "kind": "space" }, { - "text": "- y comment", + "text": "y comment", "kind": "text" } ] diff --git a/tests/baselines/reference/signatureHelpJSDocCallbackTag.baseline b/tests/baselines/reference/signatureHelpJSDocCallbackTag.baseline index 640c0c7dc1e..02c3b676798 100644 --- a/tests/baselines/reference/signatureHelpJSDocCallbackTag.baseline +++ b/tests/baselines/reference/signatureHelpJSDocCallbackTag.baseline @@ -52,7 +52,7 @@ "name": "eventName", "documentation": [ { - "text": "- So many words", + "text": "So many words", "kind": "text" } ], @@ -81,7 +81,7 @@ "name": "eventName2", "documentation": [ { - "text": "- Silence is golden", + "text": "Silence is golden", "kind": "text" } ], @@ -126,7 +126,7 @@ "name": "eventName3", "documentation": [ { - "text": "- Osterreich mos def", + "text": "Osterreich mos def", "kind": "text" } ], @@ -234,7 +234,7 @@ "name": "eventName", "documentation": [ { - "text": "- So many words", + "text": "So many words", "kind": "text" } ], @@ -263,7 +263,7 @@ "name": "eventName2", "documentation": [ { - "text": "- Silence is golden", + "text": "Silence is golden", "kind": "text" } ], @@ -308,7 +308,7 @@ "name": "eventName3", "documentation": [ { - "text": "- Osterreich mos def", + "text": "Osterreich mos def", "kind": "text" } ], @@ -416,7 +416,7 @@ "name": "eventName", "documentation": [ { - "text": "- So many words", + "text": "So many words", "kind": "text" } ], @@ -445,7 +445,7 @@ "name": "eventName2", "documentation": [ { - "text": "- Silence is golden", + "text": "Silence is golden", "kind": "text" } ], @@ -490,7 +490,7 @@ "name": "eventName3", "documentation": [ { - "text": "- Osterreich mos def", + "text": "Osterreich mos def", "kind": "text" } ], diff --git a/tests/cases/fourslash/server/jsdocCallbackTag.ts b/tests/cases/fourslash/server/jsdocCallbackTag.ts index df1b9e12969..da58a38a957 100644 --- a/tests/cases/fourslash/server/jsdocCallbackTag.ts +++ b/tests/cases/fourslash/server/jsdocCallbackTag.ts @@ -30,6 +30,6 @@ verify.quickInfoIs("var t: FooHandler"); goTo.marker("2"); verify.quickInfoIs("var t2: FooHandler2"); goTo.marker("3"); -verify.quickInfoIs("type FooHandler2 = (eventName?: string | undefined, eventName2?: string) => any", "- What, another one?"); +verify.quickInfoIs("type FooHandler2 = (eventName?: string | undefined, eventName2?: string) => any", "What, another one?"); goTo.marker("8"); -verify.quickInfoIs("type FooHandler = (eventName: string, eventName2: number | string, eventName3: any) => number", "- A kind of magic"); +verify.quickInfoIs("type FooHandler = (eventName: string, eventName2: number | string, eventName3: any) => number", "A kind of magic"); diff --git a/tests/cases/fourslash/server/jsdocTypedefTag.ts b/tests/cases/fourslash/server/jsdocTypedefTag.ts index ed27e6e29ef..c2d73e981e0 100644 --- a/tests/cases/fourslash/server/jsdocTypedefTag.ts +++ b/tests/cases/fourslash/server/jsdocTypedefTag.ts @@ -71,4 +71,4 @@ verify.completions( { marker: "catAge", includes: "toExponential" }, ); -verify.quickInfoAt("AnimalType", "type Animal = {\n animalName: string;\n animalAge: number;\n}", "- think Giraffes"); +verify.quickInfoAt("AnimalType", "type Animal = {\n animalName: string;\n animalAge: number;\n}", "think Giraffes");