@typescript-deploys/pr-build 5.0.0-pr-52434-2 → 5.0.0-pr-52525-3

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
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-insiders.20230127`;
26
+ var version = `${versionMajorMinor}.0-insiders.20230130`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -6980,7 +6980,7 @@ var Diagnostics = {
6980
6980
  Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
6981
6981
  Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
6982
6982
  File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
6983
- File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."),
6983
+ File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."),
6984
6984
  Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
6985
6985
  Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
6986
6986
  package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
@@ -37271,7 +37271,7 @@ function tryFileLookup(fileName, onlyRecordFailures, state) {
37271
37271
  if (!onlyRecordFailures) {
37272
37272
  if (state.host.fileExists(fileName)) {
37273
37273
  if (state.traceEnabled) {
37274
- trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName);
37274
+ trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName);
37275
37275
  }
37276
37276
  return fileName;
37277
37277
  } else {
@@ -64454,7 +64454,7 @@ function createTypeChecker(host) {
64454
64454
  return narrowTypeByLiteralExpression(type, literal, assumeTrue);
64455
64455
  }
64456
64456
  function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
64457
- return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
64457
+ return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
64458
64458
  }
64459
64459
  function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
64460
64460
  const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
@@ -83310,7 +83310,7 @@ var visitEachChildTable = {
83310
83310
  [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
83311
83311
  return context.factory.updateJsxExpression(
83312
83312
  node,
83313
- Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
83313
+ nodeVisitor(node.expression, visitor, isExpression)
83314
83314
  );
83315
83315
  },
83316
83316
  // Clauses
package/lib/tsserver.js CHANGED
@@ -2378,7 +2378,7 @@ __export(ts_server_exports3, {
2378
2378
 
2379
2379
  // src/compiler/corePublic.ts
2380
2380
  var versionMajorMinor = "5.0";
2381
- var version = `${versionMajorMinor}.0-insiders.20230127`;
2381
+ var version = `${versionMajorMinor}.0-insiders.20230130`;
2382
2382
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2383
2383
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2384
2384
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -10535,7 +10535,7 @@ var Diagnostics = {
10535
10535
  Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
10536
10536
  Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
10537
10537
  File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
10538
- File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."),
10538
+ File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."),
10539
10539
  Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
10540
10540
  Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
10541
10541
  package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
@@ -41774,7 +41774,7 @@ function tryFileLookup(fileName, onlyRecordFailures, state) {
41774
41774
  if (!onlyRecordFailures) {
41775
41775
  if (state.host.fileExists(fileName)) {
41776
41776
  if (state.traceEnabled) {
41777
- trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName);
41777
+ trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName);
41778
41778
  }
41779
41779
  return fileName;
41780
41780
  } else {
@@ -69112,7 +69112,7 @@ function createTypeChecker(host) {
69112
69112
  return narrowTypeByLiteralExpression(type, literal, assumeTrue);
69113
69113
  }
69114
69114
  function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
69115
- return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
69115
+ return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
69116
69116
  }
69117
69117
  function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
69118
69118
  const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
@@ -87968,7 +87968,7 @@ var visitEachChildTable = {
87968
87968
  [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
87969
87969
  return context.factory.updateJsxExpression(
87970
87970
  node,
87971
- Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
87971
+ nodeVisitor(node.expression, visitor, isExpression)
87972
87972
  );
87973
87973
  },
87974
87974
  // Clauses
@@ -148188,7 +148188,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
148188
148188
  false
148189
148189
  );
148190
148190
  const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
148191
- let modifierFlags = effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
148191
+ let modifierFlags = effectiveModifierFlags & 32 /* Static */;
148192
+ modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
148192
148193
  if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
148193
148194
  modifierFlags |= 128 /* Accessor */;
148194
148195
  }
@@ -150531,6 +150532,7 @@ function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
150531
150532
  }
150532
150533
  function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) {
150533
150534
  let insertText;
150535
+ let filterText;
150534
150536
  let replacementSpan = getReplacementSpanForContextToken(replacementToken);
150535
150537
  let data;
150536
150538
  let isSnippet;
@@ -150587,11 +150589,15 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
150587
150589
  }
150588
150590
  if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === CompletionKind.MemberLike && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
150589
150591
  let importAdder;
150590
- ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext));
150591
- sortText = SortText.ClassMemberSnippets;
150592
- if (importAdder == null ? void 0 : importAdder.hasFixes()) {
150593
- hasAction = true;
150594
- source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
150592
+ const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
150593
+ if (memberCompletionEntry) {
150594
+ ({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
150595
+ if (importAdder == null ? void 0 : importAdder.hasFixes()) {
150596
+ hasAction = true;
150597
+ source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
150598
+ }
150599
+ } else {
150600
+ return void 0;
150595
150601
  }
150596
150602
  }
150597
150603
  if (origin && originIsObjectLiteralMethod(origin)) {
@@ -150635,6 +150641,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
150635
150641
  hasAction: hasAction ? true : void 0,
150636
150642
  isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0,
150637
150643
  insertText,
150644
+ filterText,
150638
150645
  replacementSpan,
150639
150646
  sourceDisplay,
150640
150647
  labelDetails,
@@ -150652,13 +150659,14 @@ function isClassLikeMemberCompletion(symbol, location, sourceFile) {
150652
150659
  return !!(symbol.flags & memberFlags) && (isClassLike(location) || location.parent && location.parent.parent && isClassElement(location.parent) && location === location.parent.name && location.parent.getLastToken(sourceFile) === location.parent.name && isClassLike(location.parent.parent) || location.parent && isSyntaxList(location) && isClassLike(location.parent));
150653
150660
  }
150654
150661
  function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) {
150662
+ var _a2;
150655
150663
  const classLikeDeclaration = findAncestor(location, isClassLike);
150656
150664
  if (!classLikeDeclaration) {
150657
- return { insertText: name };
150665
+ return void 0;
150658
150666
  }
150659
150667
  let isSnippet;
150660
- let replacementSpan;
150661
150668
  let insertText = name;
150669
+ const filterText = name;
150662
150670
  const checker = program.getTypeChecker();
150663
150671
  const sourceFile = location.getSourceFile();
150664
150672
  const printer = createSnippetPrinter({
@@ -150687,9 +150695,9 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
150687
150695
  );
150688
150696
  }
150689
150697
  let modifiers = 0 /* None */;
150690
- const { modifiers: presentModifiers, span: modifiersSpan } = getPresentModifiers(contextToken, sourceFile, position);
150691
- const isAbstract = !!(presentModifiers & 256 /* Abstract */);
150692
- const completionNodes = [];
150698
+ const { modifiers: presentModifiers, modifierList: presentModifiersList } = getPresentModifiers(contextToken, sourceFile, position);
150699
+ const isAbstract = presentModifiers & 256 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 256 /* Abstract */;
150700
+ let completionNodes = [];
150693
150701
  ts_codefix_exports.addNewNodeForMemberSymbol(
150694
150702
  symbol,
150695
150703
  classLikeDeclaration,
@@ -150713,18 +150721,38 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
150713
150721
  requiredModifiers |= 16384 /* Override */;
150714
150722
  }
150715
150723
  if (!completionNodes.length) {
150716
- modifiers = node.modifierFlagsCache | requiredModifiers | presentModifiers;
150724
+ modifiers = node.modifierFlagsCache | requiredModifiers;
150717
150725
  }
150718
150726
  node = factory.updateModifiers(node, modifiers);
150719
150727
  completionNodes.push(node);
150720
150728
  },
150721
150729
  body,
150722
150730
  ts_codefix_exports.PreserveOptionalFlags.Property,
150723
- isAbstract
150731
+ !!isAbstract
150724
150732
  );
150725
150733
  if (completionNodes.length) {
150734
+ const isMethod = symbol.flags & 8192 /* Method */;
150735
+ let allowedModifiers = modifiers | 16384 /* Override */ | 4 /* Public */;
150736
+ if (!isMethod) {
150737
+ allowedModifiers |= 2 /* Ambient */ | 64 /* Readonly */;
150738
+ }
150739
+ const allowedAndPresent = presentModifiers & allowedModifiers;
150740
+ if (modifiers & 16 /* Protected */ && allowedAndPresent & 4 /* Public */) {
150741
+ modifiers &= ~16 /* Protected */;
150742
+ }
150743
+ if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 4 /* Public */)) {
150744
+ modifiers &= ~4 /* Public */;
150745
+ }
150746
+ modifiers |= allowedAndPresent;
150747
+ completionNodes = completionNodes.map((node) => factory.updateModifiers(node, modifiers));
150748
+ const modifiersInsertList = factory.createModifiersFromModifierFlags(modifiers);
150749
+ for (let i = 0; i < presentModifiersList.length; i++) {
150750
+ if (presentModifiersList[i].kind !== ((_a2 = modifiersInsertList == null ? void 0 : modifiersInsertList[i]) == null ? void 0 : _a2.kind)) {
150751
+ return void 0;
150752
+ }
150753
+ }
150754
+ completionNodes[0] = factory.updateModifiers(completionNodes[0], modifiers & ~presentModifiers);
150726
150755
  const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
150727
- replacementSpan = modifiersSpan;
150728
150756
  if (formatContext) {
150729
150757
  insertText = printer.printAndFormatSnippetList(
150730
150758
  format,
@@ -150740,24 +150768,28 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
150740
150768
  );
150741
150769
  }
150742
150770
  }
150743
- return { insertText, isSnippet, importAdder, replacementSpan };
150771
+ return { insertText, filterText, isSnippet, importAdder };
150744
150772
  }
150745
150773
  function getPresentModifiers(contextToken, sourceFile, position) {
150774
+ var _a2;
150746
150775
  if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
150747
- return { modifiers: 0 /* None */ };
150776
+ return { modifiers: 0 /* None */, modifierList: [] };
150748
150777
  }
150749
150778
  let modifiers = 0 /* None */;
150750
- let span;
150779
+ let modifierList = [];
150751
150780
  let contextMod;
150752
- if (contextMod = isModifierLike2(contextToken)) {
150753
- modifiers |= modifierToFlag(contextMod);
150754
- span = createTextSpanFromNode(contextToken);
150755
- }
150756
150781
  if (isPropertyDeclaration(contextToken.parent)) {
150757
150782
  modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */;
150758
- span = createTextSpanFromNode(contextToken.parent);
150783
+ modifierList = ((_a2 = contextToken.parent.modifiers) == null ? void 0 : _a2.filter(isModifier)) || [];
150784
+ }
150785
+ if (contextMod = isModifierLike2(contextToken)) {
150786
+ const contextModifierFlag = modifierToFlag(contextMod);
150787
+ if (!(modifiers & contextModifierFlag)) {
150788
+ modifierList.push(factory.createToken(contextMod));
150789
+ modifiers |= contextModifierFlag;
150790
+ }
150759
150791
  }
150760
- return { modifiers, span };
150792
+ return { modifiers, modifierList };
150761
150793
  }
150762
150794
  function isModifierLike2(node) {
150763
150795
  if (isModifier(node)) {
@@ -160854,7 +160886,6 @@ function convertToBlock(body) {
160854
160886
  if (isExpression(body)) {
160855
160887
  const returnStatement = factory.createReturnStatement(body);
160856
160888
  const file = body.getSourceFile();
160857
- setTextRange(returnStatement, body);
160858
160889
  suppressLeadingAndTrailingTrivia(returnStatement);
160859
160890
  copyTrailingAsLeadingComments(
160860
160891
  body,
@@ -178402,6 +178433,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
178402
178433
  kindModifiers,
178403
178434
  sortText,
178404
178435
  insertText,
178436
+ filterText,
178405
178437
  replacementSpan,
178406
178438
  hasAction,
178407
178439
  source,
@@ -178420,6 +178452,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
178420
178452
  kindModifiers,
178421
178453
  sortText,
178422
178454
  insertText,
178455
+ filterText,
178423
178456
  replacementSpan: convertedSpan,
178424
178457
  isSnippet,
178425
178458
  hasAction: hasAction || void 0,
@@ -1798,6 +1798,11 @@ declare namespace ts {
1798
1798
  * coupled with `replacementSpan` to replace a dotted access with a bracket access.
1799
1799
  */
1800
1800
  insertText?: string;
1801
+ /**
1802
+ * A string that should be used when filtering a set of
1803
+ * completion items.
1804
+ */
1805
+ filterText?: string;
1801
1806
  /**
1802
1807
  * `insertText` should be interpreted as a snippet if true.
1803
1808
  */
@@ -10598,6 +10603,7 @@ declare namespace ts {
10598
10603
  kindModifiers?: string;
10599
10604
  sortText: string;
10600
10605
  insertText?: string;
10606
+ filterText?: string;
10601
10607
  isSnippet?: true;
10602
10608
  /**
10603
10609
  * An optional span that indicates the text to be replaced by this completion item.
@@ -18,17 +18,10 @@ and limitations under the License.
18
18
  var ts = (() => {
19
19
  var __defProp = Object.defineProperty;
20
20
  var __getOwnPropNames = Object.getOwnPropertyNames;
21
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
22
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
23
- }) : x)(function(x) {
24
- if (typeof require !== "undefined")
25
- return require.apply(this, arguments);
26
- throw new Error('Dynamic require of "' + x + '" is not supported');
27
- });
28
21
  var __esm = (fn, res) => function __init() {
29
22
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
30
23
  };
31
- var __commonJS = (cb, mod) => function __require2() {
24
+ var __commonJS = (cb, mod) => function __require() {
32
25
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
33
26
  };
34
27
  var __export = (target, all) => {
@@ -42,7 +35,7 @@ var ts = (() => {
42
35
  "src/compiler/corePublic.ts"() {
43
36
  "use strict";
44
37
  versionMajorMinor = "5.0";
45
- version = `${versionMajorMinor}.0-insiders.20230127`;
38
+ version = `${versionMajorMinor}.0-insiders.20230130`;
46
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
47
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
48
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -8274,7 +8267,7 @@ ${lanes.join("\n")}
8274
8267
  Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
8275
8268
  Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
8276
8269
  File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
8277
- File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."),
8270
+ File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."),
8278
8271
  Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
8279
8272
  Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
8280
8273
  package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
@@ -39576,7 +39569,7 @@ ${lanes.join("\n")}
39576
39569
  if (!onlyRecordFailures) {
39577
39570
  if (state.host.fileExists(fileName)) {
39578
39571
  if (state.traceEnabled) {
39579
- trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName);
39572
+ trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName);
39580
39573
  }
39581
39574
  return fileName;
39582
39575
  } else {
@@ -66838,7 +66831,7 @@ ${lanes.join("\n")}
66838
66831
  return narrowTypeByLiteralExpression(type, literal, assumeTrue);
66839
66832
  }
66840
66833
  function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
66841
- return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
66834
+ return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
66842
66835
  }
66843
66836
  function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
66844
66837
  const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
@@ -85836,7 +85829,7 @@ ${lanes.join("\n")}
85836
85829
  [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
85837
85830
  return context.factory.updateJsxExpression(
85838
85831
  node,
85839
- Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
85832
+ nodeVisitor(node.expression, visitor, isExpression)
85840
85833
  );
85841
85834
  },
85842
85835
  // Clauses
@@ -144635,7 +144628,8 @@ ${lanes.join("\n")}
144635
144628
  false
144636
144629
  );
144637
144630
  const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
144638
- let modifierFlags = effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
144631
+ let modifierFlags = effectiveModifierFlags & 32 /* Static */;
144632
+ modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
144639
144633
  if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
144640
144634
  modifierFlags |= 128 /* Accessor */;
144641
144635
  }
@@ -147162,6 +147156,7 @@ ${lanes.join("\n")}
147162
147156
  }
147163
147157
  function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) {
147164
147158
  let insertText;
147159
+ let filterText;
147165
147160
  let replacementSpan = getReplacementSpanForContextToken(replacementToken);
147166
147161
  let data;
147167
147162
  let isSnippet;
@@ -147218,11 +147213,15 @@ ${lanes.join("\n")}
147218
147213
  }
147219
147214
  if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === CompletionKind.MemberLike && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
147220
147215
  let importAdder;
147221
- ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext));
147222
- sortText = SortText.ClassMemberSnippets;
147223
- if (importAdder == null ? void 0 : importAdder.hasFixes()) {
147224
- hasAction = true;
147225
- source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
147216
+ const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
147217
+ if (memberCompletionEntry) {
147218
+ ({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
147219
+ if (importAdder == null ? void 0 : importAdder.hasFixes()) {
147220
+ hasAction = true;
147221
+ source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
147222
+ }
147223
+ } else {
147224
+ return void 0;
147226
147225
  }
147227
147226
  }
147228
147227
  if (origin && originIsObjectLiteralMethod(origin)) {
@@ -147266,6 +147265,7 @@ ${lanes.join("\n")}
147266
147265
  hasAction: hasAction ? true : void 0,
147267
147266
  isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0,
147268
147267
  insertText,
147268
+ filterText,
147269
147269
  replacementSpan,
147270
147270
  sourceDisplay,
147271
147271
  labelDetails,
@@ -147283,13 +147283,14 @@ ${lanes.join("\n")}
147283
147283
  return !!(symbol.flags & memberFlags) && (isClassLike(location) || location.parent && location.parent.parent && isClassElement(location.parent) && location === location.parent.name && location.parent.getLastToken(sourceFile) === location.parent.name && isClassLike(location.parent.parent) || location.parent && isSyntaxList(location) && isClassLike(location.parent));
147284
147284
  }
147285
147285
  function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) {
147286
+ var _a2;
147286
147287
  const classLikeDeclaration = findAncestor(location, isClassLike);
147287
147288
  if (!classLikeDeclaration) {
147288
- return { insertText: name };
147289
+ return void 0;
147289
147290
  }
147290
147291
  let isSnippet;
147291
- let replacementSpan;
147292
147292
  let insertText = name;
147293
+ const filterText = name;
147293
147294
  const checker = program.getTypeChecker();
147294
147295
  const sourceFile = location.getSourceFile();
147295
147296
  const printer = createSnippetPrinter({
@@ -147318,9 +147319,9 @@ ${lanes.join("\n")}
147318
147319
  );
147319
147320
  }
147320
147321
  let modifiers = 0 /* None */;
147321
- const { modifiers: presentModifiers, span: modifiersSpan } = getPresentModifiers(contextToken, sourceFile, position);
147322
- const isAbstract = !!(presentModifiers & 256 /* Abstract */);
147323
- const completionNodes = [];
147322
+ const { modifiers: presentModifiers, modifierList: presentModifiersList } = getPresentModifiers(contextToken, sourceFile, position);
147323
+ const isAbstract = presentModifiers & 256 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 256 /* Abstract */;
147324
+ let completionNodes = [];
147324
147325
  ts_codefix_exports.addNewNodeForMemberSymbol(
147325
147326
  symbol,
147326
147327
  classLikeDeclaration,
@@ -147344,18 +147345,38 @@ ${lanes.join("\n")}
147344
147345
  requiredModifiers |= 16384 /* Override */;
147345
147346
  }
147346
147347
  if (!completionNodes.length) {
147347
- modifiers = node.modifierFlagsCache | requiredModifiers | presentModifiers;
147348
+ modifiers = node.modifierFlagsCache | requiredModifiers;
147348
147349
  }
147349
147350
  node = factory.updateModifiers(node, modifiers);
147350
147351
  completionNodes.push(node);
147351
147352
  },
147352
147353
  body,
147353
147354
  ts_codefix_exports.PreserveOptionalFlags.Property,
147354
- isAbstract
147355
+ !!isAbstract
147355
147356
  );
147356
147357
  if (completionNodes.length) {
147358
+ const isMethod = symbol.flags & 8192 /* Method */;
147359
+ let allowedModifiers = modifiers | 16384 /* Override */ | 4 /* Public */;
147360
+ if (!isMethod) {
147361
+ allowedModifiers |= 2 /* Ambient */ | 64 /* Readonly */;
147362
+ }
147363
+ const allowedAndPresent = presentModifiers & allowedModifiers;
147364
+ if (modifiers & 16 /* Protected */ && allowedAndPresent & 4 /* Public */) {
147365
+ modifiers &= ~16 /* Protected */;
147366
+ }
147367
+ if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 4 /* Public */)) {
147368
+ modifiers &= ~4 /* Public */;
147369
+ }
147370
+ modifiers |= allowedAndPresent;
147371
+ completionNodes = completionNodes.map((node) => factory.updateModifiers(node, modifiers));
147372
+ const modifiersInsertList = factory.createModifiersFromModifierFlags(modifiers);
147373
+ for (let i = 0; i < presentModifiersList.length; i++) {
147374
+ if (presentModifiersList[i].kind !== ((_a2 = modifiersInsertList == null ? void 0 : modifiersInsertList[i]) == null ? void 0 : _a2.kind)) {
147375
+ return void 0;
147376
+ }
147377
+ }
147378
+ completionNodes[0] = factory.updateModifiers(completionNodes[0], modifiers & ~presentModifiers);
147357
147379
  const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
147358
- replacementSpan = modifiersSpan;
147359
147380
  if (formatContext) {
147360
147381
  insertText = printer.printAndFormatSnippetList(
147361
147382
  format,
@@ -147371,24 +147392,28 @@ ${lanes.join("\n")}
147371
147392
  );
147372
147393
  }
147373
147394
  }
147374
- return { insertText, isSnippet, importAdder, replacementSpan };
147395
+ return { insertText, filterText, isSnippet, importAdder };
147375
147396
  }
147376
147397
  function getPresentModifiers(contextToken, sourceFile, position) {
147398
+ var _a2;
147377
147399
  if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
147378
- return { modifiers: 0 /* None */ };
147400
+ return { modifiers: 0 /* None */, modifierList: [] };
147379
147401
  }
147380
147402
  let modifiers = 0 /* None */;
147381
- let span;
147403
+ let modifierList = [];
147382
147404
  let contextMod;
147383
- if (contextMod = isModifierLike2(contextToken)) {
147384
- modifiers |= modifierToFlag(contextMod);
147385
- span = createTextSpanFromNode(contextToken);
147386
- }
147387
147405
  if (isPropertyDeclaration(contextToken.parent)) {
147388
147406
  modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */;
147389
- span = createTextSpanFromNode(contextToken.parent);
147407
+ modifierList = ((_a2 = contextToken.parent.modifiers) == null ? void 0 : _a2.filter(isModifier)) || [];
147408
+ }
147409
+ if (contextMod = isModifierLike2(contextToken)) {
147410
+ const contextModifierFlag = modifierToFlag(contextMod);
147411
+ if (!(modifiers & contextModifierFlag)) {
147412
+ modifierList.push(factory.createToken(contextMod));
147413
+ modifiers |= contextModifierFlag;
147414
+ }
147390
147415
  }
147391
- return { modifiers, span };
147416
+ return { modifiers, modifierList };
147392
147417
  }
147393
147418
  function isModifierLike2(node) {
147394
147419
  if (isModifier(node)) {
@@ -157683,7 +157708,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157683
157708
  if (isExpression(body)) {
157684
157709
  const returnStatement = factory.createReturnStatement(body);
157685
157710
  const file = body.getSourceFile();
157686
- setTextRange(returnStatement, body);
157687
157711
  suppressLeadingAndTrailingTrivia(returnStatement);
157688
157712
  copyTrailingAsLeadingComments(
157689
157713
  body,
@@ -175738,6 +175762,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
175738
175762
  kindModifiers,
175739
175763
  sortText,
175740
175764
  insertText,
175765
+ filterText,
175741
175766
  replacementSpan,
175742
175767
  hasAction,
175743
175768
  source,
@@ -175756,6 +175781,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
175756
175781
  kindModifiers,
175757
175782
  sortText,
175758
175783
  insertText,
175784
+ filterText,
175759
175785
  replacementSpan: convertedSpan,
175760
175786
  isSnippet,
175761
175787
  hasAction: hasAction || void 0,
@@ -6696,6 +6696,7 @@ declare namespace ts {
6696
6696
  kindModifiers?: string;
6697
6697
  sortText: string;
6698
6698
  insertText?: string;
6699
+ filterText?: string;
6699
6700
  isSnippet?: true;
6700
6701
  /**
6701
6702
  * An optional span that indicates the text to be replaced by this completion item.
package/lib/typescript.js CHANGED
@@ -18,17 +18,10 @@ and limitations under the License.
18
18
  var ts = (() => {
19
19
  var __defProp = Object.defineProperty;
20
20
  var __getOwnPropNames = Object.getOwnPropertyNames;
21
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
22
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
23
- }) : x)(function(x) {
24
- if (typeof require !== "undefined")
25
- return require.apply(this, arguments);
26
- throw new Error('Dynamic require of "' + x + '" is not supported');
27
- });
28
21
  var __esm = (fn, res) => function __init() {
29
22
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
30
23
  };
31
- var __commonJS = (cb, mod) => function __require2() {
24
+ var __commonJS = (cb, mod) => function __require() {
32
25
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
33
26
  };
34
27
  var __export = (target, all) => {
@@ -42,7 +35,7 @@ var ts = (() => {
42
35
  "src/compiler/corePublic.ts"() {
43
36
  "use strict";
44
37
  versionMajorMinor = "5.0";
45
- version = `${versionMajorMinor}.0-insiders.20230127`;
38
+ version = `${versionMajorMinor}.0-insiders.20230130`;
46
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
47
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
48
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -8274,7 +8267,7 @@ ${lanes.join("\n")}
8274
8267
  Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
8275
8268
  Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
8276
8269
  File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
8277
- File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."),
8270
+ File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."),
8278
8271
  Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
8279
8272
  Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
8280
8273
  package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
@@ -39576,7 +39569,7 @@ ${lanes.join("\n")}
39576
39569
  if (!onlyRecordFailures) {
39577
39570
  if (state.host.fileExists(fileName)) {
39578
39571
  if (state.traceEnabled) {
39579
- trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName);
39572
+ trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName);
39580
39573
  }
39581
39574
  return fileName;
39582
39575
  } else {
@@ -66838,7 +66831,7 @@ ${lanes.join("\n")}
66838
66831
  return narrowTypeByLiteralExpression(type, literal, assumeTrue);
66839
66832
  }
66840
66833
  function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
66841
- return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
66834
+ return assumeTrue ? narrowTypeByTypeName(type, literal.text) : getAdjustedTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */);
66842
66835
  }
66843
66836
  function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
66844
66837
  const everyClauseChecks = clauseStart !== clauseEnd && every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
@@ -85836,7 +85829,7 @@ ${lanes.join("\n")}
85836
85829
  [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
85837
85830
  return context.factory.updateJsxExpression(
85838
85831
  node,
85839
- Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
85832
+ nodeVisitor(node.expression, visitor, isExpression)
85840
85833
  );
85841
85834
  },
85842
85835
  // Clauses
@@ -144649,7 +144642,8 @@ ${lanes.join("\n")}
144649
144642
  false
144650
144643
  );
144651
144644
  const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
144652
- let modifierFlags = effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
144645
+ let modifierFlags = effectiveModifierFlags & 32 /* Static */;
144646
+ modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
144653
144647
  if (declaration && isAutoAccessorPropertyDeclaration(declaration)) {
144654
144648
  modifierFlags |= 128 /* Accessor */;
144655
144649
  }
@@ -147176,6 +147170,7 @@ ${lanes.join("\n")}
147176
147170
  }
147177
147171
  function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) {
147178
147172
  let insertText;
147173
+ let filterText;
147179
147174
  let replacementSpan = getReplacementSpanForContextToken(replacementToken);
147180
147175
  let data;
147181
147176
  let isSnippet;
@@ -147232,11 +147227,15 @@ ${lanes.join("\n")}
147232
147227
  }
147233
147228
  if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === CompletionKind.MemberLike && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
147234
147229
  let importAdder;
147235
- ({ insertText, isSnippet, importAdder, replacementSpan } = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext));
147236
- sortText = SortText.ClassMemberSnippets;
147237
- if (importAdder == null ? void 0 : importAdder.hasFixes()) {
147238
- hasAction = true;
147239
- source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
147230
+ const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
147231
+ if (memberCompletionEntry) {
147232
+ ({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
147233
+ if (importAdder == null ? void 0 : importAdder.hasFixes()) {
147234
+ hasAction = true;
147235
+ source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
147236
+ }
147237
+ } else {
147238
+ return void 0;
147240
147239
  }
147241
147240
  }
147242
147241
  if (origin && originIsObjectLiteralMethod(origin)) {
@@ -147280,6 +147279,7 @@ ${lanes.join("\n")}
147280
147279
  hasAction: hasAction ? true : void 0,
147281
147280
  isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0,
147282
147281
  insertText,
147282
+ filterText,
147283
147283
  replacementSpan,
147284
147284
  sourceDisplay,
147285
147285
  labelDetails,
@@ -147297,13 +147297,14 @@ ${lanes.join("\n")}
147297
147297
  return !!(symbol.flags & memberFlags) && (isClassLike(location) || location.parent && location.parent.parent && isClassElement(location.parent) && location === location.parent.name && location.parent.getLastToken(sourceFile) === location.parent.name && isClassLike(location.parent.parent) || location.parent && isSyntaxList(location) && isClassLike(location.parent));
147298
147298
  }
147299
147299
  function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext) {
147300
+ var _a2;
147300
147301
  const classLikeDeclaration = findAncestor(location, isClassLike);
147301
147302
  if (!classLikeDeclaration) {
147302
- return { insertText: name };
147303
+ return void 0;
147303
147304
  }
147304
147305
  let isSnippet;
147305
- let replacementSpan;
147306
147306
  let insertText = name;
147307
+ const filterText = name;
147307
147308
  const checker = program.getTypeChecker();
147308
147309
  const sourceFile = location.getSourceFile();
147309
147310
  const printer = createSnippetPrinter({
@@ -147332,9 +147333,9 @@ ${lanes.join("\n")}
147332
147333
  );
147333
147334
  }
147334
147335
  let modifiers = 0 /* None */;
147335
- const { modifiers: presentModifiers, span: modifiersSpan } = getPresentModifiers(contextToken, sourceFile, position);
147336
- const isAbstract = !!(presentModifiers & 256 /* Abstract */);
147337
- const completionNodes = [];
147336
+ const { modifiers: presentModifiers, modifierList: presentModifiersList } = getPresentModifiers(contextToken, sourceFile, position);
147337
+ const isAbstract = presentModifiers & 256 /* Abstract */ && classLikeDeclaration.modifierFlagsCache & 256 /* Abstract */;
147338
+ let completionNodes = [];
147338
147339
  ts_codefix_exports.addNewNodeForMemberSymbol(
147339
147340
  symbol,
147340
147341
  classLikeDeclaration,
@@ -147358,18 +147359,38 @@ ${lanes.join("\n")}
147358
147359
  requiredModifiers |= 16384 /* Override */;
147359
147360
  }
147360
147361
  if (!completionNodes.length) {
147361
- modifiers = node.modifierFlagsCache | requiredModifiers | presentModifiers;
147362
+ modifiers = node.modifierFlagsCache | requiredModifiers;
147362
147363
  }
147363
147364
  node = factory.updateModifiers(node, modifiers);
147364
147365
  completionNodes.push(node);
147365
147366
  },
147366
147367
  body,
147367
147368
  ts_codefix_exports.PreserveOptionalFlags.Property,
147368
- isAbstract
147369
+ !!isAbstract
147369
147370
  );
147370
147371
  if (completionNodes.length) {
147372
+ const isMethod = symbol.flags & 8192 /* Method */;
147373
+ let allowedModifiers = modifiers | 16384 /* Override */ | 4 /* Public */;
147374
+ if (!isMethod) {
147375
+ allowedModifiers |= 2 /* Ambient */ | 64 /* Readonly */;
147376
+ }
147377
+ const allowedAndPresent = presentModifiers & allowedModifiers;
147378
+ if (modifiers & 16 /* Protected */ && allowedAndPresent & 4 /* Public */) {
147379
+ modifiers &= ~16 /* Protected */;
147380
+ }
147381
+ if (allowedAndPresent !== 0 /* None */ && !(allowedAndPresent & 4 /* Public */)) {
147382
+ modifiers &= ~4 /* Public */;
147383
+ }
147384
+ modifiers |= allowedAndPresent;
147385
+ completionNodes = completionNodes.map((node) => factory.updateModifiers(node, modifiers));
147386
+ const modifiersInsertList = factory.createModifiersFromModifierFlags(modifiers);
147387
+ for (let i = 0; i < presentModifiersList.length; i++) {
147388
+ if (presentModifiersList[i].kind !== ((_a2 = modifiersInsertList == null ? void 0 : modifiersInsertList[i]) == null ? void 0 : _a2.kind)) {
147389
+ return void 0;
147390
+ }
147391
+ }
147392
+ completionNodes[0] = factory.updateModifiers(completionNodes[0], modifiers & ~presentModifiers);
147371
147393
  const format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
147372
- replacementSpan = modifiersSpan;
147373
147394
  if (formatContext) {
147374
147395
  insertText = printer.printAndFormatSnippetList(
147375
147396
  format,
@@ -147385,24 +147406,28 @@ ${lanes.join("\n")}
147385
147406
  );
147386
147407
  }
147387
147408
  }
147388
- return { insertText, isSnippet, importAdder, replacementSpan };
147409
+ return { insertText, filterText, isSnippet, importAdder };
147389
147410
  }
147390
147411
  function getPresentModifiers(contextToken, sourceFile, position) {
147412
+ var _a2;
147391
147413
  if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
147392
- return { modifiers: 0 /* None */ };
147414
+ return { modifiers: 0 /* None */, modifierList: [] };
147393
147415
  }
147394
147416
  let modifiers = 0 /* None */;
147395
- let span;
147417
+ let modifierList = [];
147396
147418
  let contextMod;
147397
- if (contextMod = isModifierLike2(contextToken)) {
147398
- modifiers |= modifierToFlag(contextMod);
147399
- span = createTextSpanFromNode(contextToken);
147400
- }
147401
147419
  if (isPropertyDeclaration(contextToken.parent)) {
147402
147420
  modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 126975 /* Modifier */;
147403
- span = createTextSpanFromNode(contextToken.parent);
147421
+ modifierList = ((_a2 = contextToken.parent.modifiers) == null ? void 0 : _a2.filter(isModifier)) || [];
147422
+ }
147423
+ if (contextMod = isModifierLike2(contextToken)) {
147424
+ const contextModifierFlag = modifierToFlag(contextMod);
147425
+ if (!(modifiers & contextModifierFlag)) {
147426
+ modifierList.push(factory.createToken(contextMod));
147427
+ modifiers |= contextModifierFlag;
147428
+ }
147404
147429
  }
147405
- return { modifiers, span };
147430
+ return { modifiers, modifierList };
147406
147431
  }
147407
147432
  function isModifierLike2(node) {
147408
147433
  if (isModifier(node)) {
@@ -157697,7 +157722,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157697
157722
  if (isExpression(body)) {
157698
157723
  const returnStatement = factory.createReturnStatement(body);
157699
157724
  const file = body.getSourceFile();
157700
- setTextRange(returnStatement, body);
157701
157725
  suppressLeadingAndTrailingTrivia(returnStatement);
157702
157726
  copyTrailingAsLeadingComments(
157703
157727
  body,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.0";
57
- var version = `${versionMajorMinor}.0-insiders.20230127`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230130`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -6388,7 +6388,7 @@ var Diagnostics = {
6388
6388
  Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
6389
6389
  Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
6390
6390
  File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
6391
- File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."),
6391
+ File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."),
6392
6392
  Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
6393
6393
  Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
6394
6394
  package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
@@ -28663,7 +28663,7 @@ function tryFileLookup(fileName, onlyRecordFailures, state) {
28663
28663
  if (!onlyRecordFailures) {
28664
28664
  if (state.host.fileExists(fileName)) {
28665
28665
  if (state.traceEnabled) {
28666
- trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName);
28666
+ trace(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName);
28667
28667
  }
28668
28668
  return fileName;
28669
28669
  } else {
@@ -33756,7 +33756,7 @@ var visitEachChildTable = {
33756
33756
  [291 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
33757
33757
  return context.factory.updateJsxExpression(
33758
33758
  node,
33759
- Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
33759
+ nodeVisitor(node.expression, visitor, isExpression)
33760
33760
  );
33761
33761
  },
33762
33762
  // Clauses
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.0.0-pr-52434-2",
5
+ "version": "5.0.0-pr-52525-3",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [