From 1bc124e6359d8e7fa54206c8b58d324bd8b80beb Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Sat, 11 Dec 2021 00:10:14 +0000 Subject: [PATCH] Bump version to 4.5.4 and LKG --- lib/tsc.js | 2 +- lib/tsserver.js | 20 ++++++++++++++++++-- lib/tsserverlibrary.js | 20 ++++++++++++++++++-- lib/typescript.js | 20 ++++++++++++++++++-- lib/typescriptServices.js | 20 ++++++++++++++++++-- lib/typingsInstaller.js | 2 +- package.json | 2 +- src/compiler/corePublic.ts | 2 +- 8 files changed, 76 insertions(+), 12 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index b90a4e1040638..e843aa1776411 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { var ts; (function (ts) { ts.versionMajorMinor = "4.5"; - ts.version = "4.5.3"; + ts.version = "4.5.4"; var NativeCollections; (function (NativeCollections) { function tryGetNativeMap() { diff --git a/lib/tsserver.js b/lib/tsserver.js index 76c93ce018da3..028346841ea0d 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -100,7 +100,7 @@ var ts; // 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 - ts.version = "4.5.3"; + ts.version = "4.5.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -128608,8 +128608,24 @@ var ts; source = CompletionSource.ClassMemberSnippet; } } + // Before offering up a JSX attribute snippet, ensure that we aren't potentially completing + // a tag name; this may appear as an attribute after the "<" when the tag has not yet been + // closed, as in: + // + // return <> + // foo + // + // We can detect this case by checking if both: + // + // 1. The location is "<", so we are completing immediately after it. + // 2. The "<" has the same position as its parent, so is not a binary expression. var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location); - if (kind === "JSX attribute" /* jsxAttribute */ && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") { + if (kind === "JSX attribute" /* jsxAttribute */ + && (location.kind !== 29 /* LessThanToken */ || location.pos !== location.parent.pos) + && preferences.includeCompletionsWithSnippetText + && preferences.jsxAttributeCompletionStyle + && preferences.jsxAttributeCompletionStyle !== "none") { var useBraces_1 = preferences.jsxAttributeCompletionStyle === "braces"; var type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); // If is boolean like or undefined, don't return a snippet we want just to return the completion. diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 78e20898bdfb9..1db4e4a0467ca 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -294,7 +294,7 @@ var ts; // 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 - ts.version = "4.5.3"; + ts.version = "4.5.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -129190,8 +129190,24 @@ var ts; source = CompletionSource.ClassMemberSnippet; } } + // Before offering up a JSX attribute snippet, ensure that we aren't potentially completing + // a tag name; this may appear as an attribute after the "<" when the tag has not yet been + // closed, as in: + // + // return <> + // foo + // + // We can detect this case by checking if both: + // + // 1. The location is "<", so we are completing immediately after it. + // 2. The "<" has the same position as its parent, so is not a binary expression. var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location); - if (kind === "JSX attribute" /* jsxAttribute */ && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") { + if (kind === "JSX attribute" /* jsxAttribute */ + && (location.kind !== 29 /* LessThanToken */ || location.pos !== location.parent.pos) + && preferences.includeCompletionsWithSnippetText + && preferences.jsxAttributeCompletionStyle + && preferences.jsxAttributeCompletionStyle !== "none") { var useBraces_1 = preferences.jsxAttributeCompletionStyle === "braces"; var type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); // If is boolean like or undefined, don't return a snippet we want just to return the completion. diff --git a/lib/typescript.js b/lib/typescript.js index 6b649f9a34a6b..cc9dd7d8363ac 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -294,7 +294,7 @@ var ts; // 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 - ts.version = "4.5.3"; + ts.version = "4.5.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -129190,8 +129190,24 @@ var ts; source = CompletionSource.ClassMemberSnippet; } } + // Before offering up a JSX attribute snippet, ensure that we aren't potentially completing + // a tag name; this may appear as an attribute after the "<" when the tag has not yet been + // closed, as in: + // + // return <> + // foo + // + // We can detect this case by checking if both: + // + // 1. The location is "<", so we are completing immediately after it. + // 2. The "<" has the same position as its parent, so is not a binary expression. var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location); - if (kind === "JSX attribute" /* jsxAttribute */ && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") { + if (kind === "JSX attribute" /* jsxAttribute */ + && (location.kind !== 29 /* LessThanToken */ || location.pos !== location.parent.pos) + && preferences.includeCompletionsWithSnippetText + && preferences.jsxAttributeCompletionStyle + && preferences.jsxAttributeCompletionStyle !== "none") { var useBraces_1 = preferences.jsxAttributeCompletionStyle === "braces"; var type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); // If is boolean like or undefined, don't return a snippet we want just to return the completion. diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 92e96e7957e39..1f85972b8f1ec 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -294,7 +294,7 @@ var ts; // 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 - ts.version = "4.5.3"; + ts.version = "4.5.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -129190,8 +129190,24 @@ var ts; source = CompletionSource.ClassMemberSnippet; } } + // Before offering up a JSX attribute snippet, ensure that we aren't potentially completing + // a tag name; this may appear as an attribute after the "<" when the tag has not yet been + // closed, as in: + // + // return <> + // foo + // + // We can detect this case by checking if both: + // + // 1. The location is "<", so we are completing immediately after it. + // 2. The "<" has the same position as its parent, so is not a binary expression. var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location); - if (kind === "JSX attribute" /* jsxAttribute */ && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") { + if (kind === "JSX attribute" /* jsxAttribute */ + && (location.kind !== 29 /* LessThanToken */ || location.pos !== location.parent.pos) + && preferences.includeCompletionsWithSnippetText + && preferences.jsxAttributeCompletionStyle + && preferences.jsxAttributeCompletionStyle !== "none") { var useBraces_1 = preferences.jsxAttributeCompletionStyle === "braces"; var type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); // If is boolean like or undefined, don't return a snippet we want just to return the completion. diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 033d5341f111b..17e9323ed0622 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -89,7 +89,7 @@ var ts; // 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 - ts.version = "4.5.3"; + ts.version = "4.5.4"; /* @internal */ var Comparison; (function (Comparison) { diff --git a/package.json b/package.json index 2d49734bf82a2..84cb41b008415 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "4.5.3", + "version": "4.5.4", "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 0ee3f7e1b4ea0..b25b8191eda34 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -5,7 +5,7 @@ namespace ts { // 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 - export const version = "4.5.3" as string; + export const version = "4.5.4" as string; /** * Type of objects whose values are all of the same type.