typescript 4.5.3 → 4.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.5";
72
- ts.version = "4.5.3";
72
+ ts.version = "4.5.4";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
package/lib/tsserver.js CHANGED
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = "4.5.3";
103
+ ts.version = "4.5.4";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -128608,8 +128608,24 @@ var ts;
128608
128608
  source = CompletionSource.ClassMemberSnippet;
128609
128609
  }
128610
128610
  }
128611
+ // Before offering up a JSX attribute snippet, ensure that we aren't potentially completing
128612
+ // a tag name; this may appear as an attribute after the "<" when the tag has not yet been
128613
+ // closed, as in:
128614
+ //
128615
+ // return <>
128616
+ // foo <butto|
128617
+ // </>
128618
+ //
128619
+ // We can detect this case by checking if both:
128620
+ //
128621
+ // 1. The location is "<", so we are completing immediately after it.
128622
+ // 2. The "<" has the same position as its parent, so is not a binary expression.
128611
128623
  var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location);
128612
- if (kind === "JSX attribute" /* jsxAttribute */ && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
128624
+ if (kind === "JSX attribute" /* jsxAttribute */
128625
+ && (location.kind !== 29 /* LessThanToken */ || location.pos !== location.parent.pos)
128626
+ && preferences.includeCompletionsWithSnippetText
128627
+ && preferences.jsxAttributeCompletionStyle
128628
+ && preferences.jsxAttributeCompletionStyle !== "none") {
128613
128629
  var useBraces_1 = preferences.jsxAttributeCompletionStyle === "braces";
128614
128630
  var type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
128615
128631
  // If is boolean like or undefined, don't return a snippet we want just to return the completion.
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = "4.5.3";
297
+ ts.version = "4.5.4";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -129190,8 +129190,24 @@ var ts;
129190
129190
  source = CompletionSource.ClassMemberSnippet;
129191
129191
  }
129192
129192
  }
129193
+ // Before offering up a JSX attribute snippet, ensure that we aren't potentially completing
129194
+ // a tag name; this may appear as an attribute after the "<" when the tag has not yet been
129195
+ // closed, as in:
129196
+ //
129197
+ // return <>
129198
+ // foo <butto|
129199
+ // </>
129200
+ //
129201
+ // We can detect this case by checking if both:
129202
+ //
129203
+ // 1. The location is "<", so we are completing immediately after it.
129204
+ // 2. The "<" has the same position as its parent, so is not a binary expression.
129193
129205
  var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location);
129194
- if (kind === "JSX attribute" /* jsxAttribute */ && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
129206
+ if (kind === "JSX attribute" /* jsxAttribute */
129207
+ && (location.kind !== 29 /* LessThanToken */ || location.pos !== location.parent.pos)
129208
+ && preferences.includeCompletionsWithSnippetText
129209
+ && preferences.jsxAttributeCompletionStyle
129210
+ && preferences.jsxAttributeCompletionStyle !== "none") {
129195
129211
  var useBraces_1 = preferences.jsxAttributeCompletionStyle === "braces";
129196
129212
  var type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
129197
129213
  // If is boolean like or undefined, don't return a snippet we want just to return the completion.
package/lib/typescript.js CHANGED
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = "4.5.3";
297
+ ts.version = "4.5.4";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -129190,8 +129190,24 @@ var ts;
129190
129190
  source = CompletionSource.ClassMemberSnippet;
129191
129191
  }
129192
129192
  }
129193
+ // Before offering up a JSX attribute snippet, ensure that we aren't potentially completing
129194
+ // a tag name; this may appear as an attribute after the "<" when the tag has not yet been
129195
+ // closed, as in:
129196
+ //
129197
+ // return <>
129198
+ // foo <butto|
129199
+ // </>
129200
+ //
129201
+ // We can detect this case by checking if both:
129202
+ //
129203
+ // 1. The location is "<", so we are completing immediately after it.
129204
+ // 2. The "<" has the same position as its parent, so is not a binary expression.
129193
129205
  var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location);
129194
- if (kind === "JSX attribute" /* jsxAttribute */ && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
129206
+ if (kind === "JSX attribute" /* jsxAttribute */
129207
+ && (location.kind !== 29 /* LessThanToken */ || location.pos !== location.parent.pos)
129208
+ && preferences.includeCompletionsWithSnippetText
129209
+ && preferences.jsxAttributeCompletionStyle
129210
+ && preferences.jsxAttributeCompletionStyle !== "none") {
129195
129211
  var useBraces_1 = preferences.jsxAttributeCompletionStyle === "braces";
129196
129212
  var type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
129197
129213
  // If is boolean like or undefined, don't return a snippet we want just to return the completion.
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = "4.5.3";
297
+ ts.version = "4.5.4";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -129190,8 +129190,24 @@ var ts;
129190
129190
  source = CompletionSource.ClassMemberSnippet;
129191
129191
  }
129192
129192
  }
129193
+ // Before offering up a JSX attribute snippet, ensure that we aren't potentially completing
129194
+ // a tag name; this may appear as an attribute after the "<" when the tag has not yet been
129195
+ // closed, as in:
129196
+ //
129197
+ // return <>
129198
+ // foo <butto|
129199
+ // </>
129200
+ //
129201
+ // We can detect this case by checking if both:
129202
+ //
129203
+ // 1. The location is "<", so we are completing immediately after it.
129204
+ // 2. The "<" has the same position as its parent, so is not a binary expression.
129193
129205
  var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location);
129194
- if (kind === "JSX attribute" /* jsxAttribute */ && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
129206
+ if (kind === "JSX attribute" /* jsxAttribute */
129207
+ && (location.kind !== 29 /* LessThanToken */ || location.pos !== location.parent.pos)
129208
+ && preferences.includeCompletionsWithSnippetText
129209
+ && preferences.jsxAttributeCompletionStyle
129210
+ && preferences.jsxAttributeCompletionStyle !== "none") {
129195
129211
  var useBraces_1 = preferences.jsxAttributeCompletionStyle === "braces";
129196
129212
  var type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
129197
129213
  // If is boolean like or undefined, don't return a snippet we want just to return the completion.
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = "4.5.3";
92
+ ts.version = "4.5.4";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.5.3",
5
+ "version": "4.5.4",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [