typescript 5.2.1-rc → 5.2.2

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
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.2";
21
- var version = "5.2.1-rc";
21
+ var version = "5.2.2";
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
package/lib/tsserver.js CHANGED
@@ -2331,7 +2331,7 @@ module.exports = __toCommonJS(server_exports);
2331
2331
 
2332
2332
  // src/compiler/corePublic.ts
2333
2333
  var versionMajorMinor = "5.2";
2334
- var version = "5.2.1-rc";
2334
+ var version = "5.2.2";
2335
2335
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2336
2336
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2337
2337
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -164760,11 +164760,11 @@ function provideInlayHints(context) {
164760
164760
  function isSignatureSupportingReturnAnnotation(node) {
164761
164761
  return isArrowFunction(node) || isFunctionExpression(node) || isFunctionDeclaration(node) || isMethodDeclaration(node) || isGetAccessorDeclaration(node);
164762
164762
  }
164763
- function addParameterHints(text, parameter, position, isFirstVariadicArgument, sourceFile) {
164763
+ function addParameterHints(text, parameter, position, isFirstVariadicArgument) {
164764
164764
  let hintText = `${isFirstVariadicArgument ? "..." : ""}${text}`;
164765
164765
  let displayParts;
164766
164766
  if (shouldUseInteractiveInlayHints(preferences)) {
164767
- displayParts = [getNodeDisplayPart(hintText, parameter, sourceFile), { text: ":" }];
164767
+ displayParts = [getNodeDisplayPart(hintText, parameter), { text: ":" }];
164768
164768
  hintText = "";
164769
164769
  } else {
164770
164770
  hintText += ":";
@@ -164837,7 +164837,6 @@ function provideInlayHints(context) {
164837
164837
  return;
164838
164838
  }
164839
164839
  let signatureParamPos = 0;
164840
- const sourceFile = shouldUseInteractiveInlayHints(preferences) ? expr.getSourceFile() : void 0;
164841
164840
  for (const originalArg of args) {
164842
164841
  const arg = skipParentheses(originalArg);
164843
164842
  if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
@@ -164870,7 +164869,7 @@ function provideInlayHints(context) {
164870
164869
  if (leadingCommentsContainsParameterName(arg, name)) {
164871
164870
  continue;
164872
164871
  }
164873
- addParameterHints(name, parameter, originalArg.getStart(), isFirstVariadicArgument, sourceFile);
164872
+ addParameterHints(name, parameter, originalArg.getStart(), isFirstVariadicArgument);
164874
164873
  }
164875
164874
  }
164876
164875
  }
@@ -165006,7 +165005,8 @@ function provideInlayHints(context) {
165006
165005
  }
165007
165006
  return true;
165008
165007
  }
165009
- function getNodeDisplayPart(text, node, sourceFile) {
165008
+ function getNodeDisplayPart(text, node) {
165009
+ const sourceFile = node.getSourceFile();
165010
165010
  return {
165011
165011
  text,
165012
165012
  span: createTextSpanFromNode(node, sourceFile),
@@ -183666,14 +183666,22 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
183666
183666
  return {
183667
183667
  ...hint,
183668
183668
  position: scriptInfo.positionToLineOffset(position),
183669
- displayParts: displayParts == null ? void 0 : displayParts.map(({ text, span, file: file2 }) => ({
183670
- text,
183671
- span: span && {
183672
- start: scriptInfo.positionToLineOffset(span.start),
183673
- end: scriptInfo.positionToLineOffset(span.start + span.length),
183674
- file: file2
183669
+ displayParts: displayParts == null ? void 0 : displayParts.map(({ text, span, file: file2 }) => {
183670
+ if (span) {
183671
+ Debug.assertIsDefined(file2, "Target file should be defined together with its span.");
183672
+ const scriptInfo2 = this.projectService.getScriptInfo(file2);
183673
+ return {
183674
+ text,
183675
+ span: {
183676
+ start: scriptInfo2.positionToLineOffset(span.start),
183677
+ end: scriptInfo2.positionToLineOffset(span.start + span.length),
183678
+ file: file2
183679
+ }
183680
+ };
183681
+ } else {
183682
+ return { text };
183675
183683
  }
183676
- }))
183684
+ })
183677
183685
  };
183678
183686
  });
183679
183687
  }
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = "5.2.1-rc";
38
+ version = "5.2.2";
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -164108,11 +164108,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164108
164108
  function isSignatureSupportingReturnAnnotation(node) {
164109
164109
  return isArrowFunction(node) || isFunctionExpression(node) || isFunctionDeclaration(node) || isMethodDeclaration(node) || isGetAccessorDeclaration(node);
164110
164110
  }
164111
- function addParameterHints(text, parameter, position, isFirstVariadicArgument, sourceFile) {
164111
+ function addParameterHints(text, parameter, position, isFirstVariadicArgument) {
164112
164112
  let hintText = `${isFirstVariadicArgument ? "..." : ""}${text}`;
164113
164113
  let displayParts;
164114
164114
  if (shouldUseInteractiveInlayHints(preferences)) {
164115
- displayParts = [getNodeDisplayPart(hintText, parameter, sourceFile), { text: ":" }];
164115
+ displayParts = [getNodeDisplayPart(hintText, parameter), { text: ":" }];
164116
164116
  hintText = "";
164117
164117
  } else {
164118
164118
  hintText += ":";
@@ -164185,7 +164185,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164185
164185
  return;
164186
164186
  }
164187
164187
  let signatureParamPos = 0;
164188
- const sourceFile = shouldUseInteractiveInlayHints(preferences) ? expr.getSourceFile() : void 0;
164189
164188
  for (const originalArg of args) {
164190
164189
  const arg = skipParentheses(originalArg);
164191
164190
  if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
@@ -164218,7 +164217,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164218
164217
  if (leadingCommentsContainsParameterName(arg, name)) {
164219
164218
  continue;
164220
164219
  }
164221
- addParameterHints(name, parameter, originalArg.getStart(), isFirstVariadicArgument, sourceFile);
164220
+ addParameterHints(name, parameter, originalArg.getStart(), isFirstVariadicArgument);
164222
164221
  }
164223
164222
  }
164224
164223
  }
@@ -164354,7 +164353,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164354
164353
  }
164355
164354
  return true;
164356
164355
  }
164357
- function getNodeDisplayPart(text, node, sourceFile) {
164356
+ function getNodeDisplayPart(text, node) {
164357
+ const sourceFile = node.getSourceFile();
164358
164358
  return {
164359
164359
  text,
164360
164360
  span: createTextSpanFromNode(node, sourceFile),
@@ -181073,14 +181073,22 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
181073
181073
  return {
181074
181074
  ...hint,
181075
181075
  position: scriptInfo.positionToLineOffset(position),
181076
- displayParts: displayParts == null ? void 0 : displayParts.map(({ text, span, file: file2 }) => ({
181077
- text,
181078
- span: span && {
181079
- start: scriptInfo.positionToLineOffset(span.start),
181080
- end: scriptInfo.positionToLineOffset(span.start + span.length),
181081
- file: file2
181076
+ displayParts: displayParts == null ? void 0 : displayParts.map(({ text, span, file: file2 }) => {
181077
+ if (span) {
181078
+ Debug.assertIsDefined(file2, "Target file should be defined together with its span.");
181079
+ const scriptInfo2 = this.projectService.getScriptInfo(file2);
181080
+ return {
181081
+ text,
181082
+ span: {
181083
+ start: scriptInfo2.positionToLineOffset(span.start),
181084
+ end: scriptInfo2.positionToLineOffset(span.start + span.length),
181085
+ file: file2
181086
+ }
181087
+ };
181088
+ } else {
181089
+ return { text };
181082
181090
  }
181083
- }))
181091
+ })
181084
181092
  };
181085
181093
  });
181086
181094
  }
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = "5.2.1-rc";
38
+ version = "5.2.2";
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -164123,11 +164123,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164123
164123
  function isSignatureSupportingReturnAnnotation(node) {
164124
164124
  return isArrowFunction(node) || isFunctionExpression(node) || isFunctionDeclaration(node) || isMethodDeclaration(node) || isGetAccessorDeclaration(node);
164125
164125
  }
164126
- function addParameterHints(text, parameter, position, isFirstVariadicArgument, sourceFile) {
164126
+ function addParameterHints(text, parameter, position, isFirstVariadicArgument) {
164127
164127
  let hintText = `${isFirstVariadicArgument ? "..." : ""}${text}`;
164128
164128
  let displayParts;
164129
164129
  if (shouldUseInteractiveInlayHints(preferences)) {
164130
- displayParts = [getNodeDisplayPart(hintText, parameter, sourceFile), { text: ":" }];
164130
+ displayParts = [getNodeDisplayPart(hintText, parameter), { text: ":" }];
164131
164131
  hintText = "";
164132
164132
  } else {
164133
164133
  hintText += ":";
@@ -164200,7 +164200,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164200
164200
  return;
164201
164201
  }
164202
164202
  let signatureParamPos = 0;
164203
- const sourceFile = shouldUseInteractiveInlayHints(preferences) ? expr.getSourceFile() : void 0;
164204
164203
  for (const originalArg of args) {
164205
164204
  const arg = skipParentheses(originalArg);
164206
164205
  if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
@@ -164233,7 +164232,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164233
164232
  if (leadingCommentsContainsParameterName(arg, name)) {
164234
164233
  continue;
164235
164234
  }
164236
- addParameterHints(name, parameter, originalArg.getStart(), isFirstVariadicArgument, sourceFile);
164235
+ addParameterHints(name, parameter, originalArg.getStart(), isFirstVariadicArgument);
164237
164236
  }
164238
164237
  }
164239
164238
  }
@@ -164369,7 +164368,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164369
164368
  }
164370
164369
  return true;
164371
164370
  }
164372
- function getNodeDisplayPart(text, node, sourceFile) {
164371
+ function getNodeDisplayPart(text, node) {
164372
+ const sourceFile = node.getSourceFile();
164373
164373
  return {
164374
164374
  text,
164375
164375
  span: createTextSpanFromNode(node, sourceFile),
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.2";
57
- var version = "5.2.1-rc";
57
+ var version = "5.2.2";
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
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": "5.2.1-rc",
5
+ "version": "5.2.2",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [