typescript 5.5.0-dev.20240307 → 5.5.0-dev.20240308

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.5";
21
- var version = `${versionMajorMinor}.0-dev.20240307`;
21
+ var version = `${versionMajorMinor}.0-dev.20240308`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -7554,6 +7554,7 @@ var Diagnostics = {
7554
7554
  Update_import_from_0: diag(90058, 3 /* Message */, "Update_import_from_0_90058", 'Update import from "{0}"'),
7555
7555
  Export_0_from_module_1: diag(90059, 3 /* Message */, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
7556
7556
  Export_all_referenced_locals: diag(90060, 3 /* Message */, "Export_all_referenced_locals_90060", "Export all referenced locals"),
7557
+ Update_modifiers_of_0: diag(90061, 3 /* Message */, "Update_modifiers_of_0_90061", "Update modifiers of '{0}'"),
7557
7558
  Convert_function_to_an_ES2015_class: diag(95001, 3 /* Message */, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
7558
7559
  Convert_0_to_1_in_0: diag(95003, 3 /* Message */, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
7559
7560
  Extract_to_0_in_1: diag(95004, 3 /* Message */, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
package/lib/tsserver.js CHANGED
@@ -2325,7 +2325,7 @@ module.exports = __toCommonJS(server_exports);
2325
2325
 
2326
2326
  // src/compiler/corePublic.ts
2327
2327
  var versionMajorMinor = "5.5";
2328
- var version = `${versionMajorMinor}.0-dev.20240307`;
2328
+ var version = `${versionMajorMinor}.0-dev.20240308`;
2329
2329
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2330
2330
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2331
2331
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -11100,6 +11100,7 @@ var Diagnostics = {
11100
11100
  Update_import_from_0: diag(90058, 3 /* Message */, "Update_import_from_0_90058", 'Update import from "{0}"'),
11101
11101
  Export_0_from_module_1: diag(90059, 3 /* Message */, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
11102
11102
  Export_all_referenced_locals: diag(90060, 3 /* Message */, "Export_all_referenced_locals_90060", "Export all referenced locals"),
11103
+ Update_modifiers_of_0: diag(90061, 3 /* Message */, "Update_modifiers_of_0_90061", "Update modifiers of '{0}'"),
11103
11104
  Convert_function_to_an_ES2015_class: diag(95001, 3 /* Message */, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
11104
11105
  Convert_0_to_1_in_0: diag(95003, 3 /* Message */, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
11105
11106
  Extract_to_0_in_1: diag(95004, 3 /* Message */, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
@@ -158504,10 +158505,21 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
158504
158505
  }
158505
158506
  if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
158506
158507
  let importAdder;
158507
- const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
158508
+ const memberCompletionEntry = getEntryForMemberCompletion(
158509
+ host,
158510
+ program,
158511
+ options,
158512
+ preferences,
158513
+ name,
158514
+ symbol,
158515
+ location,
158516
+ position,
158517
+ contextToken,
158518
+ formatContext
158519
+ );
158508
158520
  if (memberCompletionEntry) {
158509
158521
  ({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
158510
- if (importAdder == null ? void 0 : importAdder.hasFixes()) {
158522
+ if ((importAdder == null ? void 0 : importAdder.hasFixes()) || memberCompletionEntry.eraseRange) {
158511
158523
  hasAction = true;
158512
158524
  source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
158513
158525
  }
@@ -158704,19 +158716,22 @@ function getPresentModifiers(contextToken, sourceFile, position) {
158704
158716
  let decorators;
158705
158717
  let contextMod;
158706
158718
  const range = { pos: position, end: position };
158707
- if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) {
158708
- modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303 /* Modifier */;
158709
- decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
158710
- range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos);
158711
- }
158712
- if (contextMod = isModifierLike2(contextToken)) {
158719
+ if (isPropertyDeclaration(contextToken.parent) && (contextMod = isModifierLike2(contextToken))) {
158720
+ if (contextToken.parent.modifiers) {
158721
+ modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303 /* Modifier */;
158722
+ decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
158723
+ range.pos = Math.min(...contextToken.parent.modifiers.map((n) => n.getStart(sourceFile)));
158724
+ }
158713
158725
  const contextModifierFlag = modifierToFlag(contextMod);
158714
158726
  if (!(modifiers & contextModifierFlag)) {
158715
158727
  modifiers |= contextModifierFlag;
158716
- range.pos = Math.min(range.pos, contextToken.pos);
158728
+ range.pos = Math.min(range.pos, contextToken.getStart(sourceFile));
158729
+ }
158730
+ if (contextToken.parent.name !== contextToken) {
158731
+ range.end = contextToken.parent.name.getStart(sourceFile);
158717
158732
  }
158718
158733
  }
158719
- return { modifiers, decorators, range: range.pos !== position ? range : void 0 };
158734
+ return { modifiers, decorators, range: range.pos < range.end ? range : void 0 };
158720
158735
  }
158721
158736
  function isModifierLike2(node) {
158722
158737
  if (isModifier(node)) {
@@ -159358,7 +159373,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
159358
159373
  contextToken,
159359
159374
  formatContext
159360
159375
  );
159361
- if (importAdder || eraseRange) {
159376
+ if ((importAdder == null ? void 0 : importAdder.hasFixes()) || eraseRange) {
159362
159377
  const changes = ts_textChanges_exports.ChangeTracker.with(
159363
159378
  { host, formatContext, preferences },
159364
159379
  (tracker) => {
@@ -159374,7 +159389,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
159374
159389
  sourceDisplay: void 0,
159375
159390
  codeActions: [{
159376
159391
  changes,
159377
- description: diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name])
159392
+ description: (importAdder == null ? void 0 : importAdder.hasFixes()) ? diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name]) : diagnosticToString([Diagnostics.Update_modifiers_of_0, name])
159378
159393
  }]
159379
159394
  };
159380
159395
  }
package/lib/typescript.js CHANGED
@@ -2325,7 +2325,7 @@ module.exports = __toCommonJS(typescript_exports);
2325
2325
 
2326
2326
  // src/compiler/corePublic.ts
2327
2327
  var versionMajorMinor = "5.5";
2328
- var version = `${versionMajorMinor}.0-dev.20240307`;
2328
+ var version = `${versionMajorMinor}.0-dev.20240308`;
2329
2329
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2330
2330
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2331
2331
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -11100,6 +11100,7 @@ var Diagnostics = {
11100
11100
  Update_import_from_0: diag(90058, 3 /* Message */, "Update_import_from_0_90058", 'Update import from "{0}"'),
11101
11101
  Export_0_from_module_1: diag(90059, 3 /* Message */, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
11102
11102
  Export_all_referenced_locals: diag(90060, 3 /* Message */, "Export_all_referenced_locals_90060", "Export all referenced locals"),
11103
+ Update_modifiers_of_0: diag(90061, 3 /* Message */, "Update_modifiers_of_0_90061", "Update modifiers of '{0}'"),
11103
11104
  Convert_function_to_an_ES2015_class: diag(95001, 3 /* Message */, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
11104
11105
  Convert_0_to_1_in_0: diag(95003, 3 /* Message */, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
11105
11106
  Extract_to_0_in_1: diag(95004, 3 /* Message */, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
@@ -158504,10 +158505,21 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
158504
158505
  }
158505
158506
  if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
158506
158507
  let importAdder;
158507
- const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
158508
+ const memberCompletionEntry = getEntryForMemberCompletion(
158509
+ host,
158510
+ program,
158511
+ options,
158512
+ preferences,
158513
+ name,
158514
+ symbol,
158515
+ location,
158516
+ position,
158517
+ contextToken,
158518
+ formatContext
158519
+ );
158508
158520
  if (memberCompletionEntry) {
158509
158521
  ({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
158510
- if (importAdder == null ? void 0 : importAdder.hasFixes()) {
158522
+ if ((importAdder == null ? void 0 : importAdder.hasFixes()) || memberCompletionEntry.eraseRange) {
158511
158523
  hasAction = true;
158512
158524
  source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
158513
158525
  }
@@ -158704,19 +158716,22 @@ function getPresentModifiers(contextToken, sourceFile, position) {
158704
158716
  let decorators;
158705
158717
  let contextMod;
158706
158718
  const range = { pos: position, end: position };
158707
- if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) {
158708
- modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303 /* Modifier */;
158709
- decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
158710
- range.pos = Math.min(range.pos, contextToken.parent.modifiers.pos);
158711
- }
158712
- if (contextMod = isModifierLike2(contextToken)) {
158719
+ if (isPropertyDeclaration(contextToken.parent) && (contextMod = isModifierLike2(contextToken))) {
158720
+ if (contextToken.parent.modifiers) {
158721
+ modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303 /* Modifier */;
158722
+ decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
158723
+ range.pos = Math.min(...contextToken.parent.modifiers.map((n) => n.getStart(sourceFile)));
158724
+ }
158713
158725
  const contextModifierFlag = modifierToFlag(contextMod);
158714
158726
  if (!(modifiers & contextModifierFlag)) {
158715
158727
  modifiers |= contextModifierFlag;
158716
- range.pos = Math.min(range.pos, contextToken.pos);
158728
+ range.pos = Math.min(range.pos, contextToken.getStart(sourceFile));
158729
+ }
158730
+ if (contextToken.parent.name !== contextToken) {
158731
+ range.end = contextToken.parent.name.getStart(sourceFile);
158717
158732
  }
158718
158733
  }
158719
- return { modifiers, decorators, range: range.pos !== position ? range : void 0 };
158734
+ return { modifiers, decorators, range: range.pos < range.end ? range : void 0 };
158720
158735
  }
158721
158736
  function isModifierLike2(node) {
158722
158737
  if (isModifier(node)) {
@@ -159358,7 +159373,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
159358
159373
  contextToken,
159359
159374
  formatContext
159360
159375
  );
159361
- if (importAdder || eraseRange) {
159376
+ if ((importAdder == null ? void 0 : importAdder.hasFixes()) || eraseRange) {
159362
159377
  const changes = ts_textChanges_exports.ChangeTracker.with(
159363
159378
  { host, formatContext, preferences },
159364
159379
  (tracker) => {
@@ -159374,7 +159389,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
159374
159389
  sourceDisplay: void 0,
159375
159390
  codeActions: [{
159376
159391
  changes,
159377
- description: diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name])
159392
+ description: (importAdder == null ? void 0 : importAdder.hasFixes()) ? diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name]) : diagnosticToString([Diagnostics.Update_modifiers_of_0, name])
159378
159393
  }]
159379
159394
  };
159380
159395
  }
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.5";
57
- var version = `${versionMajorMinor}.0-dev.20240307`;
57
+ var version = `${versionMajorMinor}.0-dev.20240308`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -6939,6 +6939,7 @@ var Diagnostics = {
6939
6939
  Update_import_from_0: diag(90058, 3 /* Message */, "Update_import_from_0_90058", 'Update import from "{0}"'),
6940
6940
  Export_0_from_module_1: diag(90059, 3 /* Message */, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
6941
6941
  Export_all_referenced_locals: diag(90060, 3 /* Message */, "Export_all_referenced_locals_90060", "Export all referenced locals"),
6942
+ Update_modifiers_of_0: diag(90061, 3 /* Message */, "Update_modifiers_of_0_90061", "Update modifiers of '{0}'"),
6942
6943
  Convert_function_to_an_ES2015_class: diag(95001, 3 /* Message */, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
6943
6944
  Convert_0_to_1_in_0: diag(95003, 3 /* Message */, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
6944
6945
  Extract_to_0_in_1: diag(95004, 3 /* Message */, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
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.5.0-dev.20240307",
5
+ "version": "5.5.0-dev.20240308",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -112,5 +112,5 @@
112
112
  "node": "20.1.0",
113
113
  "npm": "8.19.4"
114
114
  },
115
- "gitHead": "881f449a8a10839db5d535c3a407621d53c78666"
115
+ "gitHead": "ddc417bf3c05c86dfa939601700c018acc18ce14"
116
116
  }