From 0255adc4076b7b963e2db2b0c8bba4e330fbfd01 Mon Sep 17 00:00:00 2001 From: Herrington Darkholme Date: Tue, 8 Aug 2017 10:08:48 +0800 Subject: [PATCH 1/3] fix #16567: better coloring on light theme terminal --- src/compiler/program.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 64e8eb0c80..db83f74025 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -243,7 +243,7 @@ namespace ts { const redForegroundEscapeSequence = "\u001b[91m"; const yellowForegroundEscapeSequence = "\u001b[93m"; const blueForegroundEscapeSequence = "\u001b[93m"; - const gutterStyleSequence = "\u001b[100;30m"; + const gutterStyleSequence = "\u001b[30;47m"; const gutterSeparator = " "; const resetEscapeSequence = "\u001b[0m"; const ellipsis = "..."; From 508cde0ea12a86668d8c893a0356cf2c7320619a Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 7 Sep 2017 12:39:13 -0700 Subject: [PATCH 2/3] Document assignment to aliasSymbol in getUnionTypeFromSortedList (#17434) * Document assignment to aliasSymbol in getUnionTypeFromSortedList * Update wording --- src/compiler/checker.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 91653c140c..8547fc7e17 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7435,6 +7435,12 @@ namespace ts { type = createType(TypeFlags.Union | propagatedFlags); unionTypes.set(id, type); type.types = types; + /* + Note: This is the alias symbol (or lack thereof) that we see when we first encounter this union type. + For aliases of identical unions, eg `type T = A | B; type U = A | B`, the symbol of the first alias encountered is the aliasSymbol. + (In the language service, the order may depend on the order in which a user takes actions, such as hovering over symbols.) + It's important that we create equivalent union types only once, so that's an unfortunate side effect. + */ type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; } @@ -7528,7 +7534,7 @@ namespace ts { type = createType(TypeFlags.Intersection | propagatedFlags); intersectionTypes.set(id, type); type.types = typeSet; - type.aliasSymbol = aliasSymbol; + type.aliasSymbol = aliasSymbol; // See comment in `getUnionTypeFromSortedList`. type.aliasTypeArguments = aliasTypeArguments; } return type; From 1b5a0aed93f617d63627cb6d7c5c104d4f4dfdc9 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 7 Sep 2017 12:47:09 -0700 Subject: [PATCH 3/3] Update pretty baseline changed by #17675 (#18320) --- .../reference/prettyContextNotDebugAssertion.errors.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/baselines/reference/prettyContextNotDebugAssertion.errors.txt b/tests/baselines/reference/prettyContextNotDebugAssertion.errors.txt index 7b7e3fea3e..9cac1423f3 100644 --- a/tests/baselines/reference/prettyContextNotDebugAssertion.errors.txt +++ b/tests/baselines/reference/prettyContextNotDebugAssertion.errors.txt @@ -1,6 +1,6 @@ -2 -   +2 +   tests/cases/compiler/index.ts(2,1): error TS1005: '}' expected.