From 4a0b083c69042953b80975541450836ad844c70c Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Fri, 6 May 2022 09:09:06 +0900 Subject: [PATCH 01/29] Add ES2022 `Intl.Segmenter` type (#48800) * Add `Intl.Segmenter` type * Update baseline * Fix useless generics * Fix indent size * Fix `ResolvedSegmenterOptions` --- src/compiler/commandLineParser.ts | 1 + src/lib/es2022.d.ts | 1 + src/lib/es2022.intl.d.ts | 91 +++++++++++++++++++ src/lib/libs.json | 1 + .../reference/es2022IntlAPIs.symbols | 2 +- .../reference/formatToPartsBigInt.symbols | 4 +- .../numberFormatCurrencySign.symbols | 2 +- .../numberFormatCurrencySignResolved.symbols | 2 +- .../reactJsxReactResolvedNodeNext.trace.json | 2 + ...eactJsxReactResolvedNodeNextEsm.trace.json | 2 + ...does-not-add-color-when-NO_COLOR-is-set.js | 2 +- ...-when-host-can't-provide-terminal-width.js | 2 +- ...tatus.DiagnosticsPresent_OutputsSkipped.js | 2 +- 13 files changed, 106 insertions(+), 8 deletions(-) create mode 100644 src/lib/es2022.intl.d.ts diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index d60facd264b..b257d7aed4c 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -81,6 +81,7 @@ namespace ts { ["es2021.intl", "lib.es2021.intl.d.ts"], ["es2022.array", "lib.es2022.array.d.ts"], ["es2022.error", "lib.es2022.error.d.ts"], + ["es2022.intl", "lib.es2022.intl.d.ts"], ["es2022.object", "lib.es2022.object.d.ts"], ["es2022.string", "lib.es2022.string.d.ts"], ["esnext.array", "lib.es2022.array.d.ts"], diff --git a/src/lib/es2022.d.ts b/src/lib/es2022.d.ts index 67a9199b5d6..7069e4ecdf1 100644 --- a/src/lib/es2022.d.ts +++ b/src/lib/es2022.d.ts @@ -1,5 +1,6 @@ /// /// /// +/// /// /// diff --git a/src/lib/es2022.intl.d.ts b/src/lib/es2022.intl.d.ts new file mode 100644 index 00000000000..0672ec4d2d4 --- /dev/null +++ b/src/lib/es2022.intl.d.ts @@ -0,0 +1,91 @@ +declare namespace Intl { + + /** + * An object with some or all properties of the `Intl.Segmenter` constructor `options` parameter. + * + * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter#parameters) + */ + interface SegmenterOptions { + /** The locale matching algorithm to use. For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation). */ + localeMatcher?: "best fit" | "lookup" | undefined; + /** The type of input to be split */ + granularity?: "grapheme" | "word" | "sentence" | undefined; + } + + interface Segmenter { + /** + * Returns `Segments` object containing the segments of the input string, using the segmenter's locale and granularity. + * + * @param input - The text to be segmented as a `string`. + * + * @returns A new iterable Segments object containing the segments of the input string, using the segmenter's locale and granularity. + */ + segment(input: string): Segments; + resolvedOptions(): ResolvedSegmenterOptions; + } + + interface ResolvedSegmenterOptions { + locale: string; + granularity: "grapheme" | "word" | "sentence"; + } + + interface Segments { + /** + * Returns an object describing the segment in the original string that includes the code unit at a specified index. + * + * @param codeUnitIndex - A number specifying the index of the code unit in the original input string. If the value is omitted, it defaults to `0`. + */ + containing(codeUnitIndex?: number): SegmentData; + + /** Returns an iterator to iterate over the segments. */ + [Symbol.iterator](): IterableIterator; + } + + interface SegmentData { + /** A string containing the segment extracted from the original input string. */ + segment: string; + /** The code unit index in the original input string at which the segment begins. */ + index: number; + /** The complete input string that was segmented. */ + input: string; + /** + * A boolean value only if granularity is "word"; otherwise, undefined. + * If granularity is "word", then isWordLike is true when the segment is word-like (i.e., consists of letters/numbers/ideographs/etc.); otherwise, false. + */ + isWordLike?: boolean; + } + + const Segmenter: { + prototype: Segmenter; + + /** + * Creates a new `Intl.Segmenter` object. + * + * @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings. + * For the general form and interpretation of the `locales` argument, + * see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation). + * + * @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter#parameters) + * with some or all options of `SegmenterOptions`. + * + * @returns [Intl.Segmenter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segments) object. + * + * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter). + */ + new(locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: SegmenterOptions): Segmenter; + + /** + * Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. + * + * @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings. + * For the general form and interpretation of the `locales` argument, + * see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation). + * + * @param options An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf#parameters). + * with some or all possible options. + * + * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf) + */ + supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick): BCP47LanguageTag[]; + }; +} diff --git a/src/lib/libs.json b/src/lib/libs.json index 0dbe57f36fa..ad01b1dff2c 100644 --- a/src/lib/libs.json +++ b/src/lib/libs.json @@ -57,6 +57,7 @@ "es2021.intl", "es2022.array", "es2022.error", + "es2022.intl", "es2022.object", "es2022.string", "esnext.intl", diff --git a/tests/baselines/reference/es2022IntlAPIs.symbols b/tests/baselines/reference/es2022IntlAPIs.symbols index 939c6b383a5..914f9c93a85 100644 --- a/tests/baselines/reference/es2022IntlAPIs.symbols +++ b/tests/baselines/reference/es2022IntlAPIs.symbols @@ -11,7 +11,7 @@ for (const zoneName of timezoneNames) { var formatter = new Intl.DateTimeFormat('en-US', { >formatter : Symbol(formatter, Decl(es2022IntlAPIs.ts, 3, 5)) >Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --) ... and 1 more) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --) ... and 2 more) >DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) timeZone: 'America/Los_Angeles', diff --git a/tests/baselines/reference/formatToPartsBigInt.symbols b/tests/baselines/reference/formatToPartsBigInt.symbols index 41d4f83b1d9..1cf2f6000f5 100644 --- a/tests/baselines/reference/formatToPartsBigInt.symbols +++ b/tests/baselines/reference/formatToPartsBigInt.symbols @@ -5,14 +5,14 @@ new Intl.NumberFormat("fr").formatToParts(3000n); >new Intl.NumberFormat("fr").formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) >Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --) ... and 2 more) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --) ... and 3 more) >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) >formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) new Intl.NumberFormat("fr").formatToParts(BigInt(123)); >new Intl.NumberFormat("fr").formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) >Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --) ... and 2 more) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --) ... and 3 more) >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) >formatToParts : Symbol(Intl.NumberFormat.formatToParts, Decl(lib.es2018.intl.d.ts, --, --)) >BigInt : Symbol(BigInt, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) diff --git a/tests/baselines/reference/numberFormatCurrencySign.symbols b/tests/baselines/reference/numberFormatCurrencySign.symbols index 0a22340bcc5..d4b3c8da3ca 100644 --- a/tests/baselines/reference/numberFormatCurrencySign.symbols +++ b/tests/baselines/reference/numberFormatCurrencySign.symbols @@ -3,7 +3,7 @@ const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', >str : Symbol(str, Decl(numberFormatCurrencySign.ts, 0, 5)) >new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --) ... and 2 more) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --) ... and 3 more) >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) >style : Symbol(style, Decl(numberFormatCurrencySign.ts, 0, 44)) >currency : Symbol(currency, Decl(numberFormatCurrencySign.ts, 0, 63)) diff --git a/tests/baselines/reference/numberFormatCurrencySignResolved.symbols b/tests/baselines/reference/numberFormatCurrencySignResolved.symbols index 4c1b52928b0..c5e125f3930 100644 --- a/tests/baselines/reference/numberFormatCurrencySignResolved.symbols +++ b/tests/baselines/reference/numberFormatCurrencySignResolved.symbols @@ -3,7 +3,7 @@ const options = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'N >options : Symbol(options, Decl(numberFormatCurrencySignResolved.ts, 0, 5)) >new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : Symbol(Intl.NumberFormat.resolvedOptions, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) ->Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --) ... and 2 more) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --) ... and 3 more) >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.esnext.intl.d.ts, --, --)) >style : Symbol(style, Decl(numberFormatCurrencySignResolved.ts, 0, 48)) >currency : Symbol(currency, Decl(numberFormatCurrencySignResolved.ts, 0, 67)) diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json index aff11ff7b34..7857b59fd0f 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json @@ -145,5 +145,7 @@ "File 'package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json index 783a70f3a41..0e83601b165 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json @@ -139,5 +139,7 @@ "File 'package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups." ] \ No newline at end of file diff --git a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js index 5e7ba543d34..e440d0f2801 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js @@ -90,7 +90,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.object, es2022.string/esnext.string, esnext.intl +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.intl, es2022.object, es2022.string/esnext.string, esnext.intl default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index eb384f25ae3..a7886b4d5b5 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -90,7 +90,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.object, es2022.string/esnext.string, esnext.intl +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.intl, es2022.object, es2022.string/esnext.string, esnext.intl default: undefined --allowJs diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index eb384f25ae3..a7886b4d5b5 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -90,7 +90,7 @@ default: undefined --lib Specify a set of bundled library declaration files that describe the target runtime environment. -one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.object, es2022.string/esnext.string, esnext.intl +one or more: es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2020.bigint/esnext.bigint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.promise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array/esnext.array, es2022.error, es2022.intl, es2022.object, es2022.string/esnext.string, esnext.intl default: undefined --allowJs From 4765355e714f445a99dc3498686b290f66c2d853 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 6 May 2022 11:09:42 -0700 Subject: [PATCH 02/29] Fix more tests missing 'it' call in 'describe' (#48994) --- src/testRunner/unittests/publicApi.ts | 34 +++++++++++++++------------ 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/testRunner/unittests/publicApi.ts b/src/testRunner/unittests/publicApi.ts index a1e43e7c371..4bfce8288f5 100644 --- a/src/testRunner/unittests/publicApi.ts +++ b/src/testRunner/unittests/publicApi.ts @@ -180,30 +180,34 @@ describe("unittests:: Public APIs:: validateLocaleAndSetLanguage", () => { }); describe("unittests:: Public APIs :: forEachChild of @param comments in JSDoc", () => { - const content = ` + it("finds correct children", () => { + const content = ` /** * @param The {@link TypeReferencesInAedoc}. */ var x `; - const sourceFile = ts.createSourceFile("/file.ts", content, ts.ScriptTarget.ESNext, /*setParentNodes*/ true); - const paramTag = sourceFile.getChildren()[0].getChildren()[0].getChildren()[0].getChildren()[0]; - const kids = paramTag.getChildren(); - const seen: Set = new Set(); - ts.forEachChild(paramTag, n => { - assert.strictEqual(/*actual*/ false, seen.has(n), "Found a duplicate-added child"); - seen.add(n); + const sourceFile = ts.createSourceFile("/file.ts", content, ts.ScriptTarget.ESNext, /*setParentNodes*/ true); + const paramTag = sourceFile.getChildren()[0].getChildren()[0].getChildren()[0].getChildren()[0]; + const kids = paramTag.getChildren(); + const seen: Set = new Set(); + ts.forEachChild(paramTag, n => { + assert.strictEqual(/*actual*/ false, seen.has(n), "Found a duplicate-added child"); + seen.add(n); + }); + assert.equal(5, kids.length); }); - assert.equal(5, kids.length); }); describe("unittests:: Public APIs:: getChild* methods on EndOfFileToken with JSDoc", () => { - const content = ` + it("finds correct children", () => { + const content = ` /** jsdoc comment attached to EndOfFileToken */ `; - const sourceFile = ts.createSourceFile("/file.ts", content, ts.ScriptTarget.ESNext, /*setParentNodes*/ true); - const endOfFileToken = sourceFile.getChildren()[1]; - assert.equal(endOfFileToken.getChildren().length, 1); - assert.equal(endOfFileToken.getChildCount(), 1); - assert.notEqual(endOfFileToken.getChildAt(0), /*expected*/ undefined); + const sourceFile = ts.createSourceFile("/file.ts", content, ts.ScriptTarget.ESNext, /*setParentNodes*/ true); + const endOfFileToken = sourceFile.getChildren()[1]; + assert.equal(endOfFileToken.getChildren().length, 1); + assert.equal(endOfFileToken.getChildCount(), 1); + assert.notEqual(endOfFileToken.getChildAt(0), /*expected*/ undefined); + }); }); From 2ffe6864b163d54cca3b20ef5c2a894beb00b128 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Fri, 6 May 2022 12:58:12 -0700 Subject: [PATCH 03/29] Respect importModuleSpecifierEnding inside node_modules packages (#48995) * Respect importModuleSpecifierEnding inside node_modules packages * Add tests for missing package.json --- src/compiler/moduleSpecifiers.ts | 47 ++++++++++--------- .../autoImportNoPackageJson_commonjs.ts | 11 +++++ .../autoImportNoPackageJson_nodenext.ts | 11 +++++ .../fourslash/importNameCodeFixJsEnding.ts | 17 +++++++ 4 files changed, 63 insertions(+), 23 deletions(-) create mode 100644 tests/cases/fourslash/autoImportNoPackageJson_commonjs.ts create mode 100644 tests/cases/fourslash/autoImportNoPackageJson_nodenext.ts create mode 100644 tests/cases/fourslash/importNameCodeFixJsEnding.ts diff --git a/src/compiler/moduleSpecifiers.ts b/src/compiler/moduleSpecifiers.ts index 542afb796a9..ed8d9f90b0a 100644 --- a/src/compiler/moduleSpecifiers.ts +++ b/src/compiler/moduleSpecifiers.ts @@ -105,7 +105,7 @@ namespace ts.moduleSpecifiers { const info = getInfo(importingSourceFile.path, host); const modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences, options); return firstDefined(modulePaths, - modulePath => tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ true, options.overrideImportMode)); + modulePath => tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, preferences, /*packageNameOnly*/ true, options.overrideImportMode)); } function getModuleSpecifierWorker( @@ -120,7 +120,7 @@ namespace ts.moduleSpecifiers { ): string { const info = getInfo(importingSourceFileName, host); const modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences, options); - return firstDefined(modulePaths, modulePath => tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ undefined, options.overrideImportMode)) || + return firstDefined(modulePaths, modulePath => tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, /*packageNameOnly*/ undefined, options.overrideImportMode)) || getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences); } @@ -248,7 +248,7 @@ namespace ts.moduleSpecifiers { let pathsSpecifiers: string[] | undefined; let relativeSpecifiers: string[] | undefined; for (const modulePath of modulePaths) { - const specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, /*packageNameOnly*/ undefined, options.overrideImportMode); + const specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, /*packageNameOnly*/ undefined, options.overrideImportMode); nodeModulesSpecifiers = append(nodeModulesSpecifiers, specifier); if (specifier && modulePath.isRedirect) { // If we got a specifier for a redirect, it was a bare package specifier (e.g. "@foo/bar", @@ -666,7 +666,7 @@ namespace ts.moduleSpecifiers { : removeFileExtension(relativePath); } - function tryGetModuleNameAsNodeModule({ path, isRedirect }: ModulePath, { getCanonicalFileName, sourceDirectory }: Info, importingSourceFile: SourceFile , host: ModuleSpecifierResolutionHost, options: CompilerOptions, packageNameOnly?: boolean, overrideMode?: ModuleKind.ESNext | ModuleKind.CommonJS): string | undefined { + function tryGetModuleNameAsNodeModule({ path, isRedirect }: ModulePath, { getCanonicalFileName, sourceDirectory }: Info, importingSourceFile: SourceFile , host: ModuleSpecifierResolutionHost, options: CompilerOptions, userPreferences: UserPreferences, packageNameOnly?: boolean, overrideMode?: ModuleKind.ESNext | ModuleKind.CommonJS): string | undefined { if (!host.fileExists || !host.readFile) { return undefined; } @@ -680,8 +680,9 @@ namespace ts.moduleSpecifiers { let moduleSpecifier = path; let isPackageRootPath = false; if (!packageNameOnly) { + const preferences = getPreferences(host, userPreferences, options, importingSourceFile); let packageRootIndex = parts.packageRootIndex; - let moduleFileNameForExtensionless: string | undefined; + let moduleFileName: string | undefined; while (true) { // If the module could be imported by a directory name, use that directory's name const { moduleFileToTry, packageRootPath, blockedByExports, verbatimFromExports } = tryDirectoryWithPackageJson(packageRootIndex); @@ -698,12 +699,12 @@ namespace ts.moduleSpecifiers { isPackageRootPath = true; break; } - if (!moduleFileNameForExtensionless) moduleFileNameForExtensionless = moduleFileToTry; + if (!moduleFileName) moduleFileName = moduleFileToTry; // try with next level of directory packageRootIndex = path.indexOf(directorySeparator, packageRootIndex + 1); if (packageRootIndex === -1) { - moduleSpecifier = getExtensionlessFileName(moduleFileNameForExtensionless); + moduleSpecifier = removeExtensionAndIndexPostFix(moduleFileName, preferences.ending, options, host); break; } } @@ -768,7 +769,7 @@ namespace ts.moduleSpecifiers { } } // If the file is the main module, it can be imported by the package name - const mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main; + const mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main || "index.js"; if (isString(mainFileRelative)) { const mainExportFile = toPath(mainFileRelative, packageRootPath, getCanonicalFileName); if (removeFileExtension(mainExportFile) === removeFileExtension(getCanonicalFileName(moduleFileToTry))) { @@ -776,20 +777,14 @@ namespace ts.moduleSpecifiers { } } } - return { moduleFileToTry }; - } - - function getExtensionlessFileName(path: string): string { - // We still have a file name - remove the extension - const fullModulePathWithoutExtension = removeFileExtension(path); - - // If the file is /index, it can be imported by its directory name - // IFF there is not _also_ a file by the same name - if (getCanonicalFileName(fullModulePathWithoutExtension.substring(parts.fileNameIndex)) === "/index" && !tryGetAnyFileFromPath(host, fullModulePathWithoutExtension.substring(0, parts.fileNameIndex))) { - return fullModulePathWithoutExtension.substring(0, parts.fileNameIndex); + else { + // No package.json exists; an index.js will still resolve as the package name + const fileName = getCanonicalFileName(moduleFileToTry.substring(parts.packageRootIndex + 1)); + if (fileName === "index.d.ts" || fileName === "index.js" || fileName === "index.ts" || fileName === "index.tsx") { + return { moduleFileToTry, packageRootPath }; + } } - - return fullModulePathWithoutExtension; + return { moduleFileToTry }; } } @@ -812,13 +807,19 @@ namespace ts.moduleSpecifiers { }); } - function removeExtensionAndIndexPostFix(fileName: string, ending: Ending, options: CompilerOptions): string { + function removeExtensionAndIndexPostFix(fileName: string, ending: Ending, options: CompilerOptions, host?: ModuleSpecifierResolutionHost): string { if (fileExtensionIsOneOf(fileName, [Extension.Json, Extension.Mjs, Extension.Cjs])) return fileName; const noExtension = removeFileExtension(fileName); if (fileExtensionIsOneOf(fileName, [Extension.Dmts, Extension.Mts, Extension.Dcts, Extension.Cts])) return noExtension + getJSExtensionForFile(fileName, options); switch (ending) { case Ending.Minimal: - return removeSuffix(noExtension, "/index"); + const withoutIndex = removeSuffix(noExtension, "/index"); + if (host && withoutIndex !== noExtension && tryGetAnyFileFromPath(host, withoutIndex)) { + // Can't remove index if there's a file by the same name as the directory. + // Probably more callers should pass `host` so we can determine this? + return noExtension; + } + return withoutIndex; case Ending.Index: return noExtension; case Ending.JsExtension: diff --git a/tests/cases/fourslash/autoImportNoPackageJson_commonjs.ts b/tests/cases/fourslash/autoImportNoPackageJson_commonjs.ts new file mode 100644 index 00000000000..1d9a0ad3233 --- /dev/null +++ b/tests/cases/fourslash/autoImportNoPackageJson_commonjs.ts @@ -0,0 +1,11 @@ +/// + +// @module: commonjs + +// @Filename: /node_modules/lit/index.d.cts +//// export declare function customElement(name: string): any; + +// @Filename: /a.ts +//// customElement/**/ + +verify.importFixModuleSpecifiers("", ["lit/index.cjs"]); diff --git a/tests/cases/fourslash/autoImportNoPackageJson_nodenext.ts b/tests/cases/fourslash/autoImportNoPackageJson_nodenext.ts new file mode 100644 index 00000000000..ff57e8fe710 --- /dev/null +++ b/tests/cases/fourslash/autoImportNoPackageJson_nodenext.ts @@ -0,0 +1,11 @@ +/// + +// @module: nodenext + +// @Filename: /node_modules/lit/index.d.cts +//// export declare function customElement(name: string): any; + +// @Filename: /a.ts +//// customElement/**/ + +verify.importFixModuleSpecifiers("", ["lit/index.cjs"]); diff --git a/tests/cases/fourslash/importNameCodeFixJsEnding.ts b/tests/cases/fourslash/importNameCodeFixJsEnding.ts new file mode 100644 index 00000000000..3ab4215e7f7 --- /dev/null +++ b/tests/cases/fourslash/importNameCodeFixJsEnding.ts @@ -0,0 +1,17 @@ +/// + +// @module: commonjs + +// @Filename: /node_modules/lit/package.json +//// { "name": "lit", "version": "1.0.0" } + +// @Filename: /node_modules/lit/index.d.ts +//// import "./decorators"; + +// @Filename: /node_modules/lit/decorators.d.ts +//// export declare function customElement(name: string): any; + +// @Filename: /a.ts +//// customElement/**/ + +verify.importFixModuleSpecifiers("", ["lit/decorators.js"], { importModuleSpecifierEnding: "js" }) From 8d0393d227d6fca43b1108a2d514b9856cb6e605 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 6 May 2022 13:36:27 -0700 Subject: [PATCH 04/29] Fix missing parsingContext restore at return in parseDelimitedList (#48999) --- src/compiler/parser.ts | 1 + .../parserUnparsedTokenCrash1.errors.txt | 11 +++++++ .../reference/parserUnparsedTokenCrash1.js | 7 +++++ .../parserUnparsedTokenCrash1.symbols | 4 +++ .../reference/parserUnparsedTokenCrash1.types | 8 +++++ .../parserUnparsedTokenCrash2.errors.txt | 30 +++++++++++++++++++ .../reference/parserUnparsedTokenCrash2.js | 10 +++++++ .../parserUnparsedTokenCrash2.symbols | 4 +++ .../reference/parserUnparsedTokenCrash2.types | 14 +++++++++ .../compiler/parserUnparsedTokenCrash1.ts | 4 +++ .../compiler/parserUnparsedTokenCrash2.ts | 1 + 11 files changed, 94 insertions(+) create mode 100644 tests/baselines/reference/parserUnparsedTokenCrash1.errors.txt create mode 100644 tests/baselines/reference/parserUnparsedTokenCrash1.js create mode 100644 tests/baselines/reference/parserUnparsedTokenCrash1.symbols create mode 100644 tests/baselines/reference/parserUnparsedTokenCrash1.types create mode 100644 tests/baselines/reference/parserUnparsedTokenCrash2.errors.txt create mode 100644 tests/baselines/reference/parserUnparsedTokenCrash2.js create mode 100644 tests/baselines/reference/parserUnparsedTokenCrash2.symbols create mode 100644 tests/baselines/reference/parserUnparsedTokenCrash2.types create mode 100644 tests/cases/compiler/parserUnparsedTokenCrash1.ts create mode 100644 tests/cases/compiler/parserUnparsedTokenCrash2.ts diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 240385df8df..dd1e7f6431a 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2745,6 +2745,7 @@ namespace ts { const startPos = scanner.getStartPos(); const result = parseListElement(kind, parseElement); if (!result) { + parsingContext = saveParsingContext; return undefined; } list.push(result as NonNullable); diff --git a/tests/baselines/reference/parserUnparsedTokenCrash1.errors.txt b/tests/baselines/reference/parserUnparsedTokenCrash1.errors.txt new file mode 100644 index 00000000000..133be2968a2 --- /dev/null +++ b/tests/baselines/reference/parserUnparsedTokenCrash1.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/a.js(1,9): error TS1005: ')' expected. +tests/cases/compiler/a.js(1,13): error TS1005: ';' expected. + + +==== tests/cases/compiler/a.js (2 errors) ==== + ( y = 1 ; 2 ) + ~ +!!! error TS1005: ')' expected. + ~ +!!! error TS1005: ';' expected. + \ No newline at end of file diff --git a/tests/baselines/reference/parserUnparsedTokenCrash1.js b/tests/baselines/reference/parserUnparsedTokenCrash1.js new file mode 100644 index 00000000000..feffea8688a --- /dev/null +++ b/tests/baselines/reference/parserUnparsedTokenCrash1.js @@ -0,0 +1,7 @@ +//// [a.js] +( y = 1 ; 2 ) + + +//// [a.js] +(y = 1); +2; diff --git a/tests/baselines/reference/parserUnparsedTokenCrash1.symbols b/tests/baselines/reference/parserUnparsedTokenCrash1.symbols new file mode 100644 index 00000000000..a07da336f81 --- /dev/null +++ b/tests/baselines/reference/parserUnparsedTokenCrash1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/a.js === +( y = 1 ; 2 ) +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserUnparsedTokenCrash1.types b/tests/baselines/reference/parserUnparsedTokenCrash1.types new file mode 100644 index 00000000000..836ba475b5d --- /dev/null +++ b/tests/baselines/reference/parserUnparsedTokenCrash1.types @@ -0,0 +1,8 @@ +=== tests/cases/compiler/a.js === +( y = 1 ; 2 ) +>( y = 1 : 1 +>y = 1 : 1 +>y : any +>1 : 1 +>2 : 2 + diff --git a/tests/baselines/reference/parserUnparsedTokenCrash2.errors.txt b/tests/baselines/reference/parserUnparsedTokenCrash2.errors.txt new file mode 100644 index 00000000000..4f23134ef9f --- /dev/null +++ b/tests/baselines/reference/parserUnparsedTokenCrash2.errors.txt @@ -0,0 +1,30 @@ +tests/cases/compiler/parserUnparsedTokenCrash2.ts(1,10): error TS1109: Expression expected. +tests/cases/compiler/parserUnparsedTokenCrash2.ts(1,12): error TS2304: Cannot find name 'x'. +tests/cases/compiler/parserUnparsedTokenCrash2.ts(1,16): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. +tests/cases/compiler/parserUnparsedTokenCrash2.ts(1,18): error TS2304: Cannot find name 'y'. +tests/cases/compiler/parserUnparsedTokenCrash2.ts(1,22): error TS2304: Cannot find name 'z'. +tests/cases/compiler/parserUnparsedTokenCrash2.ts(1,27): error TS1109: Expression expected. +tests/cases/compiler/parserUnparsedTokenCrash2.ts(1,39): error TS1005: ';' expected. +tests/cases/compiler/parserUnparsedTokenCrash2.ts(2,1): error TS1005: '}' expected. + + +==== tests/cases/compiler/parserUnparsedTokenCrash2.ts (8 errors) ==== + export = } x = ( y = z ==== 'function') { + ~ +!!! error TS1109: Expression expected. + ~ +!!! error TS2304: Cannot find name 'x'. + ~~~~~~~~~~~ +!!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. + ~ +!!! error TS2304: Cannot find name 'y'. + ~ +!!! error TS2304: Cannot find name 'z'. + ~ +!!! error TS1109: Expression expected. + ~ +!!! error TS1005: ';' expected. + + +!!! error TS1005: '}' expected. +!!! related TS1007 tests/cases/compiler/parserUnparsedTokenCrash2.ts:1:41: The parser expected to find a '}' to match the '{' token here. \ No newline at end of file diff --git a/tests/baselines/reference/parserUnparsedTokenCrash2.js b/tests/baselines/reference/parserUnparsedTokenCrash2.js new file mode 100644 index 00000000000..e7ff31800eb --- /dev/null +++ b/tests/baselines/reference/parserUnparsedTokenCrash2.js @@ -0,0 +1,10 @@ +//// [parserUnparsedTokenCrash2.ts] +export = } x = ( y = z ==== 'function') { + + +//// [parserUnparsedTokenCrash2.js] +"use strict"; +x = (y = z === ) = 'function'; +{ +} +module.exports = ; diff --git a/tests/baselines/reference/parserUnparsedTokenCrash2.symbols b/tests/baselines/reference/parserUnparsedTokenCrash2.symbols new file mode 100644 index 00000000000..a027cd161a7 --- /dev/null +++ b/tests/baselines/reference/parserUnparsedTokenCrash2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/parserUnparsedTokenCrash2.ts === +export = } x = ( y = z ==== 'function') { +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserUnparsedTokenCrash2.types b/tests/baselines/reference/parserUnparsedTokenCrash2.types new file mode 100644 index 00000000000..62e37ed3443 --- /dev/null +++ b/tests/baselines/reference/parserUnparsedTokenCrash2.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/parserUnparsedTokenCrash2.ts === +export = } x = ( y = z ==== 'function') { +> : any +>x = ( y = z ==== 'function' : "function" +>x : any +>( y = z ==== 'function' : "function" +>( y = z === : boolean +>y = z === : boolean +>y : any +>z === : boolean +>z : any +> : any +>'function' : "function" + diff --git a/tests/cases/compiler/parserUnparsedTokenCrash1.ts b/tests/cases/compiler/parserUnparsedTokenCrash1.ts new file mode 100644 index 00000000000..303c455825b --- /dev/null +++ b/tests/cases/compiler/parserUnparsedTokenCrash1.ts @@ -0,0 +1,4 @@ +// @allowJs: true +// @outDir: ./out +// @filename: a.js +( y = 1 ; 2 ) diff --git a/tests/cases/compiler/parserUnparsedTokenCrash2.ts b/tests/cases/compiler/parserUnparsedTokenCrash2.ts new file mode 100644 index 00000000000..d470175462b --- /dev/null +++ b/tests/cases/compiler/parserUnparsedTokenCrash2.ts @@ -0,0 +1 @@ +export = } x = ( y = z ==== 'function') { From 1a4643bdcec6f800c84b29c5716aa9c2ad2fd0c7 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Fri, 6 May 2022 16:31:40 -0700 Subject: [PATCH 05/29] Flag resolution mode assertions in non-nightly builds (#49002) * Flag resolution mode assertions in non-nightly builds * Add checker check --- src/compiler/checker.ts | 4 ++++ src/compiler/diagnosticMessages.json | 4 ++++ src/compiler/program.ts | 2 +- src/compiler/transformers/declarations.ts | 21 ++++++++++++++++----- src/compiler/utilities.ts | 4 ++++ 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ae1ded9d0d8..6370dddf49f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -40718,6 +40718,10 @@ namespace ts { const validForTypeAssertions = isExclusivelyTypeOnlyImportOrExport(declaration); const override = getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined); if (validForTypeAssertions && override) { + if (!isNightly()) { + grammarErrorOnNode(declaration.assertClause, Diagnostics.Resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next); + } + if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) { return grammarErrorOnNode(declaration.assertClause, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext); } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 2382a16cf1d..bae97eb5375 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3880,6 +3880,10 @@ "category": "Error", "code": 4124 }, + "Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.": { + "category": "Error", + "code": 4125 + }, "The current host does not support the '{0}' option.": { "category": "Error", diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 2d7777e7631..7044953fee6 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -593,7 +593,7 @@ namespace ts { } /* @internal */ - export function getResolutionModeOverrideForClause(clause: AssertClause | undefined, grammarErrorOnNode?: (node: Node, diagnostic: DiagnosticMessage) => boolean) { + export function getResolutionModeOverrideForClause(clause: AssertClause | undefined, grammarErrorOnNode?: (node: Node, diagnostic: DiagnosticMessage) => void) { if (!clause) return undefined; if (length(clause.elements) !== 1) { grammarErrorOnNode?.(clause, Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require); diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts index 0667cf386f7..b855fd4b8da 100644 --- a/src/compiler/transformers/declarations.ts +++ b/src/compiler/transformers/declarations.ts @@ -733,7 +733,7 @@ namespace ts { decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier), - getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined + getResolutionModeOverrideForClauseInNightly(decl.assertClause) ); } // The `importClause` visibility corresponds to the default's visibility. @@ -745,7 +745,7 @@ namespace ts { decl.importClause.isTypeOnly, visibleDefaultBinding, /*namedBindings*/ undefined, - ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined); + ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause)); } if (decl.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { // Namespace import (optionally with visible default) @@ -755,7 +755,7 @@ namespace ts { decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings, - ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined) : undefined; + ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause)) : undefined; } // Named imports (optionally with visible default) const bindingList = mapDefined(decl.importClause.namedBindings.elements, b => resolver.isDeclarationVisible(b) ? b : undefined); @@ -771,7 +771,7 @@ namespace ts { bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : undefined, ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), - getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined + getResolutionModeOverrideForClauseInNightly(decl.assertClause) ); } // Augmentation of export depends on import @@ -782,12 +782,23 @@ namespace ts { decl.modifiers, /*importClause*/ undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier), - getResolutionModeOverrideForClause(decl.assertClause) ? decl.assertClause : undefined + getResolutionModeOverrideForClauseInNightly(decl.assertClause) ); } // Nothing visible } + function getResolutionModeOverrideForClauseInNightly(assertClause: AssertClause | undefined) { + const mode = getResolutionModeOverrideForClause(assertClause); + if (mode !== undefined) { + if (!isNightly()) { + context.addDiagnostic(createDiagnosticForNode(assertClause!, Diagnostics.Resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next)); + } + return assertClause; + } + return undefined; + } + function transformAndReplaceLatePaintedStatements(statements: NodeArray): NodeArray { // This is a `while` loop because `handleSymbolAccessibilityError` can see additional import aliases marked as visible during // error handling which must now be included in the output and themselves checked for errors. diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 3c38df36b44..6036f516bb0 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -4121,6 +4121,10 @@ namespace ts { return indentStrings[1].length; } + export function isNightly() { + return stringContains(version, "-dev") || stringContains(version, "-insiders"); + } + export function createTextWriter(newLine: string): EmitTextWriter { let output: string; let indent: number; From 94391dc9b546e11ca2202557f3c8a299a0d3101a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 7 May 2022 00:22:34 +0000 Subject: [PATCH 06/29] Bump version to 4.8. --- package.json | 2 +- src/compiler/corePublic.ts | 2 +- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 +- tests/baselines/reference/api/typescript.d.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 180063e1d89..56a00f94f7d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "4.7.0", + "version": "4.8.0", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts index 1d84b6726e6..aabd9ac8333 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -1,7 +1,7 @@ namespace ts { // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configurePrerelease` too. - export const versionMajorMinor = "4.7"; + export const versionMajorMinor = "4.8"; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index f7e45674ac0..9f6634bcfa3 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "4.7"; + const versionMajorMinor = "4.8"; /** The version of the TypeScript compiler release */ const version: string; /** diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index fb0a5a0c1e7..2219a924d47 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "4.7"; + const versionMajorMinor = "4.8"; /** The version of the TypeScript compiler release */ const version: string; /** From bc161c0dd8f44df74247c29f5fa5eb97dbae457b Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Sat, 7 May 2022 06:06:49 +0000 Subject: [PATCH 07/29] Update package-lock.json --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 46831288f2d..48355a16ece 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "typescript", - "version": "4.7.0", + "version": "4.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { From 53343dd94d894ba141f53a1b2dde45d91e6b3a14 Mon Sep 17 00:00:00 2001 From: csigs Date: Sat, 7 May 2022 05:42:49 -0700 Subject: [PATCH 08/29] LEGO: Merge pull request 49010 LEGO: Merge pull request 49010 --- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- 10 files changed, 640 insertions(+), 400 deletions(-) diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index b20a7942045..8ef252de28c 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5360,10 +5360,13 @@ - + - + + + + @@ -5376,11 +5379,11 @@ - + - + - + @@ -7965,15 +7968,6 @@ - - - - - - - - - @@ -10757,19 +10751,25 @@ - + - + + + + - + - + + + + @@ -11115,11 +11115,11 @@ - + - + - + @@ -12696,6 +12696,15 @@ + + + + + + + + + @@ -12827,10 +12836,13 @@ - + - + + + + @@ -13140,6 +13152,24 @@ + + + + + + + + + + + + + + + + + + @@ -13728,15 +13758,6 @@ - - - - - - - - - @@ -13746,11 +13767,11 @@ - + - + - + @@ -13764,11 +13785,11 @@ - + - + - + @@ -15950,10 +15971,13 @@ - + - + + + + diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index f614e8f1932..5013f028ff7 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5369,10 +5369,13 @@ - + - + + + + @@ -5385,11 +5388,11 @@ - + - + - + @@ -7974,15 +7977,6 @@ - - - - - - - - - @@ -10766,19 +10760,25 @@ - + - + + + + - + - + + + + @@ -11124,11 +11124,11 @@ - + - + - + @@ -12705,6 +12705,15 @@ + + + + + + + + + @@ -12836,10 +12845,13 @@ - + - + + + + @@ -13149,6 +13161,24 @@ + + + + + + + + + + + + + + + + + + @@ -13737,15 +13767,6 @@ - - - - - - - - - @@ -13755,11 +13776,11 @@ - + - + - + @@ -13773,11 +13794,11 @@ - + - + - + @@ -15959,10 +15980,13 @@ - + - + + + + diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl index 33b4db6a78c..f2b25f7483c 100644 --- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5357,10 +5357,13 @@ - + - + + + + @@ -5373,11 +5376,11 @@ - + - + - + @@ -7962,15 +7965,6 @@ - - - - - - - - - @@ -10751,19 +10745,25 @@ - + - + + + + - + - + + + + @@ -11109,11 +11109,11 @@ - + - + - + @@ -12690,6 +12690,15 @@ + + + + + + + + + @@ -12821,10 +12830,13 @@ - + - + + + + @@ -13134,6 +13146,24 @@ + + + + + + + + + + + + + + + + + + @@ -13722,15 +13752,6 @@ - - - - - - - - - @@ -13740,11 +13761,11 @@ - + - + - + @@ -13758,11 +13779,11 @@ - + - + - + @@ -15944,10 +15965,13 @@ - + - + + + + diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index 0892782e82d..3973855a8b6 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5372,10 +5372,13 @@ - + - + + + + @@ -5388,11 +5391,11 @@ - + - + - + @@ -7977,15 +7980,6 @@ - - - - - - - - - @@ -10769,19 +10763,25 @@ - + - + + + + - + - + + + + @@ -11127,11 +11127,11 @@ - + - + - + @@ -12708,6 +12708,15 @@ + + + + + + + + + @@ -12839,10 +12848,13 @@ - + - + + + + @@ -13152,6 +13164,24 @@ + + + + + + + + + + + + + + + + + + @@ -13740,15 +13770,6 @@ - - - - - - - - - @@ -13758,11 +13779,11 @@ - + - + - + @@ -13776,11 +13797,11 @@ - + - + - + @@ -15962,10 +15983,13 @@ - + - + + + + diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index e2263e2549d..10636017b21 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5372,10 +5372,13 @@ - + - + + + + @@ -5388,11 +5391,11 @@ - + - + - + @@ -7977,15 +7980,6 @@ - - - - - - - - - @@ -10769,19 +10763,25 @@ - + - + + + + - + - + + + + @@ -11127,11 +11127,11 @@ - + - + - + @@ -12708,6 +12708,15 @@ + + + + + + + + + @@ -12839,10 +12848,13 @@ - + - + + + + @@ -13152,6 +13164,24 @@ + + + + + + + + + + + + + + + + + + @@ -13740,15 +13770,6 @@ - - - - - - - - - @@ -13758,11 +13779,11 @@ - + - + - + @@ -13776,11 +13797,11 @@ - + - + - + @@ -15962,10 +15983,13 @@ - + - + + + + diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index e222b1f13d7..b701d37e533 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5360,10 +5360,13 @@ - + - + + + + @@ -5376,11 +5379,11 @@ - + - + - + @@ -7965,15 +7968,6 @@ - - - - - - - - - @@ -10757,19 +10751,25 @@ - + - + + + + - + - + + + + @@ -11115,11 +11115,11 @@ - + - + - + @@ -12696,6 +12696,15 @@ + + + + + + + + + @@ -12827,10 +12836,13 @@ - + - + + + + @@ -13140,6 +13152,24 @@ + + + + + + + + + + + + + + + + + + @@ -13728,15 +13758,6 @@ - - - - - - - - - @@ -13746,11 +13767,11 @@ - + - + - + @@ -13764,11 +13785,11 @@ - + - + - + @@ -15950,10 +15971,13 @@ - + - + + + + diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index fb0bd7b0c44..e79a598527d 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5360,10 +5360,13 @@ - + - + + + + @@ -5376,11 +5379,11 @@ - + - + - + @@ -7965,15 +7968,6 @@ - - - - - - - - - @@ -10757,19 +10751,25 @@ - + - + + + + - + - + + + + @@ -11115,11 +11115,11 @@ - + - + - + @@ -12696,6 +12696,15 @@ + + + + + + + + + @@ -12827,10 +12836,13 @@ - + - + + + + @@ -13140,6 +13152,24 @@ + + + + + + + + + + + + + + + + + + @@ -13728,15 +13758,6 @@ - - - - - - - - - @@ -13746,11 +13767,11 @@ - + - + - + @@ -13764,11 +13785,11 @@ - + - + - + @@ -15950,10 +15971,13 @@ - + - + + + + diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 102654a92b6..b73b15ba1df 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5350,10 +5350,13 @@ - + - + + + + @@ -5366,11 +5369,11 @@ - + - + - + @@ -7955,15 +7958,6 @@ - - - - - - - - - @@ -10744,19 +10738,25 @@ - + - + + + + - + - + + + + @@ -11102,11 +11102,11 @@ - + - + - + @@ -12683,6 +12683,15 @@ + + + + + + + + + @@ -12814,10 +12823,13 @@ - + - + + + + @@ -13127,6 +13139,24 @@ + + + + + + + + + + + + + + + + + + @@ -13715,15 +13745,6 @@ - - - - - - - - - @@ -13733,11 +13754,11 @@ - + - + - + @@ -13751,11 +13772,11 @@ - + - + - + @@ -15937,10 +15958,13 @@ - + - + + + + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index 303d5413039..0f1fbede4a8 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5353,10 +5353,13 @@ - + - + + + + @@ -5369,11 +5372,11 @@ - + - + - + @@ -7958,15 +7961,6 @@ - - - - - - - - - @@ -10747,19 +10741,25 @@ - + - + + + + - + - + + + + @@ -11105,11 +11105,11 @@ - + - + - + @@ -12686,6 +12686,15 @@ + + + + + + + + + @@ -12817,10 +12826,13 @@ - + - + + + + @@ -13130,6 +13142,24 @@ + + + + + + + + + + + + + + + + + + @@ -13718,15 +13748,6 @@ - - - - - - - - - @@ -13736,11 +13757,11 @@ - + - + - + @@ -13754,11 +13775,11 @@ - + - + - + @@ -15940,10 +15961,13 @@ - + - + + + + diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index 2e8bc37a128..03aaabf8e3d 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5359,10 +5359,13 @@ - + - + + + + @@ -5375,11 +5378,11 @@ - + - + - + @@ -7964,15 +7967,6 @@ - - - - - - - - - @@ -10756,19 +10750,25 @@ - + - + + + + - + - + + + + @@ -11114,11 +11114,11 @@ - + - + - + @@ -12695,6 +12695,15 @@ + + + + + + + + + @@ -12826,10 +12835,13 @@ - + - + + + + @@ -13139,6 +13151,24 @@ + + + + + + + + + + + + + + + + + + @@ -13727,15 +13757,6 @@ - - - - - - - - - @@ -13745,11 +13766,11 @@ - + - + - + @@ -13763,11 +13784,11 @@ - + - + - + @@ -15949,10 +15970,13 @@ - + - + + + + From 1071240907ab7aae63ecc9c0bbde42aa51dc7669 Mon Sep 17 00:00:00 2001 From: csigs Date: Sun, 8 May 2022 08:08:33 -0700 Subject: [PATCH 09/29] LEGO: Merge pull request 49016 LEGO: Merge pull request 49016 --- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- .../diagnosticMessages.generated.json.lcl | 104 +++++++++++------- 3 files changed, 192 insertions(+), 120 deletions(-) diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index f6b570fc6ff..19804537abd 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5360,10 +5360,13 @@ - + - + + + + @@ -5376,11 +5379,11 @@ - + - + - + @@ -7965,15 +7968,6 @@ - - - - - - - - - @@ -10757,19 +10751,25 @@ - + - + + + + - + - + + + + @@ -11115,11 +11115,11 @@ - + - + - + @@ -12696,6 +12696,15 @@ + + + + + + + + + @@ -12827,10 +12836,13 @@ - + - + + + + @@ -13140,6 +13152,24 @@ + + + + + + + + + + + + + + + + + + @@ -13728,15 +13758,6 @@ - - - - - - - - - @@ -13746,11 +13767,11 @@ - + - + - + @@ -13764,11 +13785,11 @@ - + - + - + @@ -15950,10 +15971,13 @@ - + - + + + + diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index 372de213b24..5ae6ecab644 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5360,10 +5360,13 @@ - + - + + + + @@ -5376,11 +5379,11 @@ - + - + - + @@ -7965,15 +7968,6 @@ - - - - - - - - - @@ -10757,19 +10751,25 @@ - + - + + + + - + - + + + + @@ -11115,11 +11115,11 @@ - + - + - + @@ -12696,6 +12696,15 @@ + + + + + + + + + @@ -12827,10 +12836,13 @@ - + - + + + + @@ -13140,6 +13152,24 @@ + + + + + + + + + + + + + + + + + + @@ -13728,15 +13758,6 @@ - - - - - - - - - @@ -13746,11 +13767,11 @@ - + - + - + @@ -13764,11 +13785,11 @@ - + - + - + @@ -15950,10 +15971,13 @@ - + - + + + + diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 9ae2836efbf..1641ebc6100 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5353,10 +5353,13 @@ - + - + + + + @@ -5369,11 +5372,11 @@ - + - + - + @@ -7958,15 +7961,6 @@ - - - - - - - - - @@ -10750,19 +10744,25 @@ - + - + + + + - + - + + + + @@ -11108,11 +11108,11 @@ - + - + - + @@ -12689,6 +12689,15 @@ + + + + + + + + + @@ -12820,10 +12829,13 @@ - + - + + + + @@ -13133,6 +13145,24 @@ + + + + + + + + + + + + + + + + + + @@ -13721,15 +13751,6 @@ - - - - - - - - - @@ -13739,11 +13760,11 @@ - + - + - + @@ -13757,11 +13778,11 @@ - + - + - + @@ -15943,10 +15964,13 @@ - + - + + + + From 3dd9ef43ce489526e7284d170afec831147ae655 Mon Sep 17 00:00:00 2001 From: David Souther Date: Mon, 9 May 2022 10:22:22 -0700 Subject: [PATCH 10/29] fix(44466): Fixes parsing contextual keyword casts as arrow functions --- src/compiler/parser.ts | 4 ++++ tests/baselines/reference/overrideParenVariable.js | 8 ++++++++ tests/baselines/reference/overrideParenVariable.symbols | 0 tests/baselines/reference/overrideParenVariable.types | 0 tests/cases/compiler/readonlyParenCast.ts | 5 +++++ 5 files changed, 17 insertions(+) create mode 100644 tests/baselines/reference/overrideParenVariable.js create mode 100644 tests/baselines/reference/overrideParenVariable.symbols create mode 100644 tests/baselines/reference/overrideParenVariable.types create mode 100644 tests/cases/compiler/readonlyParenCast.ts diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index dd1e7f6431a..35536bb2246 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4538,6 +4538,10 @@ namespace ts { // isn't actually allowed, but we want to treat it as a lambda so we can provide // a good error message. if (isModifierKind(second) && second !== SyntaxKind.AsyncKeyword && lookAhead(nextTokenIsIdentifier)) { + if (lookAhead(() => nextToken() === SyntaxKind.AsKeyword)) { + // https://github.com/microsoft/TypeScript/issues/44466 + return Tristate.False; + } return Tristate.True; } diff --git a/tests/baselines/reference/overrideParenVariable.js b/tests/baselines/reference/overrideParenVariable.js new file mode 100644 index 00000000000..22eb85b7c31 --- /dev/null +++ b/tests/baselines/reference/overrideParenVariable.js @@ -0,0 +1,8 @@ +//// [overrideParenVariable.ts] + +let override: any; +export const a = (override as number); + +//// [overrideParenVariable.js] + +export const a = override; diff --git a/tests/baselines/reference/overrideParenVariable.symbols b/tests/baselines/reference/overrideParenVariable.symbols new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/baselines/reference/overrideParenVariable.types b/tests/baselines/reference/overrideParenVariable.types new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/cases/compiler/readonlyParenCast.ts b/tests/cases/compiler/readonlyParenCast.ts new file mode 100644 index 00000000000..b89372d3924 --- /dev/null +++ b/tests/cases/compiler/readonlyParenCast.ts @@ -0,0 +1,5 @@ +//@target: ES5 + +let readonly: any; + +export const a = (readonly as number); \ No newline at end of file From 958adfc9d835dfbf38f0e954e2e52a718ee35bca Mon Sep 17 00:00:00 2001 From: David Souther Date: Mon, 9 May 2022 10:41:02 -0700 Subject: [PATCH 11/29] Use all modifiers test --- .../baselines/reference/modifierParenCast.js | 23 +++++++++++ .../reference/modifierParenCast.symbols | 33 +++++++++++++++ .../reference/modifierParenCast.types | 41 +++++++++++++++++++ .../reference/overrideParenVariable.js | 8 ---- .../reference/overrideParenVariable.symbols | 0 .../reference/overrideParenVariable.types | 0 tests/cases/compiler/modifierParenCast.ts | 11 +++++ tests/cases/compiler/readonlyParenCast.ts | 5 --- 8 files changed, 108 insertions(+), 13 deletions(-) create mode 100644 tests/baselines/reference/modifierParenCast.js create mode 100644 tests/baselines/reference/modifierParenCast.symbols create mode 100644 tests/baselines/reference/modifierParenCast.types delete mode 100644 tests/baselines/reference/overrideParenVariable.js delete mode 100644 tests/baselines/reference/overrideParenVariable.symbols delete mode 100644 tests/baselines/reference/overrideParenVariable.types create mode 100644 tests/cases/compiler/modifierParenCast.ts delete mode 100644 tests/cases/compiler/readonlyParenCast.ts diff --git a/tests/baselines/reference/modifierParenCast.js b/tests/baselines/reference/modifierParenCast.js new file mode 100644 index 00000000000..d4026dcb3d4 --- /dev/null +++ b/tests/baselines/reference/modifierParenCast.js @@ -0,0 +1,23 @@ +//// [modifierParenCast.ts] +let readonly: any = undefined; +let override: any = undefined; +let out: any = undefined; +let declare: any = undefined; + +export const a = (readonly as number); +export const b = (override as number); +export const c = (out as number); +export const d = (declare as number); + +//// [modifierParenCast.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.d = exports.c = exports.b = exports.a = void 0; +var readonly = undefined; +var override = undefined; +var out = undefined; +var declare = undefined; +exports.a = readonly; +exports.b = override; +exports.c = out; +exports.d = declare; diff --git a/tests/baselines/reference/modifierParenCast.symbols b/tests/baselines/reference/modifierParenCast.symbols new file mode 100644 index 00000000000..abf03d6c41a --- /dev/null +++ b/tests/baselines/reference/modifierParenCast.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/modifierParenCast.ts === +let readonly: any = undefined; +>readonly : Symbol(readonly, Decl(modifierParenCast.ts, 0, 3)) +>undefined : Symbol(undefined) + +let override: any = undefined; +>override : Symbol(override, Decl(modifierParenCast.ts, 1, 3)) +>undefined : Symbol(undefined) + +let out: any = undefined; +>out : Symbol(out, Decl(modifierParenCast.ts, 2, 3)) +>undefined : Symbol(undefined) + +let declare: any = undefined; +>declare : Symbol(declare, Decl(modifierParenCast.ts, 3, 3)) +>undefined : Symbol(undefined) + +export const a = (readonly as number); +>a : Symbol(a, Decl(modifierParenCast.ts, 5, 12)) +>readonly : Symbol(readonly, Decl(modifierParenCast.ts, 0, 3)) + +export const b = (override as number); +>b : Symbol(b, Decl(modifierParenCast.ts, 6, 12)) +>override : Symbol(override, Decl(modifierParenCast.ts, 1, 3)) + +export const c = (out as number); +>c : Symbol(c, Decl(modifierParenCast.ts, 7, 12)) +>out : Symbol(out, Decl(modifierParenCast.ts, 2, 3)) + +export const d = (declare as number); +>d : Symbol(d, Decl(modifierParenCast.ts, 8, 12)) +>declare : Symbol(declare, Decl(modifierParenCast.ts, 3, 3)) + diff --git a/tests/baselines/reference/modifierParenCast.types b/tests/baselines/reference/modifierParenCast.types new file mode 100644 index 00000000000..09367b30fca --- /dev/null +++ b/tests/baselines/reference/modifierParenCast.types @@ -0,0 +1,41 @@ +=== tests/cases/compiler/modifierParenCast.ts === +let readonly: any = undefined; +>readonly : any +>undefined : undefined + +let override: any = undefined; +>override : any +>undefined : undefined + +let out: any = undefined; +>out : any +>undefined : undefined + +let declare: any = undefined; +>declare : any +>undefined : undefined + +export const a = (readonly as number); +>a : number +>(readonly as number) : number +>readonly as number : number +>readonly : any + +export const b = (override as number); +>b : number +>(override as number) : number +>override as number : number +>override : any + +export const c = (out as number); +>c : number +>(out as number) : number +>out as number : number +>out : any + +export const d = (declare as number); +>d : number +>(declare as number) : number +>declare as number : number +>declare : any + diff --git a/tests/baselines/reference/overrideParenVariable.js b/tests/baselines/reference/overrideParenVariable.js deleted file mode 100644 index 22eb85b7c31..00000000000 --- a/tests/baselines/reference/overrideParenVariable.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [overrideParenVariable.ts] - -let override: any; -export const a = (override as number); - -//// [overrideParenVariable.js] - -export const a = override; diff --git a/tests/baselines/reference/overrideParenVariable.symbols b/tests/baselines/reference/overrideParenVariable.symbols deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/baselines/reference/overrideParenVariable.types b/tests/baselines/reference/overrideParenVariable.types deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/cases/compiler/modifierParenCast.ts b/tests/cases/compiler/modifierParenCast.ts new file mode 100644 index 00000000000..c2b09f54b68 --- /dev/null +++ b/tests/cases/compiler/modifierParenCast.ts @@ -0,0 +1,11 @@ +//@target: ES5 + +let readonly: any = undefined; +let override: any = undefined; +let out: any = undefined; +let declare: any = undefined; + +export const a = (readonly as number); +export const b = (override as number); +export const c = (out as number); +export const d = (declare as number); \ No newline at end of file diff --git a/tests/cases/compiler/readonlyParenCast.ts b/tests/cases/compiler/readonlyParenCast.ts deleted file mode 100644 index b89372d3924..00000000000 --- a/tests/cases/compiler/readonlyParenCast.ts +++ /dev/null @@ -1,5 +0,0 @@ -//@target: ES5 - -let readonly: any; - -export const a = (readonly as number); \ No newline at end of file From e9d39bd95f3587bb2af058f50ce954d1c99ca416 Mon Sep 17 00:00:00 2001 From: David Souther Date: Mon, 9 May 2022 10:53:58 -0700 Subject: [PATCH 12/29] Remove spurious lookAhead, as this fn is already in a lookAhead --- src/compiler/parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 35536bb2246..755c583b718 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4538,7 +4538,7 @@ namespace ts { // isn't actually allowed, but we want to treat it as a lambda so we can provide // a good error message. if (isModifierKind(second) && second !== SyntaxKind.AsyncKeyword && lookAhead(nextTokenIsIdentifier)) { - if (lookAhead(() => nextToken() === SyntaxKind.AsKeyword)) { + if (nextToken() === SyntaxKind.AsKeyword) { // https://github.com/microsoft/TypeScript/issues/44466 return Tristate.False; } From f84ec3e8b4c877eac27b216fa1192e38f3054022 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 9 May 2022 12:22:00 -0700 Subject: [PATCH 13/29] Fix type parameter comparability to consistently allow comparisons on unconstrained type parameters (#48861) * Fix type parameter comparability to consistently allow comparisons on unconstrained type parameters * Less elaboration, non-strict-mode fix --- src/compiler/checker.ts | 22 +- ...WithNoRelationshipTypeParameter.errors.txt | 338 +----------------- ...straintComparableWithCurlyCurly.errors.txt | 37 ++ ...ithNoConstraintComparableWithCurlyCurly.js | 57 +++ ...ConstraintComparableWithCurlyCurly.symbols | 72 ++++ ...NoConstraintComparableWithCurlyCurly.types | 74 ++++ .../reference/intersectionNarrowing.types | 4 +- .../reference/unknownType1.errors.txt | 6 - .../reference/variadicTuples2.errors.txt | 2 - ...ithNoConstraintComparableWithCurlyCurly.ts | 30 ++ 10 files changed, 291 insertions(+), 351 deletions(-) create mode 100644 tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.errors.txt create mode 100644 tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.js create mode 100644 tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.symbols create mode 100644 tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.types create mode 100644 tests/cases/compiler/genericWithNoConstraintComparableWithCurlyCurly.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6370dddf49f..931ca42486f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19347,6 +19347,20 @@ namespace ts { } } } + if (relation === comparableRelation && sourceFlags & TypeFlags.TypeParameter) { + // This is a carve-out in comparability to essentially forbid comparing a type parameter + // with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!) + let constraint = getConstraintOfTypeParameter(source); + if (constraint && hasNonCircularBaseConstraint(source)) { + while (constraint && constraint.flags & TypeFlags.TypeParameter) { + if (result = isRelatedTo(constraint, target, RecursionFlags.Source, /*reportErrors*/ false)) { + return result; + } + constraint = getConstraintOfTypeParameter(constraint); + } + } + return Ternary.False; + } } else if (targetFlags & TypeFlags.Index) { const targetType = (target as IndexType).type; @@ -19558,8 +19572,8 @@ namespace ts { if (sourceFlags & TypeFlags.TypeVariable) { // IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch if (!(sourceFlags & TypeFlags.IndexedAccess && targetFlags & TypeFlags.IndexedAccess)) { - const constraint = getConstraintOfType(source as TypeVariable); - if (!constraint || (sourceFlags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any)) { + const constraint = getConstraintOfType(source as TypeVariable) || unknownType; + if (!getConstraintOfType(source as TypeVariable) || (sourceFlags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any)) { // A type variable with no constraint is not related to the non-primitive object type. if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive), RecursionFlags.Both)) { resetErrorInfo(saveErrorInfo); @@ -19567,12 +19581,12 @@ namespace ts { } } // hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed - else if (result = isRelatedTo(constraint, target, RecursionFlags.Source, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) { + if (result = isRelatedTo(constraint, target, RecursionFlags.Source, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) { resetErrorInfo(saveErrorInfo); return result; } // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example - else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, RecursionFlags.Source, reportErrors && !(targetFlags & sourceFlags & TypeFlags.TypeParameter), /*headMessage*/ undefined, intersectionState)) { + else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, RecursionFlags.Source, reportErrors && constraint !== unknownType && !(targetFlags & sourceFlags & TypeFlags.TypeParameter), /*headMessage*/ undefined, intersectionState)) { resetErrorInfo(saveErrorInfo); return result; } diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt index da497e03a22..0dea37109fa 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt @@ -6,121 +6,9 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(17,14): error TS2367: This condition will always return 'true' since the types 'T' and 'U' have no overlap. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(18,14): error TS2367: This condition will always return 'false' since the types 'T' and 'U' have no overlap. tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(19,14): error TS2367: This condition will always return 'true' since the types 'T' and 'U' have no overlap. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(22,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(23,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(24,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(25,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(26,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(27,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(28,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(30,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(31,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(32,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(33,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(34,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(35,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(36,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(39,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(40,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(41,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(42,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(43,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(44,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(45,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(47,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(48,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(49,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(50,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(51,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(52,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(53,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(56,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(57,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(58,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(59,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(60,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(61,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(62,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(64,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(65,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(66,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(67,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(68,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(69,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(70,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(73,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(74,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(75,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(76,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(77,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(78,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(79,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(81,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(82,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(83,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(84,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(85,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(86,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(87,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(90,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(91,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(92,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(93,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(94,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(95,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(96,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(98,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(99,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(100,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(101,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(102,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(103,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(104,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(107,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(108,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(109,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(110,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(111,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(112,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(113,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(115,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(116,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(117,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(118,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(119,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(120,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(121,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(124,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(125,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(126,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(127,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(128,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(129,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(130,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(132,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(133,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(134,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(135,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(136,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(137,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(138,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(141,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(142,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(143,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(144,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(145,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(146,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(147,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(149,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(150,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(151,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(152,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(153,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(154,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(155,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts (120 errors) ==== +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts (8 errors) ==== enum E { a, b, c } var a: boolean; @@ -159,361 +47,137 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso // operator < var r1a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r1a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r1a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r1a4 = t < d; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r1a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r1a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r1a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r1b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r1b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r1b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r1b4 = d < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r1b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r1b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r1b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator > var r2a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r2a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r2a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r2a4 = t < d; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r2a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r2a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r2a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r2b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r2b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r2b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r2b4 = d < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r2b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r2b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r2b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator <= var r3a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r3a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r3a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r3a4 = t < d; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r3a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r3a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r3a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r3b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r3b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r3b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r3b4 = d < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r3b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r3b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r3b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator >= var r4a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r4a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r4a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r4a4 = t < d; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r4a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r4a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r4a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r4b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r4b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r4b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r4b4 = d < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r4b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r4b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r4b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator == var r5a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r5a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r5a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r5a4 = t < d; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r5a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r5a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r5a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r5b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r5b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r5b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r5b4 = d < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r5b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r5b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r5b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator != var r6a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r6a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r6a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r6a4 = t < d; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r6a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r6a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r6a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r6b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r6b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r6b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r6b4 = d < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r6b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r6b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r6b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator === var r7a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r7a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r7a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r7a4 = t < d; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r7a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r7a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r7a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r7b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r7b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r7b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r7b4 = d < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r7b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r7b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r7b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator !== var r8a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r8a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r8a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r8a4 = t < d; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. var r8a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r8a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r8a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r8b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r8b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r8b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r8b4 = d < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. var r8b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r8b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r8b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.errors.txt b/tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.errors.txt new file mode 100644 index 00000000000..32ea0497ee9 --- /dev/null +++ b/tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.errors.txt @@ -0,0 +1,37 @@ +tests/cases/compiler/genericWithNoConstraintComparableWithCurlyCurly.ts(23,5): error TS2352: Conversion of type '{}' to type 'T' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + 'T' could be instantiated with an arbitrary type which could be unrelated to '{}'. + + +==== tests/cases/compiler/genericWithNoConstraintComparableWithCurlyCurly.ts (1 errors) ==== + function foo() { + let x = {}; + x as T; + } + + function bar() { + let x = {}; + x as T; + } + + function baz() { + let x = {}; + x as T; + } + + function bat() { + let x = {}; + x as T; + } + + function no() { + let x = {}; + x as T; // should error + ~~~~~~ +!!! error TS2352: Conversion of type '{}' to type 'T' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. +!!! error TS2352: 'T' could be instantiated with an arbitrary type which could be unrelated to '{}'. + } + + function yes() { + let x = {}; + x as T; + } \ No newline at end of file diff --git a/tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.js b/tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.js new file mode 100644 index 00000000000..aec914a724c --- /dev/null +++ b/tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.js @@ -0,0 +1,57 @@ +//// [genericWithNoConstraintComparableWithCurlyCurly.ts] +function foo() { + let x = {}; + x as T; +} + +function bar() { + let x = {}; + x as T; +} + +function baz() { + let x = {}; + x as T; +} + +function bat() { + let x = {}; + x as T; +} + +function no() { + let x = {}; + x as T; // should error +} + +function yes() { + let x = {}; + x as T; +} + +//// [genericWithNoConstraintComparableWithCurlyCurly.js] +"use strict"; +function foo() { + var x = {}; + x; +} +function bar() { + var x = {}; + x; +} +function baz() { + var x = {}; + x; +} +function bat() { + var x = {}; + x; +} +function no() { + var x = {}; + x; // should error +} +function yes() { + var x = {}; + x; +} diff --git a/tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.symbols b/tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.symbols new file mode 100644 index 00000000000..a0de33ed6ac --- /dev/null +++ b/tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.symbols @@ -0,0 +1,72 @@ +=== tests/cases/compiler/genericWithNoConstraintComparableWithCurlyCurly.ts === +function foo() { +>foo : Symbol(foo, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 0, 0)) +>T : Symbol(T, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 0, 13)) + + let x = {}; +>x : Symbol(x, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 1, 7)) + + x as T; +>x : Symbol(x, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 1, 7)) +>T : Symbol(T, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 0, 13)) +} + +function bar() { +>bar : Symbol(bar, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 3, 1)) +>T : Symbol(T, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 5, 13)) + + let x = {}; +>x : Symbol(x, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 6, 7)) + + x as T; +>x : Symbol(x, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 6, 7)) +>T : Symbol(T, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 5, 13)) +} + +function baz() { +>baz : Symbol(baz, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 8, 1)) +>T : Symbol(T, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 10, 13)) + + let x = {}; +>x : Symbol(x, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 11, 7)) + + x as T; +>x : Symbol(x, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 11, 7)) +>T : Symbol(T, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 10, 13)) +} + +function bat() { +>bat : Symbol(bat, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 13, 1)) +>T : Symbol(T, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 15, 13)) + + let x = {}; +>x : Symbol(x, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 16, 7)) + + x as T; +>x : Symbol(x, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 16, 7)) +>T : Symbol(T, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 15, 13)) +} + +function no() { +>no : Symbol(no, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 18, 1)) +>T : Symbol(T, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 20, 12)) + + let x = {}; +>x : Symbol(x, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 21, 7)) + + x as T; // should error +>x : Symbol(x, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 21, 7)) +>T : Symbol(T, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 20, 12)) +} + +function yes() { +>yes : Symbol(yes, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 23, 1)) +>T : Symbol(T, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 25, 13)) + + let x = {}; +>x : Symbol(x, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 26, 7)) + + x as T; +>x : Symbol(x, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 26, 7)) +>T : Symbol(T, Decl(genericWithNoConstraintComparableWithCurlyCurly.ts, 25, 13)) +} diff --git a/tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.types b/tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.types new file mode 100644 index 00000000000..c996bbb9298 --- /dev/null +++ b/tests/baselines/reference/genericWithNoConstraintComparableWithCurlyCurly.types @@ -0,0 +1,74 @@ +=== tests/cases/compiler/genericWithNoConstraintComparableWithCurlyCurly.ts === +function foo() { +>foo : () => void + + let x = {}; +>x : {} +>{} : {} + + x as T; +>x as T : T +>x : {} +} + +function bar() { +>bar : () => void + + let x = {}; +>x : {} +>{} : {} + + x as T; +>x as T : T +>x : {} +} + +function baz() { +>baz : () => void + + let x = {}; +>x : {} +>{} : {} + + x as T; +>x as T : T +>x : {} +} + +function bat() { +>bat : () => void + + let x = {}; +>x : {} +>{} : {} + + x as T; +>x as T : T +>x : {} +} + +function no() { +>no : () => void +>null : null + + let x = {}; +>x : {} +>{} : {} + + x as T; // should error +>x as T : T +>x : {} +} + +function yes() { +>yes : () => void +>null : null + + let x = {}; +>x : {} +>{} : {} + + x as T; +>x as T : T +>x : {} +} diff --git a/tests/baselines/reference/intersectionNarrowing.types b/tests/baselines/reference/intersectionNarrowing.types index 049e6c976eb..7cf2c0dfda0 100644 --- a/tests/baselines/reference/intersectionNarrowing.types +++ b/tests/baselines/reference/intersectionNarrowing.types @@ -59,11 +59,11 @@ function f4(x: T & 1 | T & 2) { case 1: x; break; // T & 1 >1 : 1 ->x : T & 1 +>x : (T & 1) | (T & 2) case 2: x; break; // T & 2 >2 : 2 ->x : T & 2 +>x : (T & 1) | (T & 2) default: x; // Should narrow to never >x : never diff --git a/tests/baselines/reference/unknownType1.errors.txt b/tests/baselines/reference/unknownType1.errors.txt index 138fff847cc..342d0fbb706 100644 --- a/tests/baselines/reference/unknownType1.errors.txt +++ b/tests/baselines/reference/unknownType1.errors.txt @@ -16,7 +16,6 @@ tests/cases/conformance/types/unknown/unknownType1.ts(112,9): error TS2322: Type tests/cases/conformance/types/unknown/unknownType1.ts(113,9): error TS2322: Type 'unknown' is not assignable to type '{}'. tests/cases/conformance/types/unknown/unknownType1.ts(114,9): error TS2322: Type 'unknown' is not assignable to type '{} | null | undefined'. tests/cases/conformance/types/unknown/unknownType1.ts(120,9): error TS2322: Type 'T' is not assignable to type 'object'. - Type 'unknown' is not assignable to type 'object'. tests/cases/conformance/types/unknown/unknownType1.ts(128,5): error TS2322: Type 'number[]' is not assignable to type '{ [x: string]: unknown; }'. Index signature for type 'string' is missing in type 'number[]'. tests/cases/conformance/types/unknown/unknownType1.ts(129,5): error TS2322: Type 'number' is not assignable to type '{ [x: string]: unknown; }'. @@ -26,9 +25,7 @@ tests/cases/conformance/types/unknown/unknownType1.ts(150,17): error TS2355: A f tests/cases/conformance/types/unknown/unknownType1.ts(156,14): error TS2700: Rest types may only be created from object types. tests/cases/conformance/types/unknown/unknownType1.ts(162,5): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. tests/cases/conformance/types/unknown/unknownType1.ts(171,9): error TS2322: Type 'U' is not assignable to type '{}'. - Type 'unknown' is not assignable to type '{}'. tests/cases/conformance/types/unknown/unknownType1.ts(181,5): error TS2322: Type 'T' is not assignable to type '{}'. - Type 'unknown' is not assignable to type '{}'. ==== tests/cases/conformance/types/unknown/unknownType1.ts (27 errors) ==== @@ -188,7 +185,6 @@ tests/cases/conformance/types/unknown/unknownType1.ts(181,5): error TS2322: Type let y: object = x; // Error ~ !!! error TS2322: Type 'T' is not assignable to type 'object'. -!!! error TS2322: Type 'unknown' is not assignable to type 'object'. } // Anything fresh but primitive assignable to { [x: string]: unknown } @@ -257,7 +253,6 @@ tests/cases/conformance/types/unknown/unknownType1.ts(181,5): error TS2322: Type let y: {} = u; ~ !!! error TS2322: Type 'U' is not assignable to type '{}'. -!!! error TS2322: Type 'unknown' is not assignable to type '{}'. } // Repro from #26796 @@ -270,6 +265,5 @@ tests/cases/conformance/types/unknown/unknownType1.ts(181,5): error TS2322: Type return arg; // Error ~~~~~~~~~~~ !!! error TS2322: Type 'T' is not assignable to type '{}'. -!!! error TS2322: Type 'unknown' is not assignable to type '{}'. } \ No newline at end of file diff --git a/tests/baselines/reference/variadicTuples2.errors.txt b/tests/baselines/reference/variadicTuples2.errors.txt index 2947b3e1d57..dc7bcb061ee 100644 --- a/tests/baselines/reference/variadicTuples2.errors.txt +++ b/tests/baselines/reference/variadicTuples2.errors.txt @@ -44,7 +44,6 @@ tests/cases/conformance/types/tuple/variadicTuples2.ts(73,5): error TS2322: Type tests/cases/conformance/types/tuple/variadicTuples2.ts(74,5): error TS2322: Type '[number, ...T]' is not assignable to type '[number, ...number[]]'. Type at position 1 in source is not compatible with type at position 1 in target. Type 'T[number]' is not assignable to type 'number'. - Type 'unknown' is not assignable to type 'number'. tests/cases/conformance/types/tuple/variadicTuples2.ts(107,16): error TS2345: Argument of type '[1, 2, 3, 4]' is not assignable to parameter of type '[...number[], (...values: number[]) => void]'. Type at position 3 in source is not compatible with type at position 1 in target. Type 'number' is not assignable to type '(...values: number[]) => void'. @@ -206,7 +205,6 @@ tests/cases/conformance/types/tuple/variadicTuples2.ts(130,25): error TS2345: Ar !!! error TS2322: Type '[number, ...T]' is not assignable to type '[number, ...number[]]'. !!! error TS2322: Type at position 1 in source is not compatible with type at position 1 in target. !!! error TS2322: Type 'T[number]' is not assignable to type 'number'. -!!! error TS2322: Type 'unknown' is not assignable to type 'number'. } // Inference diff --git a/tests/cases/compiler/genericWithNoConstraintComparableWithCurlyCurly.ts b/tests/cases/compiler/genericWithNoConstraintComparableWithCurlyCurly.ts new file mode 100644 index 00000000000..45976d074c1 --- /dev/null +++ b/tests/cases/compiler/genericWithNoConstraintComparableWithCurlyCurly.ts @@ -0,0 +1,30 @@ +// @strict: true +function foo() { + let x = {}; + x as T; +} + +function bar() { + let x = {}; + x as T; +} + +function baz() { + let x = {}; + x as T; +} + +function bat() { + let x = {}; + x as T; +} + +function no() { + let x = {}; + x as T; // should error +} + +function yes() { + let x = {}; + x as T; +} \ No newline at end of file From f3f0a3f394c7ce702ee23d4396e23b03b68e3fe3 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 9 May 2022 12:48:24 -0700 Subject: [PATCH 14/29] Fix module specifier generation crash from typesVersions (#49035) --- src/compiler/moduleSpecifiers.ts | 1 + .../importNameCodeFix_typesVersions.ts | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 tests/cases/fourslash/importNameCodeFix_typesVersions.ts diff --git a/src/compiler/moduleSpecifiers.ts b/src/compiler/moduleSpecifiers.ts index ed8d9f90b0a..44d20c9ff59 100644 --- a/src/compiler/moduleSpecifiers.ts +++ b/src/compiler/moduleSpecifiers.ts @@ -810,6 +810,7 @@ namespace ts.moduleSpecifiers { function removeExtensionAndIndexPostFix(fileName: string, ending: Ending, options: CompilerOptions, host?: ModuleSpecifierResolutionHost): string { if (fileExtensionIsOneOf(fileName, [Extension.Json, Extension.Mjs, Extension.Cjs])) return fileName; const noExtension = removeFileExtension(fileName); + if (fileName === noExtension) return fileName; if (fileExtensionIsOneOf(fileName, [Extension.Dmts, Extension.Mts, Extension.Dcts, Extension.Cts])) return noExtension + getJSExtensionForFile(fileName, options); switch (ending) { case Ending.Minimal: diff --git a/tests/cases/fourslash/importNameCodeFix_typesVersions.ts b/tests/cases/fourslash/importNameCodeFix_typesVersions.ts new file mode 100644 index 00000000000..9f69e3eb44f --- /dev/null +++ b/tests/cases/fourslash/importNameCodeFix_typesVersions.ts @@ -0,0 +1,34 @@ +/// + +// @module: commonjs +// @checkJs: true + +// @Filename: /node_modules/unified/package.json +//// { +//// "name": "unified", +//// "types": "types/ts3.4/index.d.ts", +//// "typesVersions": { +//// ">=4.0": { +//// "types/ts3.4/*": [ +//// "types/ts4.0/*" +//// ] +//// } +//// } +//// } + +// @Filename: /node_modules/unified/types/ts3.4/index.d.ts +//// export declare const x: number; + +// @Filename: /node_modules/unified/types/ts4.0/index.d.ts +//// export declare const x: number; + +// @Filename: /foo.js +//// import {} from "unified"; + +// @Filename: /index.js +//// x/**/ + +verify.importFixModuleSpecifiers("", [ + "unified", + "unified/types/ts3.4/", // TODO: this is wrong #49034 +], { importModuleSpecifierEnding: "js" }); From e2bd89b3099088be3a4a4c483195809f04853b62 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 9 May 2022 13:58:36 -0700 Subject: [PATCH 15/29] Report error for invalid 'this' type during 'await' (#48946) --- src/compiler/checker.ts | 37 ++++++++++-- .../await_incorrectThisType.errors.txt | 57 +++++++++++++++++++ .../async/es2017/await_incorrectThisType.ts | 48 ++++++++++++++++ 3 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 tests/baselines/reference/await_incorrectThisType.errors.txt create mode 100644 tests/cases/conformance/async/es2017/await_incorrectThisType.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 931ca42486f..f49cfb36189 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -36270,7 +36270,7 @@ namespace ts { * @param type The type of the promise. * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. */ - function getPromisedTypeOfPromise(type: Type, errorNode?: Node): Type | undefined { + function getPromisedTypeOfPromise(type: Type, errorNode?: Node, thisTypeForErrorOut?: { value?: Type }): Type | undefined { // // { // type // then( // thenFunction @@ -36312,7 +36312,30 @@ namespace ts { return undefined; } - const onfulfilledParameterType = getTypeWithFacts(getUnionType(map(thenSignatures, getTypeOfFirstParameterOfSignature)), TypeFacts.NEUndefinedOrNull); + let thisTypeForError: Type | undefined; + let candidates: Signature[] | undefined; + for (const thenSignature of thenSignatures) { + const thisType = getThisTypeOfSignature(thenSignature); + if (thisType && thisType !== voidType && !isTypeRelatedTo(type, thisType, subtypeRelation)) { + thisTypeForError = thisType; + } + else { + candidates = append(candidates, thenSignature); + } + } + + if (!candidates) { + Debug.assertIsDefined(thisTypeForError); + if (thisTypeForErrorOut) { + thisTypeForErrorOut.value = thisTypeForError; + } + if (errorNode) { + error(errorNode, Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForError)); + } + return undefined; + } + + const onfulfilledParameterType = getTypeWithFacts(getUnionType(map(candidates, getTypeOfFirstParameterOfSignature)), TypeFacts.NEUndefinedOrNull); if (isTypeAny(onfulfilledParameterType)) { return undefined; } @@ -36459,7 +36482,8 @@ namespace ts { return typeAsAwaitable.awaitedTypeOfType = mapType(type, mapper); } - const promisedType = getPromisedTypeOfPromise(type); + const thisTypeForErrorOut: { value: Type | undefined } = { value: undefined }; + const promisedType = getPromisedTypeOfPromise(type, /*errorNode*/ undefined, thisTypeForErrorOut); if (promisedType) { if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) { // Verify that we don't have a bad actor in the form of a promise whose @@ -36532,7 +36556,12 @@ namespace ts { if (isThenableType(type)) { if (errorNode) { Debug.assertIsDefined(diagnosticMessage); - error(errorNode, diagnosticMessage, arg0); + let chain: DiagnosticMessageChain | undefined; + if (thisTypeForErrorOut.value) { + chain = chainDiagnosticMessages(chain, Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type), typeToString(thisTypeForErrorOut.value)); + } + chain = chainDiagnosticMessages(chain, diagnosticMessage, arg0); + diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode, chain)); } return undefined; } diff --git a/tests/baselines/reference/await_incorrectThisType.errors.txt b/tests/baselines/reference/await_incorrectThisType.errors.txt new file mode 100644 index 00000000000..eea59d55e6a --- /dev/null +++ b/tests/baselines/reference/await_incorrectThisType.errors.txt @@ -0,0 +1,57 @@ +tests/cases/conformance/async/es2017/await_incorrectThisType.ts(40,1): error TS2684: The 'this' context of type 'EPromise' is not assignable to method's 'this' of type 'EPromise'. + Type 'number' is not assignable to type 'never'. +tests/cases/conformance/async/es2017/await_incorrectThisType.ts(43,5): error TS1320: Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member. + The 'this' context of type 'EPromise' is not assignable to method's 'this' of type 'EPromise'. + + +==== tests/cases/conformance/async/es2017/await_incorrectThisType.ts (2 errors) ==== + // https://github.com/microsoft/TypeScript/issues/47711 + type Either = Left | Right; + type Left = { tag: 'Left', e: E }; + type Right = { tag: 'Right', a: A }; + + const mkLeft = (e: E): Either => ({ tag: 'Left', e }); + const mkRight = (a: A): Either => ({ tag: 'Right', a }); + + class EPromise implements PromiseLike { + static succeed(a: A): EPromise { + return new EPromise(Promise.resolve(mkRight(a))); + } + + static fail(e: E): EPromise { + return new EPromise(Promise.resolve(mkLeft(e))); + } + + constructor(readonly p: PromiseLike>) { } + + then( + // EPromise can act as a Thenable only when `E` is `never`. + this: EPromise, + onfulfilled?: ((value: A) => B | PromiseLike) | null | undefined, + onrejected?: ((reason: any) => B1 | PromiseLike) | null | undefined + ): PromiseLike { + return this.p.then( + // Casting to `Right` is safe here because we've eliminated the possibility of `Left`. + either => onfulfilled?.((either as Right).a) ?? (either as Right).a as unknown as B, + onrejected + ) + } + } + + const withTypedFailure: EPromise = EPromise.fail(1); + + // Errors as expected: + // + // "The 'this' context of type 'EPromise' is not assignable to method's + // 'this' of type 'EPromise" + withTypedFailure.then(s => s.toUpperCase()).then(console.log); + ~~~~~~~~~~~~~~~~ +!!! error TS2684: The 'this' context of type 'EPromise' is not assignable to method's 'this' of type 'EPromise'. +!!! error TS2684: Type 'number' is not assignable to type 'never'. + + async function test() { + await withTypedFailure; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1320: Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member. +!!! error TS1320: The 'this' context of type 'EPromise' is not assignable to method's 'this' of type 'EPromise'. + } \ No newline at end of file diff --git a/tests/cases/conformance/async/es2017/await_incorrectThisType.ts b/tests/cases/conformance/async/es2017/await_incorrectThisType.ts new file mode 100644 index 00000000000..7672591dd92 --- /dev/null +++ b/tests/cases/conformance/async/es2017/await_incorrectThisType.ts @@ -0,0 +1,48 @@ +// @target: esnext +// @noEmit: true +// @noTypesAndSymbols: true + +// https://github.com/microsoft/TypeScript/issues/47711 +type Either = Left | Right; +type Left = { tag: 'Left', e: E }; +type Right = { tag: 'Right', a: A }; + +const mkLeft = (e: E): Either => ({ tag: 'Left', e }); +const mkRight = (a: A): Either => ({ tag: 'Right', a }); + +class EPromise implements PromiseLike { + static succeed(a: A): EPromise { + return new EPromise(Promise.resolve(mkRight(a))); + } + + static fail(e: E): EPromise { + return new EPromise(Promise.resolve(mkLeft(e))); + } + + constructor(readonly p: PromiseLike>) { } + + then( + // EPromise can act as a Thenable only when `E` is `never`. + this: EPromise, + onfulfilled?: ((value: A) => B | PromiseLike) | null | undefined, + onrejected?: ((reason: any) => B1 | PromiseLike) | null | undefined + ): PromiseLike { + return this.p.then( + // Casting to `Right` is safe here because we've eliminated the possibility of `Left`. + either => onfulfilled?.((either as Right).a) ?? (either as Right).a as unknown as B, + onrejected + ) + } +} + +const withTypedFailure: EPromise = EPromise.fail(1); + +// Errors as expected: +// +// "The 'this' context of type 'EPromise' is not assignable to method's +// 'this' of type 'EPromise" +withTypedFailure.then(s => s.toUpperCase()).then(console.log); + +async function test() { + await withTypedFailure; +} \ No newline at end of file From d6e483b8dabd8fd37c00954c3f2184bb7f1eb90c Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Mon, 9 May 2022 17:25:05 -0400 Subject: [PATCH 16/29] fix(48887) exposing rest helper functions externally (#48888) * fix(48887) exposing rest helper functions externally * fixing baseline + adding hint about how to fix baseline * Update src/harness/harnessIO.ts Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> --- src/compiler/utilities.ts | 10 ---------- src/compiler/utilitiesPublic.ts | 11 +++++++++++ src/harness/harnessIO.ts | 9 +++++++-- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 ++ tests/baselines/reference/api/typescript.d.ts | 2 ++ 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 6036f516bb0..a554f1f54d0 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2866,16 +2866,6 @@ namespace ts { return typeParameters && find(typeParameters, p => p.name.escapedText === name); } - export function hasRestParameter(s: SignatureDeclaration | JSDocSignature): boolean { - const last = lastOrUndefined(s.parameters); - return !!last && isRestParameter(last); - } - - export function isRestParameter(node: ParameterDeclaration | JSDocParameterTag): boolean { - const type = isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return (node as ParameterDeclaration).dotDotDotToken !== undefined || !!type && type.kind === SyntaxKind.JSDocVariadicType; - } - export function hasTypeArguments(node: Node): node is HasTypeArguments { return !!(node as HasTypeArguments).typeArguments; } diff --git a/src/compiler/utilitiesPublic.ts b/src/compiler/utilitiesPublic.ts index ecfb4e52daf..2f4ed3b14cc 100644 --- a/src/compiler/utilitiesPublic.ts +++ b/src/compiler/utilitiesPublic.ts @@ -2015,5 +2015,16 @@ namespace ts { export function isJSDocLinkLike(node: Node): node is JSDocLink | JSDocLinkCode | JSDocLinkPlain { return node.kind === SyntaxKind.JSDocLink || node.kind === SyntaxKind.JSDocLinkCode || node.kind === SyntaxKind.JSDocLinkPlain; } + + export function hasRestParameter(s: SignatureDeclaration | JSDocSignature): boolean { + const last = lastOrUndefined(s.parameters); + return !!last && isRestParameter(last); + } + + export function isRestParameter(node: ParameterDeclaration | JSDocParameterTag): boolean { + const type = isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; + return (node as ParameterDeclaration).dotDotDotToken !== undefined || !!type && type.kind === SyntaxKind.JSDocVariadicType; + } + // #endregion } diff --git a/src/harness/harnessIO.ts b/src/harness/harnessIO.ts index 558aca6bfd3..2786498d41e 100644 --- a/src/harness/harnessIO.ts +++ b/src/harness/harnessIO.ts @@ -1389,22 +1389,27 @@ namespace Harness { else { IO.writeFile(actualFileName, encodedActual); } + const errorMessage = getBaselineFileChangedErrorMessage(relativeFileName); if (!!require && opts && opts.PrintDiff) { const Diff = require("diff"); const patch = Diff.createTwoFilesPatch("Expected", "Actual", expected, actual, "The current baseline", "The new version"); - throw new Error(`The baseline file ${relativeFileName} has changed.${ts.ForegroundColorEscapeSequences.Grey}\n\n${patch}`); + throw new Error(`${errorMessage}${ts.ForegroundColorEscapeSequences.Grey}\n\n${patch}`); } else { if (!IO.fileExists(expected)) { throw new Error(`New baseline created at ${IO.joinPath("tests", "baselines","local", relativeFileName)}`); } else { - throw new Error(`The baseline file ${relativeFileName} has changed.`); + throw new Error(errorMessage); } } } } + function getBaselineFileChangedErrorMessage(relativeFileName: string): string { + return `The baseline file ${relativeFileName} has changed. (Run "gulp baseline-accept" if the new baseline is correct.)`; + } + export function runBaseline(relativeFileName: string, actual: string | null, opts?: BaselineOptions): void { const actualFileName = localPath(relativeFileName, opts && opts.Baselinefolder, opts && opts.Subfolder); if (actual === undefined) { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 9f6634bcfa3..260e74c4f32 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -4510,6 +4510,8 @@ declare namespace ts { function isObjectLiteralElement(node: Node): node is ObjectLiteralElement; function isStringLiteralLike(node: Node): node is StringLiteralLike; function isJSDocLinkLike(node: Node): node is JSDocLink | JSDocLinkCode | JSDocLinkPlain; + function hasRestParameter(s: SignatureDeclaration | JSDocSignature): boolean; + function isRestParameter(node: ParameterDeclaration | JSDocParameterTag): boolean; } declare namespace ts { const factory: NodeFactory; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 2219a924d47..a1bde2444e7 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -4510,6 +4510,8 @@ declare namespace ts { function isObjectLiteralElement(node: Node): node is ObjectLiteralElement; function isStringLiteralLike(node: Node): node is StringLiteralLike; function isJSDocLinkLike(node: Node): node is JSDocLink | JSDocLinkCode | JSDocLinkPlain; + function hasRestParameter(s: SignatureDeclaration | JSDocSignature): boolean; + function isRestParameter(node: ParameterDeclaration | JSDocParameterTag): boolean; } declare namespace ts { const factory: NodeFactory; From aa48a37e0924e2aa970f62321705e5fe80fb6e46 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Tue, 10 May 2022 00:56:56 +0300 Subject: [PATCH 17/29] fix(48673): allow Find All References on access modifier for constructor (#48813) --- src/services/utilities.ts | 2 + ...nstructorFindAllReferences1.baseline.jsonc | 63 ++++++++++++++++++ ...nstructorFindAllReferences2.baseline.jsonc | 63 ++++++++++++++++++ ...nstructorFindAllReferences3.baseline.jsonc | 65 +++++++++++++++++++ ...nstructorFindAllReferences4.baseline.jsonc | 63 ++++++++++++++++++ .../constructorFindAllReferences1.ts | 10 +++ .../constructorFindAllReferences2.ts | 10 +++ .../constructorFindAllReferences3.ts | 10 +++ .../constructorFindAllReferences4.ts | 10 +++ 9 files changed, 296 insertions(+) create mode 100644 tests/baselines/reference/constructorFindAllReferences1.baseline.jsonc create mode 100644 tests/baselines/reference/constructorFindAllReferences2.baseline.jsonc create mode 100644 tests/baselines/reference/constructorFindAllReferences3.baseline.jsonc create mode 100644 tests/baselines/reference/constructorFindAllReferences4.baseline.jsonc create mode 100644 tests/cases/fourslash/constructorFindAllReferences1.ts create mode 100644 tests/cases/fourslash/constructorFindAllReferences2.ts create mode 100644 tests/cases/fourslash/constructorFindAllReferences3.ts create mode 100644 tests/cases/fourslash/constructorFindAllReferences4.ts diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 18f85ceb264..60aa2c7d194 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -806,6 +806,8 @@ namespace ts { case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: return getAdjustedLocationForFunction(node as FunctionDeclaration | FunctionExpression); + case SyntaxKind.Constructor: + return node; } } if (isNamedDeclaration(node)) { diff --git a/tests/baselines/reference/constructorFindAllReferences1.baseline.jsonc b/tests/baselines/reference/constructorFindAllReferences1.baseline.jsonc new file mode 100644 index 00000000000..e7bebca38f5 --- /dev/null +++ b/tests/baselines/reference/constructorFindAllReferences1.baseline.jsonc @@ -0,0 +1,63 @@ +// === /tests/cases/fourslash/constructorFindAllReferences1.ts === +// export class C { +// /*FIND ALL REFS*/public [|constructor|]() { } +// public foo() { } +// } +// +// new [|C|]().foo(); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/constructorFindAllReferences1.ts", + "kind": "class", + "name": "class C", + "textSpan": { + "start": 13, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + } + ], + "contextSpan": { + "start": 0, + "length": 68 + } + }, + "references": [ + { + "textSpan": { + "start": 28, + "length": 11 + }, + "fileName": "/tests/cases/fourslash/constructorFindAllReferences1.ts", + "contextSpan": { + "start": 21, + "length": 24 + }, + "isWriteAccess": false + }, + { + "textSpan": { + "start": 74, + "length": 1 + }, + "fileName": "/tests/cases/fourslash/constructorFindAllReferences1.ts", + "isWriteAccess": false + } + ] + } +] \ No newline at end of file diff --git a/tests/baselines/reference/constructorFindAllReferences2.baseline.jsonc b/tests/baselines/reference/constructorFindAllReferences2.baseline.jsonc new file mode 100644 index 00000000000..3555381950d --- /dev/null +++ b/tests/baselines/reference/constructorFindAllReferences2.baseline.jsonc @@ -0,0 +1,63 @@ +// === /tests/cases/fourslash/constructorFindAllReferences2.ts === +// export class C { +// /*FIND ALL REFS*/private [|constructor|]() { } +// public foo() { } +// } +// +// new [|C|]().foo(); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/constructorFindAllReferences2.ts", + "kind": "class", + "name": "class C", + "textSpan": { + "start": 13, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + } + ], + "contextSpan": { + "start": 0, + "length": 69 + } + }, + "references": [ + { + "textSpan": { + "start": 29, + "length": 11 + }, + "fileName": "/tests/cases/fourslash/constructorFindAllReferences2.ts", + "contextSpan": { + "start": 21, + "length": 25 + }, + "isWriteAccess": false + }, + { + "textSpan": { + "start": 75, + "length": 1 + }, + "fileName": "/tests/cases/fourslash/constructorFindAllReferences2.ts", + "isWriteAccess": false + } + ] + } +] \ No newline at end of file diff --git a/tests/baselines/reference/constructorFindAllReferences3.baseline.jsonc b/tests/baselines/reference/constructorFindAllReferences3.baseline.jsonc new file mode 100644 index 00000000000..79a200e253d --- /dev/null +++ b/tests/baselines/reference/constructorFindAllReferences3.baseline.jsonc @@ -0,0 +1,65 @@ +// === /tests/cases/fourslash/constructorFindAllReferences3.ts === +// export class C { +// /*FIND ALL REFS*/[|constructor|]() { } +// public foo() { } +// } +// +// new [|C|]().foo(); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/constructorFindAllReferences3.ts", + "kind": "class", + "name": "class C", + "textSpan": { + "start": 13, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + } + ], + "contextSpan": { + "start": 0, + "length": 61 + } + }, + "references": [ + { + "textSpan": { + "start": 21, + "length": 11 + }, + "fileName": "/tests/cases/fourslash/constructorFindAllReferences3.ts", + "contextSpan": { + "start": 21, + "length": 17 + }, + "isWriteAccess": false, + "isDefinition": true + }, + { + "textSpan": { + "start": 67, + "length": 1 + }, + "fileName": "/tests/cases/fourslash/constructorFindAllReferences3.ts", + "isWriteAccess": false, + "isDefinition": false + } + ] + } +] \ No newline at end of file diff --git a/tests/baselines/reference/constructorFindAllReferences4.baseline.jsonc b/tests/baselines/reference/constructorFindAllReferences4.baseline.jsonc new file mode 100644 index 00000000000..1d899ba5e84 --- /dev/null +++ b/tests/baselines/reference/constructorFindAllReferences4.baseline.jsonc @@ -0,0 +1,63 @@ +// === /tests/cases/fourslash/constructorFindAllReferences4.ts === +// export class C { +// /*FIND ALL REFS*/protected [|constructor|]() { } +// public foo() { } +// } +// +// new [|C|]().foo(); + +[ + { + "definition": { + "containerKind": "", + "containerName": "", + "fileName": "/tests/cases/fourslash/constructorFindAllReferences4.ts", + "kind": "class", + "name": "class C", + "textSpan": { + "start": 13, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + } + ], + "contextSpan": { + "start": 0, + "length": 71 + } + }, + "references": [ + { + "textSpan": { + "start": 31, + "length": 11 + }, + "fileName": "/tests/cases/fourslash/constructorFindAllReferences4.ts", + "contextSpan": { + "start": 21, + "length": 27 + }, + "isWriteAccess": false + }, + { + "textSpan": { + "start": 77, + "length": 1 + }, + "fileName": "/tests/cases/fourslash/constructorFindAllReferences4.ts", + "isWriteAccess": false + } + ] + } +] \ No newline at end of file diff --git a/tests/cases/fourslash/constructorFindAllReferences1.ts b/tests/cases/fourslash/constructorFindAllReferences1.ts new file mode 100644 index 00000000000..23ede06bdce --- /dev/null +++ b/tests/cases/fourslash/constructorFindAllReferences1.ts @@ -0,0 +1,10 @@ +/// + +////export class C { +//// /**/public constructor() { } +//// public foo() { } +////} +//// +////new C().foo(); + +verify.baselineFindAllReferences(""); diff --git a/tests/cases/fourslash/constructorFindAllReferences2.ts b/tests/cases/fourslash/constructorFindAllReferences2.ts new file mode 100644 index 00000000000..26b61da9096 --- /dev/null +++ b/tests/cases/fourslash/constructorFindAllReferences2.ts @@ -0,0 +1,10 @@ +/// + +////export class C { +//// /**/private constructor() { } +//// public foo() { } +////} +//// +////new C().foo(); + +verify.baselineFindAllReferences(""); diff --git a/tests/cases/fourslash/constructorFindAllReferences3.ts b/tests/cases/fourslash/constructorFindAllReferences3.ts new file mode 100644 index 00000000000..1888a3c85b9 --- /dev/null +++ b/tests/cases/fourslash/constructorFindAllReferences3.ts @@ -0,0 +1,10 @@ +/// + +////export class C { +//// /**/constructor() { } +//// public foo() { } +////} +//// +////new C().foo(); + +verify.baselineFindAllReferences(""); diff --git a/tests/cases/fourslash/constructorFindAllReferences4.ts b/tests/cases/fourslash/constructorFindAllReferences4.ts new file mode 100644 index 00000000000..8170f330e53 --- /dev/null +++ b/tests/cases/fourslash/constructorFindAllReferences4.ts @@ -0,0 +1,10 @@ +/// + +////export class C { +//// /**/protected constructor() { } +//// public foo() { } +////} +//// +////new C().foo(); + +verify.baselineFindAllReferences(""); From c1c3ebcadf46e48fa7110539ea1ce47da5c8e6db Mon Sep 17 00:00:00 2001 From: "ryohei.udagawa" <63101140+Uda-Titor@users.noreply.github.com> Date: Tue, 10 May 2022 07:24:24 +0900 Subject: [PATCH 18/29] fix: fractionalSecondDigits configure (#49014) --- src/lib/es2021.intl.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/es2021.intl.d.ts b/src/lib/es2021.intl.d.ts index e303d8dd34f..a13626aad04 100644 --- a/src/lib/es2021.intl.d.ts +++ b/src/lib/es2021.intl.d.ts @@ -19,7 +19,7 @@ declare namespace Intl { timeStyle?: "full" | "long" | "medium" | "short"; hourCycle?: "h11" | "h12" | "h23" | "h24"; dayPeriod?: "narrow" | "short" | "long"; - fractionalSecondDigits?: 0 | 1 | 2 | 3; + fractionalSecondDigits?: 1 | 2 | 3; } /** From 69214c0e56f36d05d64808ab7acb41f7b65cd802 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Tue, 10 May 2022 01:52:15 +0300 Subject: [PATCH 19/29] fix(49001): handle missing imports in addMissingMember QF (#49009) --- src/services/codefixes/fixAddMissingMember.ts | 15 ++++++---- .../codeFixAddMissingProperties21.ts | 29 +++++++++++++++++++ 2 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 tests/cases/fourslash/codeFixAddMissingProperties21.ts diff --git a/src/services/codefixes/fixAddMissingMember.ts b/src/services/codefixes/fixAddMissingMember.ts index d7606830ea1..61db4d43014 100644 --- a/src/services/codefixes/fixAddMissingMember.ts +++ b/src/services/codefixes/fixAddMissingMember.ts @@ -459,6 +459,7 @@ namespace ts.codefix { const importAdder = createImportAdder(context.sourceFile, context.program, context.preferences, context.host); const functionDeclaration = createSignatureDeclarationFromCallExpression(SyntaxKind.FunctionDeclaration, context, importAdder, info.call, idText(info.token), info.modifierFlags, info.parentDeclaration) as FunctionDeclaration; changes.insertNodeAtEndOfScope(info.sourceFile, info.parentDeclaration, functionDeclaration); + importAdder.writeFixes(changes); } function addJsxAttributes(changes: textChanges.ChangeTracker, context: CodeFixContextBase, info: JsxAttributesInfo) { @@ -468,7 +469,7 @@ namespace ts.codefix { const jsxAttributesNode = info.parentDeclaration.attributes; const hasSpreadAttribute = some(jsxAttributesNode.properties, isJsxSpreadAttribute); const attrs = map(info.attributes, attr => { - const value = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(attr)); + const value = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(attr), info.parentDeclaration); const name = factory.createIdentifier(attr.name); const jsxAttribute = factory.createJsxAttribute(name, factory.createJsxExpression(/*dotDotDotToken*/ undefined, value)); // formattingScanner requires the Identifier to have a context for scanning attributes with "-" (data-foo). @@ -478,6 +479,7 @@ namespace ts.codefix { const jsxAttributes = factory.createJsxAttributes(hasSpreadAttribute ? [...attrs, ...jsxAttributesNode.properties] : [...jsxAttributesNode.properties, ...attrs]); const options = { prefix: jsxAttributesNode.pos === jsxAttributesNode.end ? " " : undefined }; changes.replaceNode(context.sourceFile, jsxAttributesNode, jsxAttributes, options); + importAdder.writeFixes(changes); } function addObjectLiteralProperties(changes: textChanges.ChangeTracker, context: CodeFixContextBase, info: ObjectLiteralInfo) { @@ -486,7 +488,7 @@ namespace ts.codefix { const target = getEmitScriptTarget(context.program.getCompilerOptions()); const checker = context.program.getTypeChecker(); const props = map(info.properties, prop => { - const initializer = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop)); + const initializer = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), info.parentDeclaration); return factory.createPropertyAssignment(createPropertyNameNodeForIdentifierOrLiteral(prop.name, target, quotePreference === QuotePreference.Single), initializer); }); const options = { @@ -495,9 +497,10 @@ namespace ts.codefix { indentation: info.indentation }; changes.replaceNode(context.sourceFile, info.parentDeclaration, factory.createObjectLiteralExpression([...info.parentDeclaration.properties, ...props], /*multiLine*/ true), options); + importAdder.writeFixes(changes); } - function tryGetValueFromType(context: CodeFixContextBase, checker: TypeChecker, importAdder: ImportAdder, quotePreference: QuotePreference, type: Type): Expression { + function tryGetValueFromType(context: CodeFixContextBase, checker: TypeChecker, importAdder: ImportAdder, quotePreference: QuotePreference, type: Type, enclosingDeclaration: Node | undefined): Expression { if (type.flags & TypeFlags.AnyOrUnknown) { return createUndefined(); } @@ -534,7 +537,7 @@ namespace ts.codefix { return factory.createNull(); } if (type.flags & TypeFlags.Union) { - const expression = firstDefined((type as UnionType).types, t => tryGetValueFromType(context, checker, importAdder, quotePreference, t)); + const expression = firstDefined((type as UnionType).types, t => tryGetValueFromType(context, checker, importAdder, quotePreference, t, enclosingDeclaration)); return expression ?? createUndefined(); } if (checker.isArrayLikeType(type)) { @@ -542,7 +545,7 @@ namespace ts.codefix { } if (isObjectLiteralType(type)) { const props = map(checker.getPropertiesOfType(type), prop => { - const initializer = prop.valueDeclaration ? tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeAtLocation(prop.valueDeclaration)) : createUndefined(); + const initializer = prop.valueDeclaration ? tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeAtLocation(prop.valueDeclaration), enclosingDeclaration) : createUndefined(); return factory.createPropertyAssignment(prop.name, initializer); }); return factory.createObjectLiteralExpression(props, /*multiLine*/ true); @@ -555,7 +558,7 @@ namespace ts.codefix { if (signature === undefined) return createUndefined(); const func = createSignatureDeclarationFromSignature(SyntaxKind.FunctionExpression, context, quotePreference, signature[0], - createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference), /*name*/ undefined, /*modifiers*/ undefined, /*optional*/ undefined, /*enclosingDeclaration*/ undefined, importAdder) as FunctionExpression | undefined; + createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference), /*name*/ undefined, /*modifiers*/ undefined, /*optional*/ undefined, /*enclosingDeclaration*/ enclosingDeclaration, importAdder) as FunctionExpression | undefined; return func ?? createUndefined(); } if (getObjectFlags(type) & ObjectFlags.Class) { diff --git a/tests/cases/fourslash/codeFixAddMissingProperties21.ts b/tests/cases/fourslash/codeFixAddMissingProperties21.ts new file mode 100644 index 00000000000..d4a904208e7 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingProperties21.ts @@ -0,0 +1,29 @@ +/// + +// @filename: /a.ts +////export type A = { x: string }; + +// @filename: /b.ts +////import { A } from "./a"; +////export type Foo = { x: string }; +////export interface B { +//// b(a: A): Foo; +////} + +// @filename: /c.ts +////import { B } from "./b"; +////const b: B = {}; + +goTo.file("/c.ts"); +verify.codeFix({ + index: 0, + description: ts.Diagnostics.Add_missing_properties.message, + newFileContent: +`import { A } from "./a"; +import { B, Foo } from "./b"; +const b: B = { + b: function(a: A): Foo { + throw new Error("Function not implemented."); + } +};`, +}); From 604e5fca55333857d08eba105cfca97f98b53b6b Mon Sep 17 00:00:00 2001 From: Zzzen Date: Tue, 10 May 2022 06:57:27 +0800 Subject: [PATCH 20/29] Add JSDoc's @inheritDoc Support for Static Class Members for TypeScript (#46719) * Add JSDoc's @inheritDoc Support for Static Class Members for TypeScript * use public api * fix * add tests * simplify implementation * extract comments from inherticDoc --- src/services/jsDoc.ts | 8 +- src/services/services.ts | 10 +- .../reference/quickInfoInheritDoc.baseline | 418 ++++++++++++++++++ .../reference/quickInfoInheritDoc2.baseline | 96 ++++ .../reference/quickInfoInheritDoc3.baseline | 84 ++++ tests/cases/fourslash/jsDocInheritDoc.ts | 2 +- tests/cases/fourslash/quickInfoInheritDoc.ts | 65 +++ tests/cases/fourslash/quickInfoInheritDoc2.ts | 22 + tests/cases/fourslash/quickInfoInheritDoc3.ts | 23 + 9 files changed, 721 insertions(+), 7 deletions(-) create mode 100644 tests/baselines/reference/quickInfoInheritDoc.baseline create mode 100644 tests/baselines/reference/quickInfoInheritDoc2.baseline create mode 100644 tests/baselines/reference/quickInfoInheritDoc3.baseline create mode 100644 tests/cases/fourslash/quickInfoInheritDoc.ts create mode 100644 tests/cases/fourslash/quickInfoInheritDoc2.ts create mode 100644 tests/cases/fourslash/quickInfoInheritDoc3.ts diff --git a/src/services/jsDoc.ts b/src/services/jsDoc.ts index ca6b9cc047d..e85246e9eb5 100644 --- a/src/services/jsDoc.ts +++ b/src/services/jsDoc.ts @@ -93,11 +93,12 @@ namespace ts.JsDoc { const parts: SymbolDisplayPart[][] = []; forEachUnique(declarations, declaration => { for (const jsdoc of getCommentHavingNodes(declaration)) { + const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, t => t.kind === SyntaxKind.JSDocTag && (t.tagName.escapedText === "inheritDoc" || t.tagName.escapedText === "inheritdoc")); // skip comments containing @typedefs since they're not associated with particular declarations // Exceptions: // - @typedefs are themselves declarations with associated comments // - @param or @return indicate that the author thinks of it as a 'local' @typedef that's part of the function documentation - if (jsdoc.comment === undefined + if (jsdoc.comment === undefined && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== SyntaxKind.JSDocTypedefTag && declaration.kind !== SyntaxKind.JSDocCallbackTag && jsdoc.tags @@ -105,7 +106,10 @@ namespace ts.JsDoc { && !jsdoc.tags.some(t => t.kind === SyntaxKind.JSDocParameterTag || t.kind === SyntaxKind.JSDocReturnTag)) { continue; } - const newparts = getDisplayPartsFromComment(jsdoc.comment, checker); + let newparts = jsdoc.comment ? getDisplayPartsFromComment(jsdoc.comment, checker) : []; + if (inheritDoc && inheritDoc.comment) { + newparts = newparts.concat(getDisplayPartsFromComment(inheritDoc.comment, checker)); + } if (!contains(parts, newparts, isIdenticalListOfDisplayParts)) { parts.push(newparts); } diff --git a/src/services/services.ts b/src/services/services.ts index ac731115beb..afb6a108691 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -592,7 +592,7 @@ namespace ts { * @returns `true` if `node` has a JSDoc "inheritDoc" tag on it, otherwise `false`. */ function hasJSDocInheritDocTag(node: Node) { - return getJSDocTags(node).some(tag => tag.tagName.text === "inheritDoc"); + return getJSDocTags(node).some(tag => tag.tagName.text === "inheritDoc" || tag.tagName.text === "inheritdoc"); } function getJsDocTagsOfDeclarations(declarations: Declaration[] | undefined, checker: TypeChecker | undefined): JSDocTagInfo[] { @@ -643,13 +643,15 @@ namespace ts { } function findBaseOfDeclaration(checker: TypeChecker, declaration: Declaration, cb: (symbol: Symbol) => T[] | undefined): T[] | undefined { - if (hasStaticModifier(declaration)) return; - const classOrInterfaceDeclaration = declaration.parent?.kind === SyntaxKind.Constructor ? declaration.parent.parent : declaration.parent; if (!classOrInterfaceDeclaration) return; + const isStaticMember = hasStaticModifier(declaration); return firstDefined(getAllSuperTypeNodes(classOrInterfaceDeclaration), superTypeNode => { - const symbol = checker.getPropertyOfType(checker.getTypeAtLocation(superTypeNode), declaration.symbol.name); + const baseType = checker.getTypeAtLocation(superTypeNode); + const symbol = isStaticMember + ? find(checker.getExportsOfModule(baseType.symbol), s => s.escapedName === declaration.symbol.name) + : checker.getPropertyOfType(baseType, declaration.symbol.name); return symbol ? cb(symbol) : undefined; }); } diff --git a/tests/baselines/reference/quickInfoInheritDoc.baseline b/tests/baselines/reference/quickInfoInheritDoc.baseline new file mode 100644 index 00000000000..29cc8e3544d --- /dev/null +++ b/tests/baselines/reference/quickInfoInheritDoc.baseline @@ -0,0 +1,418 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoInheritDoc.ts", + "position": 817, + "name": "1" + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "public,static", + "textSpan": { + "start": 817, + "length": 17 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SubClass", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "doSomethingUseful", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "mySpecificStuff", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "tiger", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "lion", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Useful description always applicable", + "kind": "text" + } + ], + "tags": [ + { + "name": "returns", + "text": [ + { + "text": "Useful description of return value always applicable.", + "kind": "text" + } + ] + }, + { + "name": "inheritDoc" + }, + { + "name": "param", + "text": [ + { + "text": "mySpecificStuff", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Description of my specific parameter.", + "kind": "text" + } + ] + } + ] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoInheritDoc.ts", + "position": 1143, + "name": "2" + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "public,static", + "textSpan": { + "start": 1143, + "length": 5 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SubClass", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "func1", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "stuff1", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "BaseClass.func1", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "stuff1", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "BaseClass.func1.stuff1", + "kind": "text" + } + ] + }, + { + "name": "returns", + "text": [ + { + "text": "BaseClass.func1.returns", + "kind": "text" + } + ] + }, + { + "name": "inheritDoc" + }, + { + "name": "param", + "text": [ + { + "text": "stuff1", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SubClass.func1.stuff1", + "kind": "text" + } + ] + }, + { + "name": "returns", + "text": [ + { + "text": "SubClass.func1.returns", + "kind": "text" + } + ] + } + ] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoInheritDoc.ts", + "position": 1282, + "name": "3" + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "public,static", + "textSpan": { + "start": 1282, + "length": 12 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SubClass", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "someProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Applicable description always.", + "kind": "text" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "text over tag", + "kind": "text" + }, + { + "text": "text after tag", + "kind": "text" + } + ], + "tags": [ + { + "name": "inheritDoc", + "text": [ + { + "text": "text after tag", + "kind": "text" + } + ] + } + ] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoInheritDoc2.baseline b/tests/baselines/reference/quickInfoInheritDoc2.baseline new file mode 100644 index 00000000000..40dc3368efd --- /dev/null +++ b/tests/baselines/reference/quickInfoInheritDoc2.baseline @@ -0,0 +1,96 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoInheritDoc2.ts", + "position": 173, + "name": "1" + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "", + "textSpan": { + "start": 173, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SubClass", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "prop", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + } + ], + "documentation": [ + { + "text": "Base.prop", + "kind": "text" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "SubClass.prop", + "kind": "text" + } + ], + "tags": [ + { + "name": "inheritdoc", + "text": [ + { + "text": "SubClass.prop", + "kind": "text" + } + ] + } + ] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoInheritDoc3.baseline b/tests/baselines/reference/quickInfoInheritDoc3.baseline new file mode 100644 index 00000000000..5729c6c1ccf --- /dev/null +++ b/tests/baselines/reference/quickInfoInheritDoc3.baseline @@ -0,0 +1,84 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoInheritDoc3.ts", + "position": 237, + "name": "1" + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "", + "textSpan": { + "start": 237, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SubClass", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "prop", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Base.prop", + "kind": "text" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "SubClass.prop", + "kind": "text" + } + ], + "tags": [ + { + "name": "inheritdoc", + "text": [ + { + "text": "SubClass.prop", + "kind": "text" + } + ] + } + ] + } + } +] \ No newline at end of file diff --git a/tests/cases/fourslash/jsDocInheritDoc.ts b/tests/cases/fourslash/jsDocInheritDoc.ts index 7ef822ce653..08da10537c8 100644 --- a/tests/cases/fourslash/jsDocInheritDoc.ts +++ b/tests/cases/fourslash/jsDocInheritDoc.ts @@ -58,7 +58,7 @@ verify.quickInfoAt("1", "constructor Bar(value: number): Bar", undefined); // constructors aren't actually inherited verify.quickInfoAt("2", "(method) Bar.method2(): void", "Foo#method2 documentation"); // use inherited docs only -verify.quickInfoAt("3", "(method) Bar.method1(): void", undefined); // statics aren't actually inherited +verify.quickInfoAt("3", "(method) Bar.method1(): void", 'Foo#method1 documentation'); // use inherited docs too verify.quickInfoAt("4", "(property) Bar.property1: string", "Foo#property1 documentation"); // use inherited docs only verify.quickInfoAt("5", "(property) Bar.property2: object", "Baz#property2 documentation\nBar#property2"); // include local and inherited docs verify.quickInfoAt("6", "(property) Bar.property3: string", undefined); diff --git a/tests/cases/fourslash/quickInfoInheritDoc.ts b/tests/cases/fourslash/quickInfoInheritDoc.ts new file mode 100644 index 00000000000..a08f60e98ab --- /dev/null +++ b/tests/cases/fourslash/quickInfoInheritDoc.ts @@ -0,0 +1,65 @@ +/// + +// @noEmit: true +// @allowJs: true + +// @Filename: quickInfoInheritDoc.ts +////abstract class BaseClass { +//// /** +//// * Useful description always applicable +//// * +//// * @returns {string} Useful description of return value always applicable. +//// */ +//// public static doSomethingUseful(stuff?: any): string { +//// throw new Error('Must be implemented by subclass'); +//// } +//// +//// /** +//// * BaseClass.func1 +//// * @param {any} stuff1 BaseClass.func1.stuff1 +//// * @returns {void} BaseClass.func1.returns +//// */ +//// public static func1(stuff1: any): void { +//// } +//// +//// /** +//// * Applicable description always. +//// */ +//// public static readonly someProperty: string = 'general value'; +////} +//// +//// +//// +//// +////class SubClass extends BaseClass { +//// +//// /** +//// * @inheritDoc +//// * +//// * @param {{ tiger: string; lion: string; }} [mySpecificStuff] Description of my specific parameter. +//// */ +//// public static /*1*/doSomethingUseful(mySpecificStuff?: { tiger: string; lion: string; }): string { +//// let useful = ''; +//// +//// // do something useful to useful +//// +//// return useful; +//// } +//// +//// /** +//// * @inheritDoc +//// * @param {any} stuff1 SubClass.func1.stuff1 +//// * @returns {void} SubClass.func1.returns +//// */ +//// public static /*2*/func1(stuff1: any): void { +//// } +//// +//// /** +//// * text over tag +//// * @inheritDoc +//// * text after tag +//// */ +//// public static readonly /*3*/someProperty: string = 'specific to this class value' +////} + +verify.baselineQuickInfo(); \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoInheritDoc2.ts b/tests/cases/fourslash/quickInfoInheritDoc2.ts new file mode 100644 index 00000000000..8410c4dddf4 --- /dev/null +++ b/tests/cases/fourslash/quickInfoInheritDoc2.ts @@ -0,0 +1,22 @@ +/// + +// @noEmit: true +// @allowJs: true + +// @Filename: quickInfoInheritDoc2.ts +////class Base { +//// /** +//// * Base.prop +//// */ +//// prop: T | undefined; +////} +//// +////class SubClass extends Base { +//// /** +//// * @inheritdoc +//// * SubClass.prop +//// */ +//// /*1*/prop: T | undefined; +////} + +verify.baselineQuickInfo(); \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoInheritDoc3.ts b/tests/cases/fourslash/quickInfoInheritDoc3.ts new file mode 100644 index 00000000000..82ebe5399db --- /dev/null +++ b/tests/cases/fourslash/quickInfoInheritDoc3.ts @@ -0,0 +1,23 @@ +/// + +// @noEmit: true +// @allowJs: true + +// @Filename: quickInfoInheritDoc3.ts +////function getBaseClass() { +//// return class Base { +//// /** +//// * Base.prop +//// */ +//// prop: string | undefined; +//// } +////} +////class SubClass extends getBaseClass() { +//// /** +//// * @inheritdoc +//// * SubClass.prop +//// */ +//// /*1*/prop: string | undefined; +////} + +verify.baselineQuickInfo(); \ No newline at end of file From 17431eab46d5df168fe541a290842e2cd26bd534 Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Mon, 9 May 2022 18:57:42 -0400 Subject: [PATCH 21/29] Add missing source property to Intl formatRangeToParts methods (#48754) --- src/lib/es2021.intl.d.ts | 6 +++++- src/lib/esnext.intl.d.ts | 6 +++++- .../reference/DateTimeFormatAndNumberFormatES2021.types | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/lib/es2021.intl.d.ts b/src/lib/es2021.intl.d.ts index a13626aad04..5da7dbddc0e 100644 --- a/src/lib/es2021.intl.d.ts +++ b/src/lib/es2021.intl.d.ts @@ -8,9 +8,13 @@ declare namespace Intl { fractionalSecondDigits?: 0 | 1 | 2 | 3 | undefined; } + interface DateTimeRangeFormatPart extends DateTimeFormatPart { + source: "startRange" | "endRange" | "shared" + } + interface DateTimeFormat { formatRange(startDate: Date | number | bigint, endDate: Date | number | bigint): string; - formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeFormatPart[]; + formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeRangeFormatPart[]; } interface ResolvedDateTimeFormatOptions { diff --git a/src/lib/esnext.intl.d.ts b/src/lib/esnext.intl.d.ts index a8baa0e4cc6..3c5a0bd4df9 100644 --- a/src/lib/esnext.intl.d.ts +++ b/src/lib/esnext.intl.d.ts @@ -1,6 +1,10 @@ declare namespace Intl { + interface NumberRangeFormatPart extends NumberFormatPart { + source: "startRange" | "endRange" | "shared" + } + interface NumberFormat { formatRange(start: number | bigint, end: number | bigint): string; - formatRangeToParts(start: number | bigint, end: number | bigint): NumberFormatPart[]; + formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[]; } } diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types index 98f06e294c4..4c3c8e654ec 100644 --- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types +++ b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types @@ -42,10 +42,10 @@ new Intl.DateTimeFormat().formatRange >formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string new Intl.DateTimeFormat().formatRangeToParts ->new Intl.DateTimeFormat().formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeFormatPart[] +>new Intl.DateTimeFormat().formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] >new Intl.DateTimeFormat() : Intl.DateTimeFormat >Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } >Intl : typeof Intl >DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } ->formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeFormatPart[] +>formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] From 9236e39374c0ec9a1e3f9894af4fb9eb34ba0021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Tue, 10 May 2022 01:03:48 +0200 Subject: [PATCH 22/29] Fixed an issue with contextual type for intersection properties (#48668) * Add a failing test case for contextual type not provided for functions comming from a property with intersection type * Fixed an issue with contextual type for intersection properties * Fixed how type of a property of a contextual type is being computed when intersections with indexers are used --- src/compiler/checker.ts | 34 +++++++- ...lTypeFunctionObjectPropertyIntersection.js | 42 ++++++++++ ...FunctionObjectPropertyIntersection.symbols | 82 +++++++++++++++++++ ...peFunctionObjectPropertyIntersection.types | 73 +++++++++++++++++ ...lTypeFunctionObjectPropertyIntersection.ts | 29 +++++++ 5 files changed, 256 insertions(+), 4 deletions(-) create mode 100644 tests/baselines/reference/contextualTypeFunctionObjectPropertyIntersection.js create mode 100644 tests/baselines/reference/contextualTypeFunctionObjectPropertyIntersection.symbols create mode 100644 tests/baselines/reference/contextualTypeFunctionObjectPropertyIntersection.types create mode 100644 tests/cases/compiler/contextualTypeFunctionObjectPropertyIntersection.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f49cfb36189..025eeecc306 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -26819,7 +26819,27 @@ namespace ts { } function getTypeOfPropertyOfContextualType(type: Type, name: __String, nameType?: Type) { - return mapType(type, t => { + return mapType(type, (t): Type | undefined => { + if (t.flags & TypeFlags.Intersection) { + const intersection = t as IntersectionType; + let newTypes = mapDefined(intersection.types, getTypeOfConcretePropertyOfContextualType); + if (newTypes.length > 0) { + return getIntersectionType(newTypes); + } + newTypes = mapDefined(intersection.types, getTypeOfApplicableIndexInfoOfContextualType); + if (newTypes.length > 0) { + return getIntersectionType(newTypes); + } + return undefined; + } + const concretePropertyType = getTypeOfConcretePropertyOfContextualType(t); + if (concretePropertyType) { + return concretePropertyType; + } + return getTypeOfApplicableIndexInfoOfContextualType(t); + }, /*noReductions*/ true); + + function getTypeOfConcretePropertyOfContextualType(t: Type) { if (isGenericMappedType(t) && !t.declaration.nameType) { const constraint = getConstraintTypeFromMappedType(t); const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint; @@ -26827,8 +26847,9 @@ namespace ts { if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) { return substituteIndexedMappedType(t, propertyNameType); } + return undefined; } - else if (t.flags & TypeFlags.StructuredType) { + if (t.flags & TypeFlags.StructuredType) { const prop = getPropertyOfType(t, name); if (prop) { return isCircularMappedProperty(prop) ? undefined : getTypeOfSymbol(prop); @@ -26839,10 +26860,15 @@ namespace ts { return restType; } } - return findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))?.type; } return undefined; - }, /*noReductions*/ true); + } + function getTypeOfApplicableIndexInfoOfContextualType(t: Type) { + if (!(t.flags & TypeFlags.StructuredType)) { + return undefined; + } + return findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))?.type; + } } // In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of diff --git a/tests/baselines/reference/contextualTypeFunctionObjectPropertyIntersection.js b/tests/baselines/reference/contextualTypeFunctionObjectPropertyIntersection.js new file mode 100644 index 00000000000..65213deade4 --- /dev/null +++ b/tests/baselines/reference/contextualTypeFunctionObjectPropertyIntersection.js @@ -0,0 +1,42 @@ +//// [contextualTypeFunctionObjectPropertyIntersection.ts] +type Action = (ev: TEvent) => void; + +interface MachineConfig { + schema: { + events: TEvent; + }; + on?: { + [K in TEvent["type"]]?: Action; + } & { + "*"?: Action; + }; +} + +declare function createMachine( + config: MachineConfig +): void; + +createMachine({ + schema: { + events: {} as { type: "FOO" } | { type: "BAR" }, + }, + on: { + FOO: (ev) => { + ev.type; // should be 'FOO' + }, + }, +}); + + +//// [contextualTypeFunctionObjectPropertyIntersection.js] +"use strict"; +createMachine({ + schema: { + events: {} + }, + on: { + FOO: function (ev) { + ev.type; // should be 'FOO' + } + } +}); diff --git a/tests/baselines/reference/contextualTypeFunctionObjectPropertyIntersection.symbols b/tests/baselines/reference/contextualTypeFunctionObjectPropertyIntersection.symbols new file mode 100644 index 00000000000..4690985350a --- /dev/null +++ b/tests/baselines/reference/contextualTypeFunctionObjectPropertyIntersection.symbols @@ -0,0 +1,82 @@ +=== tests/cases/compiler/contextualTypeFunctionObjectPropertyIntersection.ts === +type Action = (ev: TEvent) => void; +>Action : Symbol(Action, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 0, 0)) +>TEvent : Symbol(TEvent, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 0, 12)) +>type : Symbol(type, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 0, 28)) +>ev : Symbol(ev, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 0, 48)) +>TEvent : Symbol(TEvent, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 0, 12)) + +interface MachineConfig { +>MachineConfig : Symbol(MachineConfig, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 0, 68)) +>TEvent : Symbol(TEvent, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 2, 24)) +>type : Symbol(type, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 2, 40)) + + schema: { +>schema : Symbol(MachineConfig.schema, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 2, 58)) + + events: TEvent; +>events : Symbol(events, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 3, 11)) +>TEvent : Symbol(TEvent, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 2, 24)) + + }; + on?: { +>on : Symbol(MachineConfig.on, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 5, 4)) + + [K in TEvent["type"]]?: Action; +>K : Symbol(K, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 7, 5)) +>TEvent : Symbol(TEvent, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 2, 24)) +>Action : Symbol(Action, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 0, 0)) +>TEvent : Symbol(TEvent, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 2, 24)) +>type : Symbol(type, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 7, 51)) +>K : Symbol(K, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 7, 5)) +>TEvent : Symbol(TEvent, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 2, 24)) + + } & { + "*"?: Action; +>"*" : Symbol("*", Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 8, 7)) +>Action : Symbol(Action, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 0, 0)) +>TEvent : Symbol(TEvent, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 2, 24)) + + }; +} + +declare function createMachine( +>createMachine : Symbol(createMachine, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 11, 1)) +>TEvent : Symbol(TEvent, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 13, 31)) +>type : Symbol(type, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 13, 47)) + + config: MachineConfig +>config : Symbol(config, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 13, 64)) +>MachineConfig : Symbol(MachineConfig, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 0, 68)) +>TEvent : Symbol(TEvent, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 13, 31)) + +): void; + +createMachine({ +>createMachine : Symbol(createMachine, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 11, 1)) + + schema: { +>schema : Symbol(schema, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 17, 15)) + + events: {} as { type: "FOO" } | { type: "BAR" }, +>events : Symbol(events, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 18, 11)) +>type : Symbol(type, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 19, 19)) +>type : Symbol(type, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 19, 37)) + + }, + on: { +>on : Symbol(on, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 20, 4)) + + FOO: (ev) => { +>FOO : Symbol(FOO, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 21, 7)) +>ev : Symbol(ev, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 22, 10)) + + ev.type; // should be 'FOO' +>ev.type : Symbol(type, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 19, 19)) +>ev : Symbol(ev, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 22, 10)) +>type : Symbol(type, Decl(contextualTypeFunctionObjectPropertyIntersection.ts, 19, 19)) + + }, + }, +}); + diff --git a/tests/baselines/reference/contextualTypeFunctionObjectPropertyIntersection.types b/tests/baselines/reference/contextualTypeFunctionObjectPropertyIntersection.types new file mode 100644 index 00000000000..30ba52626fa --- /dev/null +++ b/tests/baselines/reference/contextualTypeFunctionObjectPropertyIntersection.types @@ -0,0 +1,73 @@ +=== tests/cases/compiler/contextualTypeFunctionObjectPropertyIntersection.ts === +type Action = (ev: TEvent) => void; +>Action : Action +>type : string +>ev : TEvent + +interface MachineConfig { +>type : string + + schema: { +>schema : { events: TEvent; } + + events: TEvent; +>events : TEvent + + }; + on?: { +>on : ({ [K in TEvent["type"]]?: Action | undefined; } & { "*"?: Action | undefined; }) | undefined + + [K in TEvent["type"]]?: Action; +>type : K + + } & { + "*"?: Action; +>"*" : Action | undefined + + }; +} + +declare function createMachine( +>createMachine : (config: MachineConfig) => void +>type : string + + config: MachineConfig +>config : MachineConfig + +): void; + +createMachine({ +>createMachine({ schema: { events: {} as { type: "FOO" } | { type: "BAR" }, }, on: { FOO: (ev) => { ev.type; // should be 'FOO' }, },}) : void +>createMachine : (config: MachineConfig) => void +>{ schema: { events: {} as { type: "FOO" } | { type: "BAR" }, }, on: { FOO: (ev) => { ev.type; // should be 'FOO' }, },} : { schema: { events: { type: "FOO"; } | { type: "BAR"; }; }; on: { FOO: (ev: { type: "FOO"; }) => void; }; } + + schema: { +>schema : { events: { type: "FOO"; } | { type: "BAR"; }; } +>{ events: {} as { type: "FOO" } | { type: "BAR" }, } : { events: { type: "FOO"; } | { type: "BAR"; }; } + + events: {} as { type: "FOO" } | { type: "BAR" }, +>events : { type: "FOO"; } | { type: "BAR"; } +>{} as { type: "FOO" } | { type: "BAR" } : { type: "FOO"; } | { type: "BAR"; } +>{} : {} +>type : "FOO" +>type : "BAR" + + }, + on: { +>on : { FOO: (ev: { type: "FOO"; }) => void; } +>{ FOO: (ev) => { ev.type; // should be 'FOO' }, } : { FOO: (ev: { type: "FOO"; }) => void; } + + FOO: (ev) => { +>FOO : (ev: { type: "FOO"; }) => void +>(ev) => { ev.type; // should be 'FOO' } : (ev: { type: "FOO"; }) => void +>ev : { type: "FOO"; } + + ev.type; // should be 'FOO' +>ev.type : "FOO" +>ev : { type: "FOO"; } +>type : "FOO" + + }, + }, +}); + diff --git a/tests/cases/compiler/contextualTypeFunctionObjectPropertyIntersection.ts b/tests/cases/compiler/contextualTypeFunctionObjectPropertyIntersection.ts new file mode 100644 index 00000000000..2d7e00f32f6 --- /dev/null +++ b/tests/cases/compiler/contextualTypeFunctionObjectPropertyIntersection.ts @@ -0,0 +1,29 @@ +// @strict: true + +type Action = (ev: TEvent) => void; + +interface MachineConfig { + schema: { + events: TEvent; + }; + on?: { + [K in TEvent["type"]]?: Action; + } & { + "*"?: Action; + }; +} + +declare function createMachine( + config: MachineConfig +): void; + +createMachine({ + schema: { + events: {} as { type: "FOO" } | { type: "BAR" }, + }, + on: { + FOO: (ev) => { + ev.type; // should be 'FOO' + }, + }, +}); From 0cd551d56a0cc7ce12a5f6a463e2577708cffd53 Mon Sep 17 00:00:00 2001 From: csigs Date: Tue, 10 May 2022 03:58:37 -0700 Subject: [PATCH 23/29] LEGO: Merge pull request 49044 LEGO: Merge pull request 49044 --- .../diagnosticMessages.generated.json.lcl | 9 +++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++++++ 9 files changed, 81 insertions(+) diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index 5013f028ff7..50cd9671cba 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -11124,6 +11124,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl index f2b25f7483c..88b3dc55306 100644 --- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -11109,6 +11109,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index 3973855a8b6..e7aea94a458 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -11127,6 +11127,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index 5ae6ecab644..71ae5fca880 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -11115,6 +11115,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index b701d37e533..fec7669b1c9 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -11115,6 +11115,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index e79a598527d..f9dd5a79e33 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -11115,6 +11115,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index b73b15ba1df..1d46dd5e3e2 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -11102,6 +11102,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index 0f1fbede4a8..509bab6694e 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -11105,6 +11105,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index 03aaabf8e3d..f57dcf78f02 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -11114,6 +11114,15 @@ + + + + + + + + + From fcd80db0c61719559e212c95bbe5163f9dceb506 Mon Sep 17 00:00:00 2001 From: mstssk Date: Wed, 11 May 2022 01:22:50 +0900 Subject: [PATCH 24/29] fix(48912): fractionalSecondDigits is 1, 2 or 3. (#49042) --- src/lib/es2021.intl.d.ts | 2 +- tests/lib/lib.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/es2021.intl.d.ts b/src/lib/es2021.intl.d.ts index 5da7dbddc0e..2424dc404a1 100644 --- a/src/lib/es2021.intl.d.ts +++ b/src/lib/es2021.intl.d.ts @@ -5,7 +5,7 @@ declare namespace Intl { dateStyle?: "full" | "long" | "medium" | "short" | undefined; timeStyle?: "full" | "long" | "medium" | "short" | undefined; dayPeriod?: "narrow" | "short" | "long" | undefined; - fractionalSecondDigits?: 0 | 1 | 2 | 3 | undefined; + fractionalSecondDigits?: 1 | 2 | 3 | undefined; } interface DateTimeRangeFormatPart extends DateTimeFormatPart { diff --git a/tests/lib/lib.d.ts b/tests/lib/lib.d.ts index 7f5cbf72e72..f1a04e4f8f2 100644 --- a/tests/lib/lib.d.ts +++ b/tests/lib/lib.d.ts @@ -3956,7 +3956,7 @@ declare module Intl { hour?: "numeric" | "2-digit"; minute?: "numeric" | "2-digit"; second?: "numeric" | "2-digit"; - fractionalSecondDigits?: 0 | 1 | 2 | 3; + fractionalSecondDigits?: 1 | 2 | 3; timeZoneName?: "long" | "short"; } From 6ee549075bdd4a9af31c93768387638e53d01d53 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 May 2022 10:34:03 -0700 Subject: [PATCH 25/29] Identify when file name is matched by default include spec (#49040) Fixes #43679 --- src/compiler/commandLineParser.ts | 10 +++++++-- src/compiler/diagnosticMessages.json | 4 ++++ src/compiler/program.ts | 2 +- src/compiler/types.ts | 1 + src/compiler/watch.ts | 12 +++++++--- ...olutionWithExtensions_withPaths.errors.txt | 8 +++---- .../tsbuild/outfile-concat/explainFiles.js | 4 ++-- ...iles-belong-to-rootDir-and-is-composite.js | 6 ++--- ...ied-but-not-all-files-belong-to-rootDir.js | 6 ++--- .../reference/tsbuild/sample1/explainFiles.js | 22 +++++++++---------- ...rough-indirect-symlink-moduleCaseChange.js | 4 ++-- ...ibling-package-through-indirect-symlink.js | 4 ++-- ...ther-symlinked-package-moduleCaseChange.js | 4 ++-- ...age-with-indirect-link-moduleCaseChange.js | 2 +- ...er-symlinked-package-with-indirect-link.js | 2 +- ...gh-source-and-another-symlinked-package.js | 4 ++-- ...n-Windows-style-drive-root-is-lowercase.js | 8 +++---- ...n-Windows-style-drive-root-is-uppercase.js | 8 +++---- ...ry-symlink-target-and-import-match-disk.js | 8 +++---- ...le-symlink-target-and-import-match-disk.js | 12 +++++----- ...nging-module-name-with-different-casing.js | 2 +- ...target-matches-disk-but-import-does-not.js | 8 +++---- ...target-matches-disk-but-import-does-not.js | 12 +++++----- ...link-target,-and-disk-are-all-different.js | 8 +++---- ...link-target,-and-disk-are-all-different.js | 12 +++++----- ...link-target-agree-but-do-not-match-disk.js | 12 +++++----- ...link-target-agree-but-do-not-match-disk.js | 16 +++++++------- ...k-but-directory-symlink-target-does-not.js | 12 +++++----- ...s-disk-but-file-symlink-target-does-not.js | 16 +++++++------- ...ative-information-file-location-changes.js | 20 ++++++++--------- ...hen-renaming-file-with-different-casing.js | 2 +- ...ImportSource-option-changed-incremental.js | 4 ++-- .../jsxImportSource-option-changed-watch.js | 4 ++-- .../handle-recreated-files-correctly.js | 14 ++++++------ ...orceConsistentCasingInFileNames-changes.js | 2 +- ...hronous-watch-directory-renaming-a-file.js | 2 +- ...nging-module-name-with-different-casing.js | 6 ++--- ...hen-renaming-file-with-different-casing.js | 4 ++-- ...ate-symbols-when-searching-all-projects.js | 4 ++-- .../navTo/should-de-duplicate-symbols.js | 4 ++-- ...-generated-when-the-config-file-changes.js | 2 +- ...when-the-config-file-doesnt-have-errors.js | 2 +- ...nerated-when-the-config-file-has-errors.js | 2 +- ...rs-but-suppressDiagnosticEvents-is-true.js | 2 +- ...project-structure-and-reports-no-errors.js | 8 +++---- ...-when-timeout-occurs-after-installation.js | 4 ++-- ...n-timeout-occurs-inbetween-installation.js | 4 ++-- ...-global-error-gerErr-with-sync-commands.js | 2 +- ...or-returns-includes-global-error-getErr.js | 2 +- ...-includes-global-error-geterrForProject.js | 2 +- ...large-file-size-is-determined-correctly.js | 2 +- ...t-is-not-open-gerErr-with-sync-commands.js | 2 +- ...n-dependency-project-is-not-open-getErr.js | 2 +- ...cy-project-is-not-open-geterrForProject.js | 2 +- ...-file-is-open-gerErr-with-sync-commands.js | 4 ++-- ...-when-the-depedency-file-is-open-getErr.js | 4 ++-- ...depedency-file-is-open-geterrForProject.js | 4 ++-- ...t-is-not-open-gerErr-with-sync-commands.js | 2 +- ...n-dependency-project-is-not-open-getErr.js | 2 +- ...cy-project-is-not-open-geterrForProject.js | 2 +- ...-file-is-open-gerErr-with-sync-commands.js | 4 ++-- ...-when-the-depedency-file-is-open-getErr.js | 4 ++-- ...depedency-file-is-open-geterrForProject.js | 4 ++-- ...disableSourceOfProjectReferenceRedirect.js | 4 ++-- ...port-with-referenced-project-when-built.js | 4 ++-- .../auto-import-with-referenced-project.js | 4 ++-- ...-are-disabled-and-a-decl-map-is-missing.js | 6 ++--- ...-are-disabled-and-a-decl-map-is-present.js | 6 ++--- ...s-are-enabled-and-a-decl-map-is-missing.js | 6 ++--- ...s-are-enabled-and-a-decl-map-is-present.js | 6 ++--- ...-are-disabled-and-a-decl-map-is-missing.js | 6 ++--- ...-are-disabled-and-a-decl-map-is-present.js | 6 ++--- ...s-are-enabled-and-a-decl-map-is-missing.js | 6 ++--- ...s-are-enabled-and-a-decl-map-is-present.js | 6 ++--- ...-are-disabled-and-a-decl-map-is-missing.js | 2 +- ...-are-disabled-and-a-decl-map-is-present.js | 2 +- ...s-are-enabled-and-a-decl-map-is-missing.js | 2 +- ...s-are-enabled-and-a-decl-map-is-present.js | 2 +- ...-are-disabled-and-a-decl-map-is-missing.js | 2 +- ...-are-disabled-and-a-decl-map-is-present.js | 6 ++--- ...s-are-enabled-and-a-decl-map-is-missing.js | 6 ++--- ...s-are-enabled-and-a-decl-map-is-present.js | 6 ++--- ...disableSourceOfProjectReferenceRedirect.js | 8 +++---- ...ect-when-referenced-project-is-not-open.js | 4 ++-- ...disableSourceOfProjectReferenceRedirect.js | 14 ++++++------ ...project-when-referenced-project-is-open.js | 10 ++++----- ...ject-is-directly-referenced-by-solution.js | 2 +- ...ct-is-indirectly-referenced-by-solution.js | 2 +- ...ces-open-file-through-project-reference.js | 2 +- ...ct-is-indirectly-referenced-by-solution.js | 2 +- ...cts-are-open-and-one-project-references.js | 16 +++++++------- ...getting-project-from-orphan-script-info.js | 2 +- ...directory-watch-invoke-on-file-creation.js | 16 +++++++------- ...tore-the-states-for-configured-projects.js | 12 +++++----- ...name-in-common-file-renames-all-project.js | 8 +++---- 95 files changed, 283 insertions(+), 266 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index b257d7aed4c..ba368e3c566 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -2326,7 +2326,7 @@ namespace ts { function filterSameAsDefaultInclude(specs: readonly string[] | undefined) { if (!length(specs)) return undefined; if (length(specs) !== 1) return specs; - if (specs![0] === "**/*") return undefined; + if (specs![0] === defaultIncludeSpec) return undefined; return specs; } @@ -2627,6 +2627,9 @@ namespace ts { return getDirectoryPath(getNormalizedAbsolutePath(fileName, basePath)); } + /*@internal*/ + export const defaultIncludeSpec = "**/*"; + /** * Parse the contents of a config file from json or json source file (tsconfig.json). * @param json The contents of the config file to parse @@ -2705,6 +2708,7 @@ namespace ts { let includeSpecs = toPropValue(getSpecsFromRaw("include")); const excludeOfRaw = getSpecsFromRaw("exclude"); + let isDefaultIncludeSpec = false; let excludeSpecs = toPropValue(excludeOfRaw); if (excludeOfRaw === "no-prop" && raw.compilerOptions) { const outDir = raw.compilerOptions.outDir; @@ -2716,7 +2720,8 @@ namespace ts { } if (filesSpecs === undefined && includeSpecs === undefined) { - includeSpecs = ["**/*"]; + includeSpecs = [defaultIncludeSpec]; + isDefaultIncludeSpec = true; } let validatedIncludeSpecs: readonly string[] | undefined, validatedExcludeSpecs: readonly string[] | undefined; @@ -2740,6 +2745,7 @@ namespace ts { validatedIncludeSpecs, validatedExcludeSpecs, pathPatterns: undefined, // Initialized on first use + isDefaultIncludeSpec, }; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index bae97eb5375..fa6b9fd3efc 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1444,6 +1444,10 @@ "category": "Error", "code": 1456 }, + "Matched by default include pattern '**/*'": { + "category": "Message", + "code": 1457 + }, "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output.": { "category": "Error", diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 7044953fee6..8ab1cd7d1ca 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -3764,7 +3764,7 @@ namespace ts { } const matchedByInclude = getMatchedIncludeSpec(program, fileName); // Could be additional files specified as roots - if (!matchedByInclude) return undefined; + if (!matchedByInclude || !isString(matchedByInclude)) return undefined; configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude); message = Diagnostics.File_is_matched_by_include_pattern_specified_here; break; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6becb6813ea..717f8029178 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -6385,6 +6385,7 @@ namespace ts { validatedIncludeSpecs: readonly string[] | undefined; validatedExcludeSpecs: readonly string[] | undefined; pathPatterns: readonly (string | Pattern)[] | undefined; + isDefaultIncludeSpec: boolean; } /* @internal */ diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 6c422d31f0c..c925046d67a 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -261,6 +261,9 @@ namespace ts { const configFile = program.getCompilerOptions().configFile; if (!configFile?.configFileSpecs?.validatedIncludeSpecs) return undefined; + // Return true if its default include spec + if (configFile.configFileSpecs.isDefaultIncludeSpec) return true; + const isJsonFile = fileExtensionIs(fileName, Extension.Json); const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory())); const useCaseSensitiveFileNames = program.useCaseSensitiveFileNames(); @@ -327,15 +330,18 @@ namespace ts { const matchedByFiles = getMatchedFileSpec(program, fileName); if (matchedByFiles) return chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Part_of_files_list_in_tsconfig_json); const matchedByInclude = getMatchedIncludeSpec(program, fileName); - return matchedByInclude ? + return isString(matchedByInclude) ? chainDiagnosticMessages( /*details*/ undefined, Diagnostics.Matched_by_include_pattern_0_in_1, matchedByInclude, toFileName(options.configFile, fileNameConvertor) ) : - // Could be additional files specified as roots - chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Root_file_specified_for_compilation); + // Could be additional files specified as roots or matched by default include + chainDiagnosticMessages(/*details*/ undefined, matchedByInclude ? + Diagnostics.Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk : + Diagnostics.Root_file_specified_for_compilation + ); case FileIncludeKind.SourceFromProjectReference: case FileIncludeKind.OutputFromProjectReference: const isOutput = reason.kind === FileIncludeKind.OutputFromProjectReference; diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_withPaths.errors.txt b/tests/baselines/reference/moduleResolutionWithExtensions_withPaths.errors.txt index 32fdbe484ff..ec9224bb751 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions_withPaths.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithExtensions_withPaths.errors.txt @@ -1,17 +1,17 @@ error TS6504: File '/node_modules/foo/lib/test.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? The file is in the program because: - Root file specified for compilation + Matched by default include pattern '**/*' error TS6504: File '/relative.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? The file is in the program because: - Matched by include pattern '**/*' in '/tsconfig.json' + Matched by default include pattern '**/*' !!! error TS6504: File '/node_modules/foo/lib/test.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? !!! error TS6504: The file is in the program because: -!!! error TS6504: Root file specified for compilation +!!! error TS6504: Matched by default include pattern '**/*' !!! error TS6504: File '/relative.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? !!! error TS6504: The file is in the program because: -!!! error TS6504: Matched by include pattern '**/*' in '/tsconfig.json' +!!! error TS6504: Matched by default include pattern '**/*' ==== /tsconfig.json (0 errors) ==== { "compilerOptions": { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/explainFiles.js b/tests/baselines/reference/tsbuild/outfile-concat/explainFiles.js index 1bcf4ccb3f0..90bb6ed9d38 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/explainFiles.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/explainFiles.js @@ -155,9 +155,9 @@ src/first/first_part3.ts lib/lib.d.ts Default library for target 'es5' src/second/second_part1.ts - Matched by include pattern '**/*' in 'src/second/tsconfig.json' + Matched by default include pattern '**/*' src/second/second_part2.ts - Matched by include pattern '**/*' in 'src/second/tsconfig.json' + Matched by default include pattern '**/*' [12:00:27 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist [12:00:28 AM] Building project '/src/third/tsconfig.json'... diff --git a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js index b5088545626..b3c19e67041 100644 --- a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js +++ b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js @@ -36,7 +36,7 @@ Output:: error TS6059: File '/src/types/type.ts' is not under 'rootDir' '/src/src'. 'rootDir' is expected to contain all source files. The file is in the program because: - Matched by include pattern '**/*' in '/src/tsconfig.json' + Matched by default include pattern '**/*' Found 1 error. @@ -61,7 +61,7 @@ Output:: error TS6059: File '/src/types/type.ts' is not under 'rootDir' '/src/src'. 'rootDir' is expected to contain all source files. The file is in the program because: - Matched by include pattern '**/*' in '/src/tsconfig.json' + Matched by default include pattern '**/*' Found 1 error. @@ -79,7 +79,7 @@ Output:: /lib/tsc -p /src/tsconfig.json error TS6059: File '/src/types/type.ts' is not under 'rootDir' '/src/src'. 'rootDir' is expected to contain all source files. The file is in the program because: - Matched by include pattern '**/*' in '/src/tsconfig.json' + Matched by default include pattern '**/*' Found 1 error. diff --git a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js index bf218767e26..dab84c8a315 100644 --- a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js +++ b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js @@ -36,7 +36,7 @@ Output:: error TS6059: File '/src/types/type.ts' is not under 'rootDir' '/src/src'. 'rootDir' is expected to contain all source files. The file is in the program because: - Matched by include pattern '**/*' in '/src/tsconfig.json' + Matched by default include pattern '**/*' Found 1 error. @@ -61,7 +61,7 @@ Output:: error TS6059: File '/src/types/type.ts' is not under 'rootDir' '/src/src'. 'rootDir' is expected to contain all source files. The file is in the program because: - Matched by include pattern '**/*' in '/src/tsconfig.json' + Matched by default include pattern '**/*' Found 1 error. @@ -79,7 +79,7 @@ Output:: /lib/tsc -p /src/tsconfig.json error TS6059: File '/src/types/type.ts' is not under 'rootDir' '/src/src'. 'rootDir' is expected to contain all source files. The file is in the program because: - Matched by include pattern '**/*' in '/src/tsconfig.json' + Matched by default include pattern '**/*' Found 1 error. diff --git a/tests/baselines/reference/tsbuild/sample1/explainFiles.js b/tests/baselines/reference/tsbuild/sample1/explainFiles.js index d075688f2dd..052cfa32a02 100644 --- a/tests/baselines/reference/tsbuild/sample1/explainFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/explainFiles.js @@ -123,11 +123,11 @@ Output:: lib/lib.d.ts Default library for target 'es3' src/core/anotherModule.ts - Matched by include pattern '**/*' in 'src/core/tsconfig.json' + Matched by default include pattern '**/*' src/core/index.ts - Matched by include pattern '**/*' in 'src/core/tsconfig.json' + Matched by default include pattern '**/*' src/core/some_decl.d.ts - Matched by include pattern '**/*' in 'src/core/tsconfig.json' + Matched by default include pattern '**/*' [12:00:17 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist [12:00:18 AM] Building project '/src/logic/tsconfig.json'... @@ -141,7 +141,7 @@ src/core/anotherModule.d.ts Imported via '../core/anotherModule' from file 'src/logic/index.ts' File is output of project reference source 'src/core/anotherModule.ts' src/logic/index.ts - Matched by include pattern '**/*' in 'src/logic/tsconfig.json' + Matched by default include pattern '**/*' [12:00:24 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist [12:00:25 AM] Building project '/src/tests/tsconfig.json'... @@ -465,11 +465,11 @@ Output:: lib/lib.d.ts Default library for target 'es3' src/core/anotherModule.ts - Matched by include pattern '**/*' in 'src/core/tsconfig.json' + Matched by default include pattern '**/*' src/core/index.ts - Matched by include pattern '**/*' in 'src/core/tsconfig.json' + Matched by default include pattern '**/*' src/core/some_decl.d.ts - Matched by include pattern '**/*' in 'src/core/tsconfig.json' + Matched by default include pattern '**/*' [12:00:44 AM] Project 'src/logic/tsconfig.json' is out of date because oldest output 'src/logic/index.js.map' is older than newest input 'src/core' [12:00:45 AM] Building project '/src/logic/tsconfig.json'... @@ -483,7 +483,7 @@ src/core/anotherModule.d.ts Imported via '../core/anotherModule' from file 'src/logic/index.ts' File is output of project reference source 'src/core/anotherModule.ts' src/logic/index.ts - Matched by include pattern '**/*' in 'src/logic/tsconfig.json' + Matched by default include pattern '**/*' [12:00:51 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/core' [12:00:52 AM] Building project '/src/tests/tsconfig.json'... @@ -769,11 +769,11 @@ Output:: lib/lib.d.ts Default library for target 'es3' src/core/anotherModule.ts - Matched by include pattern '**/*' in 'src/core/tsconfig.json' + Matched by default include pattern '**/*' src/core/index.ts - Matched by include pattern '**/*' in 'src/core/tsconfig.json' + Matched by default include pattern '**/*' src/core/some_decl.d.ts - Matched by include pattern '**/*' in 'src/core/tsconfig.json' + Matched by default include pattern '**/*' [12:01:11 AM] Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies [12:01:13 AM] Updating output timestamps of project '/src/logic/tsconfig.json'... diff --git a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js index 7aa8c10c67d..2c639de2a7f 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js @@ -74,9 +74,9 @@ pkg2/dist/index.d.ts Imported via "@raymondfeng/pkg2" from file 'pkg3/src/keys.ts' with packageId '@raymondfeng/pkg2/dist/index.d.ts@1.0.0' pkg3/src/keys.ts Imported via './keys' from file 'pkg3/src/index.ts' - Matched by include pattern '**/*' in 'pkg3/tsconfig.json' + Matched by default include pattern '**/*' pkg3/src/index.ts - Matched by include pattern '**/*' in 'pkg3/tsconfig.json' + Matched by default include pattern '**/*' Found 1 error in pkg3/src/keys.ts:2 diff --git a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js index 043b54bdbb0..63625a4da40 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js @@ -74,9 +74,9 @@ pkg2/dist/index.d.ts Imported via "@raymondfeng/pkg2" from file 'pkg3/src/keys.ts' with packageId '@raymondfeng/pkg2/dist/index.d.ts@1.0.0' pkg3/src/keys.ts Imported via './keys' from file 'pkg3/src/index.ts' - Matched by include pattern '**/*' in 'pkg3/tsconfig.json' + Matched by default include pattern '**/*' pkg3/src/index.ts - Matched by include pattern '**/*' in 'pkg3/tsconfig.json' + Matched by default include pattern '**/*' Found 1 error in pkg3/src/keys.ts:2 diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js index db8d9a3c52b..94600f4e705 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js @@ -136,14 +136,14 @@ Resolving real path for '/user/username/projects/myProject/plugin-two/node_modul plugin-one/node_modules/typescript-fsa/index.d.ts Imported via "typescript-fsa" from file 'plugin-one/action.ts' with packageId 'typescript-fsa/index.d.ts@3.0.0-beta-2' plugin-one/action.ts - Matched by include pattern '**/*' in 'plugin-one/tsconfig.json' + Matched by default include pattern '**/*' plugin-two/node_modules/typescript-fsa/index.d.ts Imported via "typescript-fsa" from file 'plugin-two/index.d.ts' with packageId 'typescript-fsa/index.d.ts@3.0.0-beta-2' File redirects to file 'plugin-one/node_modules/typescript-fsa/index.d.ts' plugin-two/index.d.ts Imported via "plugin-two" from file 'plugin-one/index.ts' plugin-one/index.ts - Matched by include pattern '**/*' in 'plugin-one/tsconfig.json' + Matched by default include pattern '**/*' Program root files: ["/user/username/projects/myproject/plugin-one/action.ts","/user/username/projects/myproject/plugin-one/index.ts"] diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js index f35f09682d0..3a5649fe040 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js @@ -155,7 +155,7 @@ plugin-one/node_modules/typescript-fsa/index.d.ts Imported via "typescript-fsa" from file 'plugin-one/index.ts' with packageId 'typescript-fsa/index.d.ts@3.0.0-beta-2' File redirects to file 'plugin-two/node_modules/typescript-fsa/index.d.ts' plugin-one/index.ts - Matched by include pattern '**/*' in 'plugin-one/tsconfig.json' + Matched by default include pattern '**/*' Program root files: ["/user/username/projects/myproject/plugin-one/index.ts"] diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js index 8dff9f49f6c..69bdc8dc47c 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js @@ -155,7 +155,7 @@ plugin-one/node_modules/typescript-fsa/index.d.ts Imported via "typescript-fsa" from file 'plugin-one/index.ts' with packageId 'typescript-fsa/index.d.ts@3.0.0-beta-2' File redirects to file 'plugin-two/node_modules/typescript-fsa/index.d.ts' plugin-one/index.ts - Matched by include pattern '**/*' in 'plugin-one/tsconfig.json' + Matched by default include pattern '**/*' Program root files: ["/user/username/projects/myproject/plugin-one/index.ts"] diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js index 431f2bd31e8..a9e5925152f 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js @@ -136,14 +136,14 @@ Resolving real path for '/user/username/projects/myproject/plugin-two/node_modul plugin-one/node_modules/typescript-fsa/index.d.ts Imported via "typescript-fsa" from file 'plugin-one/action.ts' with packageId 'typescript-fsa/index.d.ts@3.0.0-beta-2' plugin-one/action.ts - Matched by include pattern '**/*' in 'plugin-one/tsconfig.json' + Matched by default include pattern '**/*' plugin-two/node_modules/typescript-fsa/index.d.ts Imported via "typescript-fsa" from file 'plugin-two/index.d.ts' with packageId 'typescript-fsa/index.d.ts@3.0.0-beta-2' File redirects to file 'plugin-one/node_modules/typescript-fsa/index.d.ts' plugin-two/index.d.ts Imported via "plugin-two" from file 'plugin-one/index.ts' plugin-one/index.ts - Matched by include pattern '**/*' in 'plugin-one/tsconfig.json' + Matched by default include pattern '**/*' Program root files: ["/user/username/projects/myproject/plugin-one/action.ts","/user/username/projects/myproject/plugin-one/index.ts"] diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-Windows-style-drive-root-is-lowercase.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-Windows-style-drive-root-is-lowercase.js index 33e472c8378..40746863561 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-Windows-style-drive-root-is-lowercase.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-Windows-style-drive-root-is-lowercase.js @@ -38,11 +38,11 @@ Output:: a/lib/lib.d.ts Default library for target 'es3' project/a.ts - Matched by include pattern '**/*' in 'project/tsconfig.json' + Matched by default include pattern '**/*' Imported via "C://project/a" from file 'project/b.ts' Imported via "c://project/a" from file 'project/b.ts' project/b.ts - Matched by include pattern '**/*' in 'project/tsconfig.json' + Matched by default include pattern '**/*' [12:00:22 AM] Found 0 errors. Watching for file changes. @@ -121,11 +121,11 @@ Output:: a/lib/lib.d.ts Default library for target 'es3' project/a.ts - Matched by include pattern '**/*' in 'project/tsconfig.json' + Matched by default include pattern '**/*' Imported via "C://project/a" from file 'project/b.ts' Imported via "c://project/a" from file 'project/b.ts' project/b.ts - Matched by include pattern '**/*' in 'project/tsconfig.json' + Matched by default include pattern '**/*' [12:00:32 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-Windows-style-drive-root-is-uppercase.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-Windows-style-drive-root-is-uppercase.js index e8961da542b..13879376eb1 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-Windows-style-drive-root-is-uppercase.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-Windows-style-drive-root-is-uppercase.js @@ -38,11 +38,11 @@ Output:: a/lib/lib.d.ts Default library for target 'es3' project/a.ts - Matched by include pattern '**/*' in 'project/tsconfig.json' + Matched by default include pattern '**/*' Imported via "C://project/a" from file 'project/b.ts' Imported via "c://project/a" from file 'project/b.ts' project/b.ts - Matched by include pattern '**/*' in 'project/tsconfig.json' + Matched by default include pattern '**/*' [12:00:22 AM] Found 0 errors. Watching for file changes. @@ -121,11 +121,11 @@ Output:: a/lib/lib.d.ts Default library for target 'es3' project/a.ts - Matched by include pattern '**/*' in 'project/tsconfig.json' + Matched by default include pattern '**/*' Imported via "C://project/a" from file 'project/b.ts' Imported via "c://project/a" from file 'project/b.ts' project/b.ts - Matched by include pattern '**/*' in 'project/tsconfig.json' + Matched by default include pattern '**/*' [12:00:32 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-both-directory-symlink-target-and-import-match-disk.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-both-directory-symlink-target-and-import-match-disk.js index 634c9ca43fa..bd029463f84 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-both-directory-symlink-target-and-import-match-disk.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-both-directory-symlink-target-and-import-match-disk.js @@ -40,11 +40,11 @@ Output:: Default library for target 'es3' XY/a.ts Imported via "./XY/a" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' link/a.ts Imported via "./link/a" from file 'b.ts' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:30 AM] Found 0 errors. Watching for file changes. @@ -150,11 +150,11 @@ Output:: Default library for target 'es3' XY/a.ts Imported via "./XY/a" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' link/a.ts Imported via "./link/a" from file 'b.ts' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:37 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-both-file-symlink-target-and-import-match-disk.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-both-file-symlink-target-and-import-match-disk.js index 53467069a46..e17bb9540e2 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-both-file-symlink-target-and-import-match-disk.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-both-file-symlink-target-and-import-match-disk.js @@ -39,13 +39,13 @@ Output:: ../../../../a/lib/lib.d.ts Default library for target 'es3' XY.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./XY" from file 'b.ts' link.ts Imported via "./link" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:32 AM] Found 0 errors. Watching for file changes. @@ -137,13 +137,13 @@ Output:: ../../../../a/lib/lib.d.ts Default library for target 'es3' XY.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./XY" from file 'b.ts' link.ts Imported via "./link" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:42 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js index 6f765544f57..b2c1b228bcd 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js @@ -103,7 +103,7 @@ Output:: user/username/projects/myproject/another.ts:1:24 - error TS1261: Already included file name '/user/username/projects/myproject/Logger.ts' differs from file name '/user/username/projects/myproject/logger.ts' only in casing. The file is in the program because: Imported via "./Logger" from file '/user/username/projects/myproject/another.ts' - Matched by include pattern '**/*' in '/user/username/projects/myproject/tsconfig.json' + Matched by default include pattern '**/*' 1 import { logger } from "./Logger"; new logger();    ~~~~~~~~~~ diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-directory-symlink-target-matches-disk-but-import-does-not.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-directory-symlink-target-matches-disk-but-import-does-not.js index b847f8fdb41..0a446016e44 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-directory-symlink-target-matches-disk-but-import-does-not.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-directory-symlink-target-matches-disk-but-import-does-not.js @@ -40,11 +40,11 @@ Output:: Default library for target 'es3' XY/a.ts Imported via "./XY/a" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' link/a.ts Imported via "./link/a" from file 'b.ts' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:30 AM] Found 0 errors. Watching for file changes. @@ -150,11 +150,11 @@ Output:: Default library for target 'es3' XY/a.ts Imported via "./XY/a" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' link/a.ts Imported via "./link/a" from file 'b.ts' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:37 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-file-symlink-target-matches-disk-but-import-does-not.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-file-symlink-target-matches-disk-but-import-does-not.js index 094ce2ca942..0c1bcfb03de 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-file-symlink-target-matches-disk-but-import-does-not.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-file-symlink-target-matches-disk-but-import-does-not.js @@ -39,13 +39,13 @@ Output:: ../../../../a/lib/lib.d.ts Default library for target 'es3' XY.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./XY" from file 'b.ts' link.ts Imported via "./link" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:32 AM] Found 0 errors. Watching for file changes. @@ -137,13 +137,13 @@ Output:: ../../../../a/lib/lib.d.ts Default library for target 'es3' XY.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./XY" from file 'b.ts' link.ts Imported via "./link" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:42 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import,-directory-symlink-target,-and-disk-are-all-different.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import,-directory-symlink-target,-and-disk-are-all-different.js index c9f4403e401..76dc9d31028 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import,-directory-symlink-target,-and-disk-are-all-different.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import,-directory-symlink-target,-and-disk-are-all-different.js @@ -46,9 +46,9 @@ Output:: link/a.ts Imported via "./link/a" from file 'b.ts' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' XY/a.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:30 AM] Found 1 error. Watching for file changes. @@ -162,9 +162,9 @@ Output:: link/a.ts Imported via "./link/a" from file 'b.ts' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' XY/a.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:37 AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import,-file-symlink-target,-and-disk-are-all-different.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import,-file-symlink-target,-and-disk-are-all-different.js index 39c9167334e..3966892e4c9 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import,-file-symlink-target,-and-disk-are-all-different.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import,-file-symlink-target,-and-disk-are-all-different.js @@ -44,12 +44,12 @@ Output:: ../../../../a/lib/lib.d.ts Default library for target 'es3' XY.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' link.ts Imported via "./link" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:32 AM] Found 1 error. Watching for file changes. @@ -150,12 +150,12 @@ Output:: ../../../../a/lib/lib.d.ts Default library for target 'es3' XY.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' link.ts Imported via "./link" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:39 AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-and-directory-symlink-target-agree-but-do-not-match-disk.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-and-directory-symlink-target-agree-but-do-not-match-disk.js index a3571bb3936..da211556831 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-and-directory-symlink-target-agree-but-do-not-match-disk.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-and-directory-symlink-target-agree-but-do-not-match-disk.js @@ -39,7 +39,7 @@ Output:: b.ts:2:19 - error TS1261: Already included file name '/user/username/projects/myproject/Xy/a.ts' differs from file name '/user/username/projects/myproject/XY/a.ts' only in casing. The file is in the program because: Imported via "./Xy/a" from file '/user/username/projects/myproject/b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' 2 import { a } from "./Xy/a";    ~~~~~~~~ @@ -48,11 +48,11 @@ Output:: Default library for target 'es3' Xy/a.ts Imported via "./Xy/a" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' link/a.ts Imported via "./link/a" from file 'b.ts' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:30 AM] Found 1 error. Watching for file changes. @@ -157,7 +157,7 @@ Output:: b.ts:2:19 - error TS1261: Already included file name '/user/username/projects/myproject/Xy/a.ts' differs from file name '/user/username/projects/myproject/XY/a.ts' only in casing. The file is in the program because: Imported via "./Xy/a" from file '/user/username/projects/myproject/b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' 2 import { a } from "./Xy/a";    ~~~~~~~~ @@ -166,11 +166,11 @@ Output:: Default library for target 'es3' Xy/a.ts Imported via "./Xy/a" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' link/a.ts Imported via "./link/a" from file 'b.ts' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:37 AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-and-file-symlink-target-agree-but-do-not-match-disk.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-and-file-symlink-target-agree-but-do-not-match-disk.js index f0059e68a8b..8c64599461b 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-and-file-symlink-target-agree-but-do-not-match-disk.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-and-file-symlink-target-agree-but-do-not-match-disk.js @@ -38,7 +38,7 @@ Output:: b.ts:2:19 - error TS1149: File name '/user/username/projects/myproject/Xy.ts' differs from already included file name '/user/username/projects/myproject/XY.ts' only in casing. The file is in the program because: - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./Xy" from file '/user/username/projects/myproject/b.ts' 2 import { a } from "./Xy"; @@ -47,13 +47,13 @@ Output:: ../../../../a/lib/lib.d.ts Default library for target 'es3' XY.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./Xy" from file 'b.ts' link.ts Imported via "./link" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:32 AM] Found 1 error. Watching for file changes. @@ -144,7 +144,7 @@ Output:: b.ts:2:19 - error TS1149: File name '/user/username/projects/myproject/Xy.ts' differs from already included file name '/user/username/projects/myproject/XY.ts' only in casing. The file is in the program because: - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./Xy" from file '/user/username/projects/myproject/b.ts' 2 import { a } from "./Xy"; @@ -153,13 +153,13 @@ Output:: ../../../../a/lib/lib.d.ts Default library for target 'es3' XY.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./Xy" from file 'b.ts' link.ts Imported via "./link" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:42 AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-matches-disk-but-directory-symlink-target-does-not.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-matches-disk-but-directory-symlink-target-does-not.js index effb28f9739..cbb14e2e89e 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-matches-disk-but-directory-symlink-target-does-not.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-matches-disk-but-directory-symlink-target-does-not.js @@ -39,7 +39,7 @@ Output:: b.ts:2:19 - error TS1261: Already included file name '/user/username/projects/myproject/Xy/a.ts' differs from file name '/user/username/projects/myproject/XY/a.ts' only in casing. The file is in the program because: Imported via "./Xy/a" from file '/user/username/projects/myproject/b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' 2 import { a } from "./Xy/a";    ~~~~~~~~ @@ -48,11 +48,11 @@ Output:: Default library for target 'es3' Xy/a.ts Imported via "./Xy/a" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' link/a.ts Imported via "./link/a" from file 'b.ts' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:30 AM] Found 1 error. Watching for file changes. @@ -157,7 +157,7 @@ Output:: b.ts:2:19 - error TS1261: Already included file name '/user/username/projects/myproject/Xy/a.ts' differs from file name '/user/username/projects/myproject/XY/a.ts' only in casing. The file is in the program because: Imported via "./Xy/a" from file '/user/username/projects/myproject/b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' 2 import { a } from "./Xy/a";    ~~~~~~~~ @@ -166,11 +166,11 @@ Output:: Default library for target 'es3' Xy/a.ts Imported via "./Xy/a" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' link/a.ts Imported via "./link/a" from file 'b.ts' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:37 AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-matches-disk-but-file-symlink-target-does-not.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-matches-disk-but-file-symlink-target-does-not.js index 23c67c71ac0..924d306c523 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-matches-disk-but-file-symlink-target-does-not.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-import-matches-disk-but-file-symlink-target-does-not.js @@ -38,7 +38,7 @@ Output:: b.ts:2:19 - error TS1149: File name '/user/username/projects/myproject/Xy.ts' differs from already included file name '/user/username/projects/myproject/XY.ts' only in casing. The file is in the program because: - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./Xy" from file '/user/username/projects/myproject/b.ts' 2 import { a } from "./Xy"; @@ -47,13 +47,13 @@ Output:: ../../../../a/lib/lib.d.ts Default library for target 'es3' XY.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./Xy" from file 'b.ts' link.ts Imported via "./link" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:32 AM] Found 1 error. Watching for file changes. @@ -144,7 +144,7 @@ Output:: b.ts:2:19 - error TS1149: File name '/user/username/projects/myproject/Xy.ts' differs from already included file name '/user/username/projects/myproject/XY.ts' only in casing. The file is in the program because: - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./Xy" from file '/user/username/projects/myproject/b.ts' 2 import { a } from "./Xy"; @@ -153,13 +153,13 @@ Output:: ../../../../a/lib/lib.d.ts Default library for target 'es3' XY.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./Xy" from file 'b.ts' link.ts Imported via "./link" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:42 AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-relative-information-file-location-changes.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-relative-information-file-location-changes.js index 481cc141c2a..ee3472dfd04 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-relative-information-file-location-changes.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-relative-information-file-location-changes.js @@ -34,7 +34,7 @@ Output:: The file is in the program because: Imported via "./ModuleC" from file '/user/username/projects/myproject/moduleA.ts' Imported via "./moduleC" from file '/user/username/projects/myproject/moduleB.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' 1 import a = require("./ModuleC")    ~~~~~~~~~~~ @@ -48,7 +48,7 @@ Output:: The file is in the program because: Imported via "./ModuleC" from file '/user/username/projects/myproject/moduleA.ts' Imported via "./moduleC" from file '/user/username/projects/myproject/moduleB.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' 1 import a = require("./moduleC")    ~~~~~~~~~~~ @@ -63,11 +63,11 @@ Output:: ModuleC.ts Imported via "./ModuleC" from file 'moduleA.ts' Imported via "./moduleC" from file 'moduleB.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' moduleA.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' moduleB.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:32 AM] Found 2 errors. Watching for file changes. @@ -149,7 +149,7 @@ Output:: The file is in the program because: Imported via "./ModuleC" from file '/user/username/projects/myproject/moduleA.ts' Imported via "./moduleC" from file '/user/username/projects/myproject/moduleB.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' 2 import a = require("./ModuleC")    ~~~~~~~~~~~ @@ -163,7 +163,7 @@ Output:: The file is in the program because: Imported via "./ModuleC" from file '/user/username/projects/myproject/moduleA.ts' Imported via "./moduleC" from file '/user/username/projects/myproject/moduleB.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' 1 import a = require("./moduleC")    ~~~~~~~~~~~ @@ -178,11 +178,11 @@ Output:: ModuleC.ts Imported via "./ModuleC" from file 'moduleA.ts' Imported via "./moduleC" from file 'moduleB.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' moduleA.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' moduleB.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:39 AM] Found 2 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-renaming-file-with-different-casing.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-renaming-file-with-different-casing.js index de81b0d9b7e..07d17cf5ab7 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-renaming-file-with-different-casing.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-renaming-file-with-different-casing.js @@ -100,7 +100,7 @@ Output:: user/username/projects/myproject/another.ts:1:24 - error TS1149: File name '/user/username/projects/myproject/logger.ts' differs from already included file name '/user/username/projects/myproject/Logger.ts' only in casing. The file is in the program because: - Matched by include pattern '**/*' in '/user/username/projects/myproject/tsconfig.json' + Matched by default include pattern '**/*' Imported via "./logger" from file '/user/username/projects/myproject/another.ts' 1 import { logger } from "./logger"; new logger(); diff --git a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-incremental.js b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-incremental.js index 7b5c667c63a..52a44364633 100644 --- a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-incremental.js @@ -62,7 +62,7 @@ Output:: node_modules/react/jsx-runtime/index.d.ts Imported via "react/jsx-runtime" from file 'index.tsx' with packageId 'react/jsx-runtime/index.d.ts@0.0.1' to import 'jsx' and 'jsxs' factory functions index.tsx - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Program root files: ["/users/username/projects/project/index.tsx"] @@ -176,7 +176,7 @@ Output:: node_modules/preact/jsx-runtime/index.d.ts Imported via "preact/jsx-runtime" from file 'index.tsx' with packageId 'preact/jsx-runtime/index.d.ts@0.0.1' to import 'jsx' and 'jsxs' factory functions index.tsx - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Found 1 error in index.tsx:1 diff --git a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-watch.js b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-watch.js index 7725b4acdac..31a33b2f8df 100644 --- a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-watch.js @@ -65,7 +65,7 @@ Output:: node_modules/react/jsx-runtime/index.d.ts Imported via "react/jsx-runtime" from file 'index.tsx' with packageId 'react/jsx-runtime/index.d.ts@0.0.1' to import 'jsx' and 'jsxs' factory functions index.tsx - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:44 AM] Found 0 errors. Watching for file changes. @@ -202,7 +202,7 @@ Output:: node_modules/preact/jsx-runtime/index.d.ts Imported via "preact/jsx-runtime" from file 'index.tsx' with packageId 'preact/jsx-runtime/index.d.ts@0.0.1' to import 'jsx' and 'jsxs' factory functions index.tsx - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' [12:00:57 AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/programUpdates/handle-recreated-files-correctly.js b/tests/baselines/reference/tscWatch/programUpdates/handle-recreated-files-correctly.js index a1adb29d110..0daf94bb3dc 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/handle-recreated-files-correctly.js +++ b/tests/baselines/reference/tscWatch/programUpdates/handle-recreated-files-correctly.js @@ -30,9 +30,9 @@ Output:: a/lib/lib.d.ts Default library for target 'es3' a/b/commonFile1.ts - Matched by include pattern '**/*' in 'a/b/tsconfig.json' + Matched by default include pattern '**/*' a/b/commonFile2.ts - Matched by include pattern '**/*' in 'a/b/tsconfig.json' + Matched by default include pattern '**/*' [12:00:22 AM] Found 0 errors. Watching for file changes. @@ -98,9 +98,9 @@ Output:: a/lib/lib.d.ts Default library for target 'es3' a/b/commonFile1.ts - Matched by include pattern '**/*' in 'a/b/tsconfig.json' + Matched by default include pattern '**/*' a/b/commonFile2.ts - Matched by include pattern '**/*' in 'a/b/tsconfig.json' + Matched by default include pattern '**/*' [12:00:32 AM] Found 0 errors. Watching for file changes. @@ -161,7 +161,7 @@ Output:: a/lib/lib.d.ts Default library for target 'es3' a/b/commonFile1.ts - Matched by include pattern '**/*' in 'a/b/tsconfig.json' + Matched by default include pattern '**/*' [12:00:38 AM] Found 0 errors. Watching for file changes. @@ -213,9 +213,9 @@ Output:: a/lib/lib.d.ts Default library for target 'es3' a/b/commonFile1.ts - Matched by include pattern '**/*' in 'a/b/tsconfig.json' + Matched by default include pattern '**/*' a/b/commonFile2.ts - Matched by include pattern '**/*' in 'a/b/tsconfig.json' + Matched by default include pattern '**/*' [12:00:48 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js index 8515ccfb52b..4ce7e13cd84 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js @@ -98,7 +98,7 @@ Output:: b.ts:1:43 - error TS1149: File name '/A.ts' differs from already included file name '/a.ts' only in casing. The file is in the program because: - Matched by include pattern '**/*' in '/tsconfig.json' + Matched by default include pattern '**/*' Imported via './a' from file '/b.ts' Imported via './A' from file '/b.ts' diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js index e48000c8b37..df6d2343150 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-renaming-a-file.js @@ -131,7 +131,7 @@ Output:: error TS6053: File '/user/username/projects/myproject/src/file2.ts' not found. The file is in the program because: - Matched by include pattern '**/*' in '/user/username/projects/myproject/tsconfig.json' + Matched by default include pattern '**/*' [12:00:41 AM] Found 1 error. Watching for file changes. diff --git a/tests/baselines/reference/tsserver/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js b/tests/baselines/reference/tsserver/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js index 4b5747816f6..6dca8da543b 100644 --- a/tests/baselines/reference/tsserver/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js +++ b/tests/baselines/reference/tsserver/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js @@ -35,10 +35,10 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured) ../../../../a/lib/lib.d.ts Default library for target 'es3' Logger.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./Logger" from file 'another.ts' another.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: @@ -75,7 +75,7 @@ Different program with same set of files event: {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/user/username/projects/myproject/another.ts","diagnostics":[]}} event: - {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/user/username/projects/myproject/another.ts","diagnostics":[{"start":{"line":1,"offset":24},"end":{"line":1,"offset":34},"text":"File name '/user/username/projects/myproject/logger.ts' differs from already included file name '/user/username/projects/myproject/Logger.ts' only in casing.\n The file is in the program because:\n Matched by include pattern '**/*' in '/user/username/projects/myproject/tsconfig.json'\n Imported via \"./logger\" from file '/user/username/projects/myproject/another.ts'","code":1149,"category":"error"}]}} + {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/user/username/projects/myproject/another.ts","diagnostics":[{"start":{"line":1,"offset":24},"end":{"line":1,"offset":34},"text":"File name '/user/username/projects/myproject/logger.ts' differs from already included file name '/user/username/projects/myproject/Logger.ts' only in casing.\n The file is in the program because:\n Matched by default include pattern '**/*'\n Imported via \"./logger\" from file '/user/username/projects/myproject/another.ts'","code":1149,"category":"error"}]}} event: {"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/user/username/projects/myproject/another.ts","diagnostics":[]}} event: diff --git a/tests/baselines/reference/tsserver/forceConsistentCasingInFileNames/works-when-renaming-file-with-different-casing.js b/tests/baselines/reference/tsserver/forceConsistentCasingInFileNames/works-when-renaming-file-with-different-casing.js index 1af314f8ae8..370b7d9eeca 100644 --- a/tests/baselines/reference/tsserver/forceConsistentCasingInFileNames/works-when-renaming-file-with-different-casing.js +++ b/tests/baselines/reference/tsserver/forceConsistentCasingInFileNames/works-when-renaming-file-with-different-casing.js @@ -35,10 +35,10 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured) ../../../../a/lib/lib.d.ts Default library for target 'es3' Logger.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' Imported via "./Logger" from file 'another.ts' another.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/navTo/should-de-duplicate-symbols-when-searching-all-projects.js b/tests/baselines/reference/tsserver/navTo/should-de-duplicate-symbols-when-searching-all-projects.js index 1afcc60f829..30a53a54c33 100644 --- a/tests/baselines/reference/tsserver/navTo/should-de-duplicate-symbols-when-searching-all-projects.js +++ b/tests/baselines/reference/tsserver/navTo/should-de-duplicate-symbols-when-searching-all-projects.js @@ -27,7 +27,7 @@ Project '/a/tsconfig.json' (Configured) index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /a @@ -105,7 +105,7 @@ Project '/b/tsconfig.json' (Configured) ../a/index.ts Imported via "../a" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- response:{"response":[{"name":"abcdef","kind":"const","kindModifiers":"export","isCaseSensitive":true,"matchKind":"exact","file":"/a/index.ts","start":{"line":1,"offset":14},"end":{"line":1,"offset":24}}],"responseRequired":true} \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/navTo/should-de-duplicate-symbols.js b/tests/baselines/reference/tsserver/navTo/should-de-duplicate-symbols.js index 5cd8cb893a8..6ba2ebed1d9 100644 --- a/tests/baselines/reference/tsserver/navTo/should-de-duplicate-symbols.js +++ b/tests/baselines/reference/tsserver/navTo/should-de-duplicate-symbols.js @@ -27,7 +27,7 @@ Project '/a/tsconfig.json' (Configured) index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /a @@ -77,7 +77,7 @@ Project '/b/tsconfig.json' (Configured) ../a/index.ts Imported via "../a" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /b diff --git a/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-generated-when-the-config-file-changes.js b/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-generated-when-the-config-file-changes.js index c290bb78497..27b0dcfb387 100644 --- a/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-generated-when-the-config-file-changes.js +++ b/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-generated-when-the-config-file-changes.js @@ -31,7 +31,7 @@ Project '/a/b/tsconfig.json' (Configured) ../lib/lib.d.ts Default library for target 'es3' app.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-generated-when-the-config-file-doesnt-have-errors.js b/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-generated-when-the-config-file-doesnt-have-errors.js index 99c6e880c5c..9f12746363e 100644 --- a/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-generated-when-the-config-file-doesnt-have-errors.js +++ b/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-generated-when-the-config-file-doesnt-have-errors.js @@ -31,7 +31,7 @@ Project '/a/b/tsconfig.json' (Configured) ../lib/lib.d.ts Default library for target 'es3' app.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-generated-when-the-config-file-has-errors.js b/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-generated-when-the-config-file-has-errors.js index 127e18a1207..164680af35c 100644 --- a/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-generated-when-the-config-file-has-errors.js +++ b/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-generated-when-the-config-file-has-errors.js @@ -31,7 +31,7 @@ Project '/a/b/tsconfig.json' (Configured) ../lib/lib.d.ts Default library for target 'es3' app.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-not-generated-when-the-config-file-has-errors-but-suppressDiagnosticEvents-is-true.js b/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-not-generated-when-the-config-file-has-errors-but-suppressDiagnosticEvents-is-true.js index 41cfb0ff066..67d3989d779 100644 --- a/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-not-generated-when-the-config-file-has-errors-but-suppressDiagnosticEvents-is-true.js +++ b/tests/baselines/reference/tsserver/projectErrors/configFileDiagnostic-events-are-not-generated-when-the-config-file-has-errors-but-suppressDiagnosticEvents-is-true.js @@ -31,7 +31,7 @@ Project '/a/b/tsconfig.json' (Configured) ../lib/lib.d.ts Default library for target 'es3' app.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectErrors/folder-rename-updates-project-structure-and-reports-no-errors.js b/tests/baselines/reference/tsserver/projectErrors/folder-rename-updates-project-structure-and-reports-no-errors.js index 9d4011c2649..46fa2c405a2 100644 --- a/tests/baselines/reference/tsserver/projectErrors/folder-rename-updates-project-structure-and-reports-no-errors.js +++ b/tests/baselines/reference/tsserver/projectErrors/folder-rename-updates-project-structure-and-reports-no-errors.js @@ -32,9 +32,9 @@ Project '/a/b/projects/myproject/tsconfig.json' (Configured) bar/app.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' foo/foo.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: @@ -93,9 +93,9 @@ Project '/a/b/projects/myproject/tsconfig.json' (Configured) bar/app.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' foo2/foo.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* diff --git a/tests/baselines/reference/tsserver/projectErrors/npm-install-when-timeout-occurs-after-installation.js b/tests/baselines/reference/tsserver/projectErrors/npm-install-when-timeout-occurs-after-installation.js index 584478548a4..6026e090cd7 100644 --- a/tests/baselines/reference/tsserver/projectErrors/npm-install-when-timeout-occurs-after-installation.js +++ b/tests/baselines/reference/tsserver/projectErrors/npm-install-when-timeout-occurs-after-installation.js @@ -35,7 +35,7 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured) ../../../../a/lib/lib.d.ts Default library for target 'es3' src/main.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: @@ -237,7 +237,7 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured) node_modules/@angular/core/index.d.ts Imported via '@angular/core' from file 'src/main.ts' src/main.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* diff --git a/tests/baselines/reference/tsserver/projectErrors/npm-install-when-timeout-occurs-inbetween-installation.js b/tests/baselines/reference/tsserver/projectErrors/npm-install-when-timeout-occurs-inbetween-installation.js index 9fb71d12544..cb081c277d9 100644 --- a/tests/baselines/reference/tsserver/projectErrors/npm-install-when-timeout-occurs-inbetween-installation.js +++ b/tests/baselines/reference/tsserver/projectErrors/npm-install-when-timeout-occurs-inbetween-installation.js @@ -35,7 +35,7 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured) ../../../../a/lib/lib.d.ts Default library for target 'es3' src/main.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: @@ -260,7 +260,7 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured) node_modules/@angular/core/index.d.ts Imported via '@angular/core' from file 'src/main.ts' src/main.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* diff --git a/tests/baselines/reference/tsserver/projectErrors/when-semantic-error-returns-includes-global-error-gerErr-with-sync-commands.js b/tests/baselines/reference/tsserver/projectErrors/when-semantic-error-returns-includes-global-error-gerErr-with-sync-commands.js index ac2b48eaed2..68998048cd7 100644 --- a/tests/baselines/reference/tsserver/projectErrors/when-semantic-error-returns-includes-global-error-gerErr-with-sync-commands.js +++ b/tests/baselines/reference/tsserver/projectErrors/when-semantic-error-returns-includes-global-error-gerErr-with-sync-commands.js @@ -29,7 +29,7 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured) ../../../../a/lib/lib.d.ts Default library for target 'es3' ui.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Project '/user/username/projects/myproject/tsconfig.json' (Configured) diff --git a/tests/baselines/reference/tsserver/projectErrors/when-semantic-error-returns-includes-global-error-getErr.js b/tests/baselines/reference/tsserver/projectErrors/when-semantic-error-returns-includes-global-error-getErr.js index e7f57c4b839..c58c641760a 100644 --- a/tests/baselines/reference/tsserver/projectErrors/when-semantic-error-returns-includes-global-error-getErr.js +++ b/tests/baselines/reference/tsserver/projectErrors/when-semantic-error-returns-includes-global-error-getErr.js @@ -31,7 +31,7 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured) ../../../../a/lib/lib.d.ts Default library for target 'es3' ui.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectErrors/when-semantic-error-returns-includes-global-error-geterrForProject.js b/tests/baselines/reference/tsserver/projectErrors/when-semantic-error-returns-includes-global-error-geterrForProject.js index ca2aec83065..f387f2fe303 100644 --- a/tests/baselines/reference/tsserver/projectErrors/when-semantic-error-returns-includes-global-error-geterrForProject.js +++ b/tests/baselines/reference/tsserver/projectErrors/when-semantic-error-returns-includes-global-error-geterrForProject.js @@ -31,7 +31,7 @@ Project '/user/username/projects/myproject/tsconfig.json' (Configured) ../../../../a/lib/lib.d.ts Default library for target 'es3' ui.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectLanguageServiceStateEvent/large-file-size-is-determined-correctly.js b/tests/baselines/reference/tsserver/projectLanguageServiceStateEvent/large-file-size-is-determined-correctly.js index 98221e5c651..50ba703368f 100644 --- a/tests/baselines/reference/tsserver/projectLanguageServiceStateEvent/large-file-size-is-determined-correctly.js +++ b/tests/baselines/reference/tsserver/projectLanguageServiceStateEvent/large-file-size-is-determined-correctly.js @@ -35,7 +35,7 @@ Project '/a/jsconfig.json' (Configured) lib/lib.d.ts Default library for target 'es3' app.js - Matched by include pattern '**/*' in 'jsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Project '/a/jsconfig.json' (Configured) diff --git a/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-dependency-project-is-not-open-gerErr-with-sync-commands.js b/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-dependency-project-is-not-open-gerErr-with-sync-commands.js index c4626262b1f..614454c9e70 100644 --- a/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-dependency-project-is-not-open-gerErr-with-sync-commands.js +++ b/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-dependency-project-is-not-open-gerErr-with-sync-commands.js @@ -57,7 +57,7 @@ Project '/user/username/projects/myproject/usage/tsconfig.json' (Configured) ../dependency/fns.ts Imported via '../decls/fns' from file 'usage.ts' usage.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/usage diff --git a/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-dependency-project-is-not-open-getErr.js b/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-dependency-project-is-not-open-getErr.js index 5ec2fe654cf..4f1c8cc2e71 100644 --- a/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-dependency-project-is-not-open-getErr.js +++ b/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-dependency-project-is-not-open-getErr.js @@ -59,7 +59,7 @@ Project '/user/username/projects/myproject/usage/tsconfig.json' (Configured) ../dependency/fns.ts Imported via '../decls/fns' from file 'usage.ts' usage.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-dependency-project-is-not-open-geterrForProject.js b/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-dependency-project-is-not-open-geterrForProject.js index 9aac5c55269..ca8ec478b78 100644 --- a/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-dependency-project-is-not-open-geterrForProject.js +++ b/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-dependency-project-is-not-open-geterrForProject.js @@ -59,7 +59,7 @@ Project '/user/username/projects/myproject/usage/tsconfig.json' (Configured) ../dependency/fns.ts Imported via '../decls/fns' from file 'usage.ts' usage.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-the-depedency-file-is-open-gerErr-with-sync-commands.js b/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-the-depedency-file-is-open-gerErr-with-sync-commands.js index 615d0115011..e0a33ee41ad 100644 --- a/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-the-depedency-file-is-open-gerErr-with-sync-commands.js +++ b/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-the-depedency-file-is-open-gerErr-with-sync-commands.js @@ -57,7 +57,7 @@ Project '/user/username/projects/myproject/usage/tsconfig.json' (Configured) ../dependency/fns.ts Imported via '../decls/fns' from file 'usage.ts' usage.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/usage @@ -91,7 +91,7 @@ Project '/user/username/projects/myproject/dependency/tsconfig.json' (Configured ../../../../../a/lib/lib.d.ts Default library for target 'es3' fns.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/dependency diff --git a/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-the-depedency-file-is-open-getErr.js b/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-the-depedency-file-is-open-getErr.js index 1c9a4d17819..3e0d3e8b6a5 100644 --- a/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-the-depedency-file-is-open-getErr.js +++ b/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-the-depedency-file-is-open-getErr.js @@ -59,7 +59,7 @@ Project '/user/username/projects/myproject/usage/tsconfig.json' (Configured) ../dependency/fns.ts Imported via '../decls/fns' from file 'usage.ts' usage.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: @@ -101,7 +101,7 @@ Project '/user/username/projects/myproject/dependency/tsconfig.json' (Configured ../../../../../a/lib/lib.d.ts Default library for target 'es3' fns.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-the-depedency-file-is-open-geterrForProject.js b/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-the-depedency-file-is-open-geterrForProject.js index 18e76ddb5e0..80d446e4ccf 100644 --- a/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-the-depedency-file-is-open-geterrForProject.js +++ b/tests/baselines/reference/tsserver/projectReferenceErrors/with-module-scenario-when-the-depedency-file-is-open-geterrForProject.js @@ -59,7 +59,7 @@ Project '/user/username/projects/myproject/usage/tsconfig.json' (Configured) ../dependency/fns.ts Imported via '../decls/fns' from file 'usage.ts' usage.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: @@ -101,7 +101,7 @@ Project '/user/username/projects/myproject/dependency/tsconfig.json' (Configured ../../../../../a/lib/lib.d.ts Default library for target 'es3' fns.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-dependency-project-is-not-open-gerErr-with-sync-commands.js b/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-dependency-project-is-not-open-gerErr-with-sync-commands.js index d54d8a8ed4c..b6557c188b2 100644 --- a/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-dependency-project-is-not-open-gerErr-with-sync-commands.js +++ b/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-dependency-project-is-not-open-gerErr-with-sync-commands.js @@ -56,7 +56,7 @@ Project '/user/username/projects/myproject/usage/tsconfig.json' (Configured) ../dependency/fns.ts Source from referenced project '../dependency/tsconfig.json' included because '--outFile' specified usage.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/usage diff --git a/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-dependency-project-is-not-open-getErr.js b/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-dependency-project-is-not-open-getErr.js index cd4980e3517..71b2ef4080c 100644 --- a/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-dependency-project-is-not-open-getErr.js +++ b/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-dependency-project-is-not-open-getErr.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/usage/tsconfig.json' (Configured) ../dependency/fns.ts Source from referenced project '../dependency/tsconfig.json' included because '--outFile' specified usage.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-dependency-project-is-not-open-geterrForProject.js b/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-dependency-project-is-not-open-geterrForProject.js index 0441470c965..efe0d23a2fb 100644 --- a/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-dependency-project-is-not-open-geterrForProject.js +++ b/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-dependency-project-is-not-open-geterrForProject.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/usage/tsconfig.json' (Configured) ../dependency/fns.ts Source from referenced project '../dependency/tsconfig.json' included because '--outFile' specified usage.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-the-depedency-file-is-open-gerErr-with-sync-commands.js b/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-the-depedency-file-is-open-gerErr-with-sync-commands.js index 07b7d01685e..9d8ec6cbb7c 100644 --- a/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-the-depedency-file-is-open-gerErr-with-sync-commands.js +++ b/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-the-depedency-file-is-open-gerErr-with-sync-commands.js @@ -56,7 +56,7 @@ Project '/user/username/projects/myproject/usage/tsconfig.json' (Configured) ../dependency/fns.ts Source from referenced project '../dependency/tsconfig.json' included because '--outFile' specified usage.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/usage @@ -90,7 +90,7 @@ Project '/user/username/projects/myproject/dependency/tsconfig.json' (Configured ../../../../../a/lib/lib.d.ts Default library for target 'es3' fns.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/dependency diff --git a/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-the-depedency-file-is-open-getErr.js b/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-the-depedency-file-is-open-getErr.js index bfd0a68ad05..f7e7deeee04 100644 --- a/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-the-depedency-file-is-open-getErr.js +++ b/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-the-depedency-file-is-open-getErr.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/usage/tsconfig.json' (Configured) ../dependency/fns.ts Source from referenced project '../dependency/tsconfig.json' included because '--outFile' specified usage.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: @@ -100,7 +100,7 @@ Project '/user/username/projects/myproject/dependency/tsconfig.json' (Configured ../../../../../a/lib/lib.d.ts Default library for target 'es3' fns.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-the-depedency-file-is-open-geterrForProject.js b/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-the-depedency-file-is-open-geterrForProject.js index d9f23968cc7..578c620db94 100644 --- a/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-the-depedency-file-is-open-geterrForProject.js +++ b/tests/baselines/reference/tsserver/projectReferenceErrors/with-non-module-when-the-depedency-file-is-open-geterrForProject.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/usage/tsconfig.json' (Configured) ../dependency/fns.ts Source from referenced project '../dependency/tsconfig.json' included because '--outFile' specified usage.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: @@ -100,7 +100,7 @@ Project '/user/username/projects/myproject/dependency/tsconfig.json' (Configured ../../../../../a/lib/lib.d.ts Default library for target 'es3' fns.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectReferences/auto-import-with-referenced-project-when-built-with-disableSourceOfProjectReferenceRedirect.js b/tests/baselines/reference/tsserver/projectReferences/auto-import-with-referenced-project-when-built-with-disableSourceOfProjectReferenceRedirect.js index 241b70977b5..058e633093a 100644 --- a/tests/baselines/reference/tsserver/projectReferences/auto-import-with-referenced-project-when-built-with-disableSourceOfProjectReferenceRedirect.js +++ b/tests/baselines/reference/tsserver/projectReferences/auto-import-with-referenced-project-when-built-with-disableSourceOfProjectReferenceRedirect.js @@ -72,9 +72,9 @@ Project '/user/username/projects/myproject/app/src/program/tsconfig.json' (Confi ../../../shared/bld/library/index.d.ts Imported via "shared" from file 'bar.ts' with packageId 'shared/bld/library/index.d.ts@1.0.0' bar.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/app/src/program diff --git a/tests/baselines/reference/tsserver/projectReferences/auto-import-with-referenced-project-when-built.js b/tests/baselines/reference/tsserver/projectReferences/auto-import-with-referenced-project-when-built.js index 76af89b5a9b..47d336a43c8 100644 --- a/tests/baselines/reference/tsserver/projectReferences/auto-import-with-referenced-project-when-built.js +++ b/tests/baselines/reference/tsserver/projectReferences/auto-import-with-referenced-project-when-built.js @@ -71,9 +71,9 @@ Project '/user/username/projects/myproject/app/src/program/tsconfig.json' (Confi ../../../shared/src/library/index.ts Imported via "shared" from file 'bar.ts' with packageId 'shared/bld/library/index.d.ts@1.0.0' bar.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/app/src/program diff --git a/tests/baselines/reference/tsserver/projectReferences/auto-import-with-referenced-project.js b/tests/baselines/reference/tsserver/projectReferences/auto-import-with-referenced-project.js index 76af89b5a9b..47d336a43c8 100644 --- a/tests/baselines/reference/tsserver/projectReferences/auto-import-with-referenced-project.js +++ b/tests/baselines/reference/tsserver/projectReferences/auto-import-with-referenced-project.js @@ -71,9 +71,9 @@ Project '/user/username/projects/myproject/app/src/program/tsconfig.json' (Confi ../../../shared/src/library/index.ts Imported via "shared" from file 'bar.ts' with packageId 'shared/bld/library/index.d.ts@1.0.0' bar.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/app/src/program diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js index 85319dd3571..f0a2a720de7 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/lib/index.d.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a @@ -94,9 +94,9 @@ Project '/user/username/projects/myproject/b/tsconfig.json' (Configured) index.ts Imported via "." from file 'helper.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' helper.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/b diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js index 59a61bd25be..2425cab99f1 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/lib/index.d.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a @@ -94,9 +94,9 @@ Project '/user/username/projects/myproject/b/tsconfig.json' (Configured) index.ts Imported via "." from file 'helper.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' helper.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/b diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js index 61d2444b9de..a62b1ae34c9 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/index.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a @@ -93,9 +93,9 @@ Project '/user/username/projects/myproject/b/tsconfig.json' (Configured) index.ts Imported via "." from file 'helper.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' helper.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/b diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js index 61d2444b9de..a62b1ae34c9 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/index.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a @@ -93,9 +93,9 @@ Project '/user/username/projects/myproject/b/tsconfig.json' (Configured) index.ts Imported via "." from file 'helper.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' helper.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/b diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js index 3a8687c455e..748c84dfbf8 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/lib/index.d.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a @@ -94,9 +94,9 @@ Project '/user/username/projects/myproject/b/tsconfig.json' (Configured) index.ts Imported via "." from file 'helper.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' helper.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/b diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js index f93ce3f7d93..a2d046ad30b 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/lib/index.d.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a @@ -94,9 +94,9 @@ Project '/user/username/projects/myproject/b/tsconfig.json' (Configured) index.ts Imported via "." from file 'helper.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' helper.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/b diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js index 44dc2ca096e..d6532782ff1 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/index.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a @@ -93,9 +93,9 @@ Project '/user/username/projects/myproject/b/tsconfig.json' (Configured) index.ts Imported via "." from file 'helper.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' helper.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/b diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js index 44dc2ca096e..d6532782ff1 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/index.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a @@ -93,9 +93,9 @@ Project '/user/username/projects/myproject/b/tsconfig.json' (Configured) index.ts Imported via "." from file 'helper.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' helper.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/b diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js index 3e221cf09cd..b65bf5e7d50 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/lib/index.d.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js index 8b358d0ce6d..56293379920 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/lib/index.d.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js index 55559b9acd2..43eae09fdf7 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/index.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js index 55559b9acd2..43eae09fdf7 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-disabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/index.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js index de6604b6549..057b8afb96d 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-missing.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/lib/index.d.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js index 3dd0ca101ba..00254fbec0e 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-disabled-and-a-decl-map-is-present.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/lib/index.d.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a @@ -97,9 +97,9 @@ Project '/user/username/projects/myproject/b/tsconfig.json' (Configured) index.ts Imported via "." from file 'helper.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' helper.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/b diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js index 491aacf1f4f..b24d524cc4d 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-missing.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/index.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a @@ -95,9 +95,9 @@ Project '/user/username/projects/myproject/b/tsconfig.json' (Configured) index.ts Imported via "." from file 'helper.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' helper.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/b diff --git a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js index 491aacf1f4f..b24d524cc4d 100644 --- a/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js +++ b/tests/baselines/reference/tsserver/projectReferences/find-refs-to-decl-in-other-proj-when-proj-is-not-loaded-and-refd-proj-loading-is-enabled-and-proj-ref-redirects-are-enabled-and-a-decl-map-is-present.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/a/tsconfig.json' (Configured) ../b/index.ts Imported via "../b/lib" from file 'index.ts' index.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/a @@ -95,9 +95,9 @@ Project '/user/username/projects/myproject/b/tsconfig.json' (Configured) index.ts Imported via "." from file 'helper.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' helper.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/b diff --git a/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-not-open-with-disableSourceOfProjectReferenceRedirect.js b/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-not-open-with-disableSourceOfProjectReferenceRedirect.js index 33ff2899bb1..1eea85290b7 100644 --- a/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-not-open-with-disableSourceOfProjectReferenceRedirect.js +++ b/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-not-open-with-disableSourceOfProjectReferenceRedirect.js @@ -59,7 +59,7 @@ Project '/user/username/projects/myproject/projects/project2/tsconfig.json' (Con ../project1/class1.d.ts Output from referenced project '../project1/tsconfig.json' included because '--module' is specified as 'none' class2.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/projects/project2 @@ -125,7 +125,7 @@ Project '/user/username/projects/myproject/projects/project2/tsconfig.json' (Con ../project1/class3.d.ts Output from referenced project '../project1/tsconfig.json' included because '--module' is specified as 'none' class2.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* @@ -175,7 +175,7 @@ Project '/user/username/projects/myproject/projects/project2/tsconfig.json' (Con ../project1/class1.d.ts Output from referenced project '../project1/tsconfig.json' included because '--module' is specified as 'none' class2.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* @@ -222,7 +222,7 @@ Project '/user/username/projects/myproject/projects/project2/tsconfig.json' (Con ../project1/class3.d.ts Output from referenced project '../project1/tsconfig.json' included because '--module' is specified as 'none' class2.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* diff --git a/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-not-open.js b/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-not-open.js index b7dd8d659e8..b3bc3321005 100644 --- a/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-not-open.js +++ b/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-not-open.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/projects/project2/tsconfig.json' (Con ../project1/class1.ts Source from referenced project '../project1/tsconfig.json' included because '--module' is specified as 'none' class2.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/projects/project2 @@ -94,7 +94,7 @@ Project '/user/username/projects/myproject/projects/project2/tsconfig.json' (Con ../project1/class3.ts Source from referenced project '../project1/tsconfig.json' included because '--module' is specified as 'none' class2.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* diff --git a/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-open-with-disableSourceOfProjectReferenceRedirect.js b/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-open-with-disableSourceOfProjectReferenceRedirect.js index 7f2d161a7d7..35c21897bc2 100644 --- a/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-open-with-disableSourceOfProjectReferenceRedirect.js +++ b/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-open-with-disableSourceOfProjectReferenceRedirect.js @@ -59,7 +59,7 @@ Project '/user/username/projects/myproject/projects/project2/tsconfig.json' (Con ../project1/class1.d.ts Output from referenced project '../project1/tsconfig.json' included because '--module' is specified as 'none' class2.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/projects/project2 @@ -94,7 +94,7 @@ Project '/user/username/projects/myproject/projects/project1/tsconfig.json' (Con ../../../../../../a/lib/lib.d.ts Default library for target 'es3' class1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/projects/project1 @@ -138,9 +138,9 @@ Project '/user/username/projects/myproject/projects/project1/tsconfig.json' (Con ../../../../../../a/lib/lib.d.ts Default library for target 'es3' class1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' class3.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* @@ -199,7 +199,7 @@ Project '/user/username/projects/myproject/projects/project2/tsconfig.json' (Con ../project1/class3.d.ts Output from referenced project '../project1/tsconfig.json' included because '--module' is specified as 'none' class2.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* @@ -261,7 +261,7 @@ Project '/user/username/projects/myproject/projects/project2/tsconfig.json' (Con ../project1/class1.d.ts Output from referenced project '../project1/tsconfig.json' included because '--module' is specified as 'none' class2.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* @@ -320,7 +320,7 @@ Project '/user/username/projects/myproject/projects/project2/tsconfig.json' (Con ../project1/class3.d.ts Output from referenced project '../project1/tsconfig.json' included because '--module' is specified as 'none' class2.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* diff --git a/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-open.js b/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-open.js index e599b581ce2..cd7fff83f72 100644 --- a/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-open.js +++ b/tests/baselines/reference/tsserver/projectReferences/new-file-is-added-to-the-referenced-project-when-referenced-project-is-open.js @@ -58,7 +58,7 @@ Project '/user/username/projects/myproject/projects/project2/tsconfig.json' (Con ../project1/class1.ts Source from referenced project '../project1/tsconfig.json' included because '--module' is specified as 'none' class2.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/projects/project2 @@ -94,7 +94,7 @@ Project '/user/username/projects/myproject/projects/project1/tsconfig.json' (Con ../../../../../../a/lib/lib.d.ts Default library for target 'es3' class1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/projects/project1 @@ -138,7 +138,7 @@ Project '/user/username/projects/myproject/projects/project2/tsconfig.json' (Con ../project1/class3.ts Source from referenced project '../project1/tsconfig.json' included because '--module' is specified as 'none' class2.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: /user/username/projects/myproject/projects/project1/tsconfig.json @@ -154,9 +154,9 @@ Project '/user/username/projects/myproject/projects/project1/tsconfig.json' (Con ../../../../../../a/lib/lib.d.ts Default library for target 'es3' class1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' class3.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* diff --git a/tests/baselines/reference/tsserver/projectReferences/project-is-directly-referenced-by-solution.js b/tests/baselines/reference/tsserver/projectReferences/project-is-directly-referenced-by-solution.js index c4e3dc48914..cba2ddff410 100644 --- a/tests/baselines/reference/tsserver/projectReferences/project-is-directly-referenced-by-solution.js +++ b/tests/baselines/reference/tsserver/projectReferences/project-is-directly-referenced-by-solution.js @@ -544,7 +544,7 @@ Project '/user/username/projects/myproject/indirect3/tsconfig.json' (Configured) ../target/src/main.d.ts Imported via 'main' from file 'main.ts' main.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectReferences/project-is-indirectly-referenced-by-solution.js b/tests/baselines/reference/tsserver/projectReferences/project-is-indirectly-referenced-by-solution.js index adae146583b..f3a766b7f63 100644 --- a/tests/baselines/reference/tsserver/projectReferences/project-is-indirectly-referenced-by-solution.js +++ b/tests/baselines/reference/tsserver/projectReferences/project-is-indirectly-referenced-by-solution.js @@ -752,7 +752,7 @@ Project '/user/username/projects/myproject/indirect3/tsconfig.json' (Configured) ../target/src/main.d.ts Imported via 'main' from file 'main.ts' main.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-found-is-not-solution-but-references-open-file-through-project-reference.js b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-found-is-not-solution-but-references-open-file-through-project-reference.js index 76d8a82c686..0db18dfe0b6 100644 --- a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-found-is-not-solution-but-references-open-file-through-project-reference.js +++ b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-found-is-not-solution-but-references-open-file-through-project-reference.js @@ -621,7 +621,7 @@ Project '/user/username/projects/myproject/indirect3/tsconfig.json' (Configured) ../target/src/main.d.ts Imported via 'main' from file 'main.ts' main.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-is-indirectly-referenced-by-solution.js b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-is-indirectly-referenced-by-solution.js index 110de4c02a4..e361cbb2204 100644 --- a/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-is-indirectly-referenced-by-solution.js +++ b/tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-project-is-indirectly-referenced-by-solution.js @@ -853,7 +853,7 @@ Project '/user/username/projects/myproject/indirect3/tsconfig.json' (Configured) ../target/src/main.d.ts Imported via 'main' from file 'main.ts' main.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/projectReferences/when-files-from-two-projects-are-open-and-one-project-references.js b/tests/baselines/reference/tsserver/projectReferences/when-files-from-two-projects-are-open-and-one-project-references.js index 6697be444c3..3a9caf6e373 100644 --- a/tests/baselines/reference/tsserver/projectReferences/when-files-from-two-projects-are-open-and-one-project-references.js +++ b/tests/baselines/reference/tsserver/projectReferences/when-files-from-two-projects-are-open-and-one-project-references.js @@ -244,7 +244,7 @@ Project '/user/username/projects/myproject/main/tsconfig.json' (Configured) ../../../../../a/lib/lib.d.ts Default library for target 'es3' src/file1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/main @@ -277,7 +277,7 @@ Project '/user/username/projects/myproject/core/tsconfig.json' (Configured) ../../../../../a/lib/lib.d.ts Default library for target 'es3' src/file1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Search path: /user/username/projects/myproject/core @@ -316,7 +316,7 @@ Project '/user/username/projects/myproject/indirect/tsconfig.json' (Configured) ../../../../../a/lib/lib.d.ts Default library for target 'es3' src/file1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Creating configuration project /user/username/projects/myproject/coreRef1/tsconfig.json @@ -337,7 +337,7 @@ Project '/user/username/projects/myproject/coreRef1/tsconfig.json' (Configured) ../../../../../a/lib/lib.d.ts Default library for target 'es3' src/file1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Creating configuration project /user/username/projects/myproject/indirectDisabledChildLoad1/tsconfig.json @@ -358,7 +358,7 @@ Project '/user/username/projects/myproject/indirectDisabledChildLoad1/tsconfig.j ../../../../../a/lib/lib.d.ts Default library for target 'es3' src/file1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Creating configuration project /user/username/projects/myproject/indirectDisabledChildLoad2/tsconfig.json @@ -379,7 +379,7 @@ Project '/user/username/projects/myproject/indirectDisabledChildLoad2/tsconfig.j ../../../../../a/lib/lib.d.ts Default library for target 'es3' src/file1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Creating configuration project /user/username/projects/myproject/refToCoreRef3/tsconfig.json @@ -400,7 +400,7 @@ Project '/user/username/projects/myproject/refToCoreRef3/tsconfig.json' (Configu ../../../../../a/lib/lib.d.ts Default library for target 'es3' src/file1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Creating configuration project /user/username/projects/myproject/coreRef3/tsconfig.json @@ -421,7 +421,7 @@ Project '/user/username/projects/myproject/coreRef3/tsconfig.json' (Configured) ../../../../../a/lib/lib.d.ts Default library for target 'es3' src/file1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/core/src/file1.d.ts 2000 undefined Project: /user/username/projects/myproject/core/tsconfig.json WatchType: Missing generated file diff --git a/tests/baselines/reference/tsserver/projects/getting-errors-from-closed-script-info-does-not-throw-exception-because-of-getting-project-from-orphan-script-info.js b/tests/baselines/reference/tsserver/projects/getting-errors-from-closed-script-info-does-not-throw-exception-because-of-getting-project-from-orphan-script-info.js index d80fa072de0..559a2e338cb 100644 --- a/tests/baselines/reference/tsserver/projects/getting-errors-from-closed-script-info-does-not-throw-exception-because-of-getting-project-from-orphan-script-info.js +++ b/tests/baselines/reference/tsserver/projects/getting-errors-from-closed-script-info-does-not-throw-exception-because-of-getting-project-from-orphan-script-info.js @@ -29,7 +29,7 @@ Project '/a/b/tsconfig.json' (Configured) ../lib/lib.d.ts Default library for target 'es3' app.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Project '/a/b/tsconfig.json' (Configured) diff --git a/tests/baselines/reference/tsserver/projects/handles-delayed-directory-watch-invoke-on-file-creation.js b/tests/baselines/reference/tsserver/projects/handles-delayed-directory-watch-invoke-on-file-creation.js index fddcb0fa0e0..fba89e3066e 100644 --- a/tests/baselines/reference/tsserver/projects/handles-delayed-directory-watch-invoke-on-file-creation.js +++ b/tests/baselines/reference/tsserver/projects/handles-delayed-directory-watch-invoke-on-file-creation.js @@ -34,9 +34,9 @@ Project '/users/username/projects/project/tsconfig.json' (Configured) ../../../../a/lib/lib.d.ts Default library for target 'es3' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' sub/a.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: @@ -103,9 +103,9 @@ Project '/users/username/projects/project/tsconfig.json' (Configured) ../../../../a/lib/lib.d.ts Default library for target 'es3' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' a.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Project '/users/username/projects/project/tsconfig.json' (Configured) @@ -169,11 +169,11 @@ Project '/users/username/projects/project/tsconfig.json' (Configured) ../../../../a/lib/lib.d.ts Default library for target 'es3' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: - {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/users/username/projects/project/sub/a.ts","configFile":"/users/username/projects/project/tsconfig.json","diagnostics":[{"text":"File '/users/username/projects/project/a.ts' not found.\n The file is in the program because:\n Matched by include pattern '**/*' in '/users/username/projects/project/tsconfig.json'","code":6053,"category":"error"}]}} + {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/users/username/projects/project/sub/a.ts","configFile":"/users/username/projects/project/tsconfig.json","diagnostics":[{"text":"File '/users/username/projects/project/a.ts' not found.\n The file is in the program because:\n Matched by default include pattern '**/*'","code":6053,"category":"error"}]}} Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded FileWatcher:: Added:: WatchInfo: /users/username/projects/project/sub/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root FileWatcher:: Added:: WatchInfo: /users/username/projects/project/sub/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root @@ -275,9 +275,9 @@ Project '/users/username/projects/project/tsconfig.json' (Configured) ../../../../a/lib/lib.d.ts Default library for target 'es3' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' sub/a.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- event: diff --git a/tests/baselines/reference/tsserver/resolutionCache/renaming-module-should-restore-the-states-for-configured-projects.js b/tests/baselines/reference/tsserver/resolutionCache/renaming-module-should-restore-the-states-for-configured-projects.js index ba3251738cc..19d2f003e8a 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/renaming-module-should-restore-the-states-for-configured-projects.js +++ b/tests/baselines/reference/tsserver/resolutionCache/renaming-module-should-restore-the-states-for-configured-projects.js @@ -30,9 +30,9 @@ Project '/a/b/tsconfig.json' (Configured) moduleFile.ts Imported via './moduleFile' from file 'file1.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' file1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Project '/a/b/tsconfig.json' (Configured) @@ -73,9 +73,9 @@ Project '/a/b/tsconfig.json' (Configured) file1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' moduleFile1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Running: *ensureProjectForOpenFiles* @@ -135,9 +135,9 @@ Project '/a/b/tsconfig.json' (Configured) moduleFile.ts Imported via './moduleFile' from file 'file1.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' file1.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- response:{"response":[],"responseRequired":true} \ No newline at end of file diff --git a/tests/baselines/reference/tsserver/symLinks/rename-in-common-file-renames-all-project.js b/tests/baselines/reference/tsserver/symLinks/rename-in-common-file-renames-all-project.js index 8c65341cf39..fc37325f98e 100644 --- a/tests/baselines/reference/tsserver/symLinks/rename-in-common-file-renames-all-project.js +++ b/tests/baselines/reference/tsserver/symLinks/rename-in-common-file-renames-all-project.js @@ -34,9 +34,9 @@ Project '/users/username/projects/a/tsconfig.json' (Configured) Default library for target 'es3' c/fc.ts Imported via "./c/fc" from file 'a.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' a.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Project '/users/username/projects/a/tsconfig.json' (Configured) @@ -81,9 +81,9 @@ Project '/users/username/projects/b/tsconfig.json' (Configured) Default library for target 'es3' c/fc.ts Imported via "./c/fc" from file 'b.ts' - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' b.ts - Matched by include pattern '**/*' in 'tsconfig.json' + Matched by default include pattern '**/*' ----------------------------------------------- Project '/users/username/projects/a/tsconfig.json' (Configured) From 8bf45a4f93f2249f4ae72bba1ca16343b391b80a Mon Sep 17 00:00:00 2001 From: Justin Grant Date: Tue, 10 May 2022 16:06:08 -0700 Subject: [PATCH 26/29] fix: update types for RTF.p.formatToParts() result (#46508) This commit updates the type of `RelativeTimeFormatPart` to clarify that the `unit` prop is always singular, unlike the plural or singular values that are accepted as inputs. This also changes `RelativeTimeFormatPart` to be a discriminated union type because the `unit` prop is only present if the `type` prop's value is not "literal". Fixes #46245 --- src/lib/es2020.intl.d.ts | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index 9a548e9ec4f..c74f0566ca0 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -30,6 +30,25 @@ declare namespace Intl { | "second" | "seconds"; + /** + * Value of the `unit` property in objects returned by + * `Intl.RelativeTimeFormat.prototype.formatToParts()`. `formatToParts` and + * `format` methods accept either singular or plural unit names as input, + * but `formatToParts` only outputs singular (e.g. "day") not plural (e.g. + * "days"). + * + * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts). + */ + type RelativeTimeFormatUnitSingular = + | "year" + | "quarter" + | "month" + | "week" + | "day" + | "hour" + | "minute" + | "second"; + /** * The locale matching algorithm to use. * @@ -100,11 +119,16 @@ declare namespace Intl { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts). */ - interface RelativeTimeFormatPart { - type: string; - value: string; - unit?: RelativeTimeFormatUnit; - } + type RelativeTimeFormatPart = + | { + type: "literal"; + value: string; + } + | { + type: Exclude; + value: string; + unit: RelativeTimeFormatUnitSingular; + }; interface RelativeTimeFormat { /** From 08b1cce5957bb12ae7324ebe570cc8b4ddf75e13 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Tue, 10 May 2022 16:27:46 -0700 Subject: [PATCH 27/29] Add regression test for #46192 (#49057) --- src/harness/fourslashInterfaceImpl.ts | 4 +- .../autoImportPathsAliasesAndBarrels.ts | 59 +++++++++++++++++++ tests/cases/fourslash/fourslash.ts | 2 +- 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 tests/cases/fourslash/autoImportPathsAliasesAndBarrels.ts diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index 6eb4414df25..a4412ca8826 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -404,8 +404,8 @@ namespace FourSlashInterface { this.state.baselineSignatureHelp(); } - public baselineCompletions() { - this.state.baselineCompletions(); + public baselineCompletions(preferences?: ts.UserPreferences) { + this.state.baselineCompletions(preferences); } public baselineSmartSelection() { diff --git a/tests/cases/fourslash/autoImportPathsAliasesAndBarrels.ts b/tests/cases/fourslash/autoImportPathsAliasesAndBarrels.ts new file mode 100644 index 00000000000..3225645cbfb --- /dev/null +++ b/tests/cases/fourslash/autoImportPathsAliasesAndBarrels.ts @@ -0,0 +1,59 @@ +/// + +// @Filename: /tsconfig.json +//// { +//// "compilerOptions": { +//// "module": "commonjs", +//// "paths": { +//// "~/*": ["src/*"] +//// } +//// } +////} + +// @Filename: /src/dirA/index.ts +//// export * from "./thing1A"; +//// export * from "./thing2A"; + +// @Filename: /src/dirA/thing1A.ts +//// export class Thing1A {} +//// Thing/**/ + +// @Filename: /src/dirA/thing2A.ts +//// export class Thing2A {} + +// @Filename: /src/dirB/index.ts +//// export * from "./thing1B"; +//// export * from "./thing2B"; + +// @Filename: /src/dirB/thing1B.ts +//// export class Thing1B {} + +// @Filename: /src/dirB/thing2B.ts +//// export class Thing2B {} + +verify.completions({ + marker: "", + includes: [{ + name: "Thing2A", + source: "./thing2A", + sourceDisplay: "./thing2A", + hasAction: true, + sortText: completion.SortText.AutoImportSuggestions, + }, { + name: "Thing1B", + source: "~/dirB", + sourceDisplay: "~/dirB", + hasAction: true, + sortText: completion.SortText.AutoImportSuggestions, + }, { + name: "Thing2B", + source: "~/dirB", + sourceDisplay: "~/dirB", + hasAction: true, + sortText: completion.SortText.AutoImportSuggestions, + }], + preferences: { + includeCompletionsForModuleExports: true, + allowIncompleteCompletions: true, + }, +}); diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 93aca2cfb1f..79e0f52cb58 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -349,7 +349,7 @@ declare namespace FourSlashInterface { baselineSyntacticDiagnostics(): void; baselineSyntacticAndSemanticDiagnostics(): void; getEmitOutput(expectedOutputFiles: ReadonlyArray): void; - baselineCompletions(): void; + baselineCompletions(preferences?: UserPreferences): void; baselineQuickInfo(): void; baselineSmartSelection(): void; baselineSignatureHelp(): void; From 7a3c31f9f92f7c4bad69aef92a307203eada714f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 11 May 2022 00:07:29 +0000 Subject: [PATCH 28/29] Accepted es2020Intl baseline. --- tests/baselines/reference/es2020IntlAPIs.errors.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/baselines/reference/es2020IntlAPIs.errors.txt b/tests/baselines/reference/es2020IntlAPIs.errors.txt index 95b447d43f1..cdd0156581a 100644 --- a/tests/baselines/reference/es2020IntlAPIs.errors.txt +++ b/tests/baselines/reference/es2020IntlAPIs.errors.txt @@ -53,22 +53,22 @@ tests/cases/conformance/es2020/es2020IntlAPIs.ts(50,29): error TS2345: Argument new Intl.Locale(); // should error ~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1-2 arguments, but got 0. -!!! related TS6210 /.ts/lib.es2020.intl.d.ts:311:14: An argument for 'tag' was not provided. +!!! related TS6210 /.ts/lib.es2020.intl.d.ts:335:14: An argument for 'tag' was not provided. new Intl.Locale(new Intl.Locale('en-US')); new Intl.DisplayNames(); // TypeError: invalid_argument ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 0. -!!! related TS6210 /.ts/lib.es2020.intl.d.ts:390:13: An argument for 'locales' was not provided. +!!! related TS6210 /.ts/lib.es2020.intl.d.ts:414:13: An argument for 'locales' was not provided. new Intl.DisplayNames('en'); // TypeError: invalid_argument ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. -!!! related TS6210 /.ts/lib.es2020.intl.d.ts:390:39: An argument for 'options' was not provided. +!!! related TS6210 /.ts/lib.es2020.intl.d.ts:414:39: An argument for 'options' was not provided. new Intl.DisplayNames('en', {}); // TypeError: invalid_argument ~~ !!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'DisplayNamesOptions'. !!! error TS2345: Property 'type' is missing in type '{}' but required in type 'DisplayNamesOptions'. -!!! related TS2728 /.ts/lib.es2020.intl.d.ts:333:9: 'type' is declared here. +!!! related TS2728 /.ts/lib.es2020.intl.d.ts:357:9: 'type' is declared here. console.log((new Intl.DisplayNames(undefined, {type: 'language'})).of('en-GB')); // "British English" const localesArg = ["es-ES", new Intl.Locale("en-US")]; From cfbb517f357b7f33a2c896346d4e64d2f1ae16a8 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 11 May 2022 06:07:52 +0000 Subject: [PATCH 29/29] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 48355a16ece..1e7fd508fb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -638,9 +638,9 @@ "dev": true }, "@types/node": { - "version": "17.0.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz", - "integrity": "sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==", + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.32.tgz", + "integrity": "sha512-eAIcfAvhf/BkHcf4pkLJ7ECpBAhh9kcxRBpip9cTiO+hf+aJrsxYxBeS6OXvOd9WqNAJmavXVpZvY1rBjNsXmw==", "dev": true }, "@types/node-fetch": {