@typescript-deploys/pr-build 5.3.0-pr-55887-24 → 5.3.0-pr-55867-7

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/tsserver.js CHANGED
@@ -61,7 +61,6 @@ __export(server_exports, {
61
61
  ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel,
62
62
  ContainerFlags: () => ContainerFlags,
63
63
  ContextFlags: () => ContextFlags,
64
- CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter,
65
64
  Debug: () => Debug,
66
65
  DiagnosticCategory: () => DiagnosticCategory,
67
66
  Diagnostics: () => Diagnostics,
@@ -110,7 +109,6 @@ __export(server_exports, {
110
109
  JsxFlags: () => JsxFlags,
111
110
  JsxReferenceKind: () => JsxReferenceKind,
112
111
  LanguageServiceMode: () => LanguageServiceMode,
113
- LanguageServiceShimHostAdapter: () => LanguageServiceShimHostAdapter,
114
112
  LanguageVariant: () => LanguageVariant,
115
113
  LexicalEnvironmentFlags: () => LexicalEnvironmentFlags,
116
114
  ListFormat: () => ListFormat,
@@ -184,7 +182,6 @@ __export(server_exports, {
184
182
  TypeMapKind: () => TypeMapKind,
185
183
  TypePredicateKind: () => TypePredicateKind,
186
184
  TypeReferenceSerializationKind: () => TypeReferenceSerializationKind,
187
- TypeScriptServicesFactory: () => TypeScriptServicesFactory,
188
185
  UnionReduction: () => UnionReduction,
189
186
  UpToDateStatusType: () => UpToDateStatusType,
190
187
  VarianceFlags: () => VarianceFlags,
@@ -1447,6 +1444,7 @@ __export(server_exports, {
1447
1444
  isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute,
1448
1445
  isInsideNodeModules: () => isInsideNodeModules,
1449
1446
  isInsideTemplateLiteral: () => isInsideTemplateLiteral,
1447
+ isInstanceOfExpression: () => isInstanceOfExpression,
1450
1448
  isInstantiatedModule: () => isInstantiatedModule,
1451
1449
  isInterfaceDeclaration: () => isInterfaceDeclaration,
1452
1450
  isInternalDeclaration: () => isInternalDeclaration,
@@ -1704,6 +1702,7 @@ __export(server_exports, {
1704
1702
  isReturnStatement: () => isReturnStatement,
1705
1703
  isReturnStatementWithFixablePromiseHandler: () => isReturnStatementWithFixablePromiseHandler,
1706
1704
  isRightSideOfAccessExpression: () => isRightSideOfAccessExpression,
1705
+ isRightSideOfInstanceofExpression: () => isRightSideOfInstanceofExpression,
1707
1706
  isRightSideOfPropertyAccess: () => isRightSideOfPropertyAccess,
1708
1707
  isRightSideOfQualifiedName: () => isRightSideOfQualifiedName,
1709
1708
  isRightSideOfQualifiedNameOrPropertyAccess: () => isRightSideOfQualifiedNameOrPropertyAccess,
@@ -2028,7 +2027,6 @@ __export(server_exports, {
2028
2027
  readJson: () => readJson,
2029
2028
  readJsonConfigFile: () => readJsonConfigFile,
2030
2029
  readJsonOrUndefined: () => readJsonOrUndefined,
2031
- realizeDiagnostics: () => realizeDiagnostics,
2032
2030
  reduceEachLeadingCommentRange: () => reduceEachLeadingCommentRange,
2033
2031
  reduceEachTrailingCommentRange: () => reduceEachTrailingCommentRange,
2034
2032
  reduceLeft: () => reduceLeft,
@@ -2330,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
2330
2328
 
2331
2329
  // src/compiler/corePublic.ts
2332
2330
  var versionMajorMinor = "5.3";
2333
- var version = `${versionMajorMinor}.0-insiders.20230928`;
2331
+ var version = `${versionMajorMinor}.0-insiders.20230929`;
2334
2332
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2335
2333
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2336
2334
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -7427,12 +7425,12 @@ var commentPragmas = {
7427
7425
  kind: 4 /* MultiLine */
7428
7426
  }
7429
7427
  };
7430
- var JSDocParsingMode = /* @__PURE__ */ ((JSDocParsingMode7) => {
7431
- JSDocParsingMode7[JSDocParsingMode7["ParseAll"] = 0] = "ParseAll";
7432
- JSDocParsingMode7[JSDocParsingMode7["ParseNone"] = 1] = "ParseNone";
7433
- JSDocParsingMode7[JSDocParsingMode7["ParseForTypeErrors"] = 2] = "ParseForTypeErrors";
7434
- JSDocParsingMode7[JSDocParsingMode7["ParseForTypeInfo"] = 3] = "ParseForTypeInfo";
7435
- return JSDocParsingMode7;
7428
+ var JSDocParsingMode = /* @__PURE__ */ ((JSDocParsingMode6) => {
7429
+ JSDocParsingMode6[JSDocParsingMode6["ParseAll"] = 0] = "ParseAll";
7430
+ JSDocParsingMode6[JSDocParsingMode6["ParseNone"] = 1] = "ParseNone";
7431
+ JSDocParsingMode6[JSDocParsingMode6["ParseForTypeErrors"] = 2] = "ParseForTypeErrors";
7432
+ JSDocParsingMode6[JSDocParsingMode6["ParseForTypeInfo"] = 3] = "ParseForTypeInfo";
7433
+ return JSDocParsingMode6;
7436
7434
  })(JSDocParsingMode || {});
7437
7435
 
7438
7436
  // src/compiler/sys.ts
@@ -9732,7 +9730,7 @@ var Diagnostics = {
9732
9730
  An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2356, 1 /* Error */, "An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356", "An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),
9733
9731
  The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, 1 /* Error */, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."),
9734
9732
  The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, 1 /* Error */, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),
9735
- The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: diag(2359, 1 /* Error */, "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),
9733
+ The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method: diag(2359, 1 /* Error */, "The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_2359", "The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method."),
9736
9734
  The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, 1 /* Error */, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
9737
9735
  The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2363, 1 /* Error */, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
9738
9736
  The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: diag(2364, 1 /* Error */, "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", "The left-hand side of an assignment expression must be a variable or a property access."),
@@ -10181,6 +10179,8 @@ var Diagnostics = {
10181
10179
  Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
10182
10180
  Import_attribute_values_must_be_string_literal_expressions: diag(2858, 1 /* Error */, "Import_attribute_values_must_be_string_literal_expressions_2858", "Import attribute values must be string literal expressions."),
10183
10181
  Excessive_complexity_comparing_types_0_and_1: diag(2859, 1 /* Error */, "Excessive_complexity_comparing_types_0_and_1_2859", "Excessive complexity comparing types '{0}' and '{1}'."),
10182
+ The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method: diag(2860, 1 /* Error */, "The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_2860", "The left-hand side of an 'instanceof' expression must be assignable to the first argument of the right-hand side's '[Symbol.hasInstance]' method."),
10183
+ An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression: diag(2861, 1 /* Error */, "An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_han_2861", "An object's '[Symbol.hasInstance]' method must return a boolean value for it to be used on the right-hand side of an 'instanceof' expression."),
10184
10184
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
10185
10185
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
10186
10186
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -14487,6 +14487,13 @@ function isAutoAccessorPropertyDeclaration(node) {
14487
14487
  return isPropertyDeclaration(node) && hasAccessorModifier(node);
14488
14488
  }
14489
14489
  function isClassFieldAndNotAutoAccessor(node) {
14490
+ if (isInJSFile(node) && isExpandoPropertyDeclaration(node)) {
14491
+ return (!isBindableStaticAccessExpression(node) || !isPrototypeAccess(node.expression)) && !isBindableStaticNameExpression(
14492
+ node,
14493
+ /*excludeThisKeyword*/
14494
+ true
14495
+ );
14496
+ }
14490
14497
  return node.parent && isClassLike(node.parent) && isPropertyDeclaration(node) && !hasAccessorModifier(node);
14491
14498
  }
14492
14499
  function isMethodOrAccessor(node) {
@@ -16919,6 +16926,8 @@ function getInvokedExpression(node) {
16919
16926
  case 286 /* JsxOpeningElement */:
16920
16927
  case 285 /* JsxSelfClosingElement */:
16921
16928
  return node.tagName;
16929
+ case 226 /* BinaryExpression */:
16930
+ return node.right;
16922
16931
  default:
16923
16932
  return node.expression;
16924
16933
  }
@@ -19575,6 +19584,12 @@ function isRightSideOfAccessExpression(node) {
19575
19584
  function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) {
19576
19585
  return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node || isJSDocMemberName(node.parent) && node.parent.right === node;
19577
19586
  }
19587
+ function isInstanceOfExpression(node) {
19588
+ return isBinaryExpression(node) && node.operatorToken.kind === 104 /* InstanceOfKeyword */;
19589
+ }
19590
+ function isRightSideOfInstanceofExpression(node) {
19591
+ return isInstanceOfExpression(node.parent) && node === node.parent.right;
19592
+ }
19578
19593
  function isEmptyObjectLiteral(expression) {
19579
19594
  return expression.kind === 210 /* ObjectLiteralExpression */ && expression.properties.length === 0;
19580
19595
  }
@@ -19921,9 +19936,6 @@ function accessKind(node) {
19921
19936
  return node === parent2.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent2.parent);
19922
19937
  case 209 /* ArrayLiteralExpression */:
19923
19938
  return accessKind(parent2);
19924
- case 249 /* ForInStatement */:
19925
- case 250 /* ForOfStatement */:
19926
- return node === parent2.initializer ? 1 /* Write */ : 0 /* Read */;
19927
19939
  default:
19928
19940
  return 0 /* Read */;
19929
19941
  }
@@ -47786,9 +47798,8 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
47786
47798
  CheckMode3[CheckMode3["SkipContextSensitive"] = 4] = "SkipContextSensitive";
47787
47799
  CheckMode3[CheckMode3["SkipGenericFunctions"] = 8] = "SkipGenericFunctions";
47788
47800
  CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
47789
- CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions";
47790
- CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement";
47791
- CheckMode3[CheckMode3["TypeOnly"] = 128] = "TypeOnly";
47801
+ CheckMode3[CheckMode3["RestBindingElement"] = 32] = "RestBindingElement";
47802
+ CheckMode3[CheckMode3["TypeOnly"] = 64] = "TypeOnly";
47792
47803
  return CheckMode3;
47793
47804
  })(CheckMode || {});
47794
47805
  var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
@@ -48241,16 +48252,11 @@ function createTypeChecker(host) {
48241
48252
  checkSourceFileWithEagerDiagnostics(file);
48242
48253
  Debug.assert(!!(getNodeLinks(file).flags & 1 /* TypeChecked */));
48243
48254
  diagnostics2 = addRange(diagnostics2, suggestionDiagnostics.getDiagnostics(file.fileName));
48244
- checkUnusedOrUninitializedIdentifiers(
48245
- getPotentiallyUnusedOrUninitializedIdentifiers(file),
48246
- (containingNode, kind, diag2) => {
48247
- if (!containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags & 33554432 /* Ambient */))) {
48248
- (diagnostics2 || (diagnostics2 = [])).push({ ...diag2, category: 2 /* Suggestion */ });
48249
- }
48250
- },
48251
- /*checkUnused*/
48252
- true
48253
- );
48255
+ checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(file), (containingNode, kind, diag2) => {
48256
+ if (!containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags & 33554432 /* Ambient */))) {
48257
+ (diagnostics2 || (diagnostics2 = [])).push({ ...diag2, category: 2 /* Suggestion */ });
48258
+ }
48259
+ });
48254
48260
  return diagnostics2 || emptyArray;
48255
48261
  } finally {
48256
48262
  cancellationToken = void 0;
@@ -48280,7 +48286,7 @@ function createTypeChecker(host) {
48280
48286
  candidates,
48281
48287
  /*argumentCount*/
48282
48288
  void 0,
48283
- 32 /* IsForStringLiteralArgumentCompletions */
48289
+ 0 /* Normal */
48284
48290
  ));
48285
48291
  for (const candidate of candidates) {
48286
48292
  candidatesSet.add(candidate);
@@ -48747,7 +48753,7 @@ function createTypeChecker(host) {
48747
48753
  var deferredGlobalClassAccessorDecoratorTargetType;
48748
48754
  var deferredGlobalClassAccessorDecoratorResultType;
48749
48755
  var deferredGlobalClassFieldDecoratorContextType;
48750
- var allPotentiallyUnusedOrUninitializedIdentifiers = /* @__PURE__ */ new Map();
48756
+ var allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map();
48751
48757
  var flowLoopStart = 0;
48752
48758
  var flowLoopCount = 0;
48753
48759
  var sharedFlowCount = 0;
@@ -49458,10 +49464,10 @@ function createTypeChecker(host) {
49458
49464
  function isConstAssertion(location) {
49459
49465
  return isAssertionExpression(location) && isConstTypeReference(location.type) || isJSDocTypeTag(location) && isConstTypeReference(location.typeExpression);
49460
49466
  }
49461
- function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals = false, getSpellingSuggestions = true, isWritten = false) {
49462
- return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, isWritten, getSymbol2);
49467
+ function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals = false, getSpellingSuggestions = true) {
49468
+ return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, getSymbol2);
49463
49469
  }
49464
- function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, isWritten, lookup) {
49470
+ function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) {
49465
49471
  var _a, _b, _c;
49466
49472
  const originalLocation = location;
49467
49473
  let result;
@@ -49687,9 +49693,6 @@ function createTypeChecker(host) {
49687
49693
  if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) {
49688
49694
  result.isReferenced |= meaning;
49689
49695
  }
49690
- if (isWritten && result) {
49691
- result.isAssigned = true;
49692
- }
49693
49696
  if (!result) {
49694
49697
  if (lastLocation) {
49695
49698
  Debug.assertNode(lastLocation, isSourceFile);
@@ -56318,7 +56321,7 @@ function createTypeChecker(host) {
56318
56321
  return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0;
56319
56322
  }
56320
56323
  function getTypeForBindingElement(declaration) {
56321
- const checkMode = declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */;
56324
+ const checkMode = declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
56322
56325
  const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
56323
56326
  return parentType && getBindingElementTypeFromParentType(
56324
56327
  declaration,
@@ -68485,7 +68488,7 @@ function createTypeChecker(host) {
68485
68488
  if (!couldContainTypeVariables(target)) {
68486
68489
  return;
68487
68490
  }
68488
- if (source === wildcardType) {
68491
+ if (source === wildcardType || source === blockedStringType) {
68489
68492
  const savePropagationType = propagationType;
68490
68493
  propagationType = source;
68491
68494
  inferFromTypes(target, target);
@@ -68542,6 +68545,10 @@ function createTypeChecker(host) {
68542
68545
  return;
68543
68546
  }
68544
68547
  if (!inference.isFixed) {
68548
+ const candidate = propagationType || source;
68549
+ if (candidate === blockedStringType) {
68550
+ return;
68551
+ }
68545
68552
  if (inference.priority === void 0 || priority < inference.priority) {
68546
68553
  inference.candidates = void 0;
68547
68554
  inference.contraCandidates = void 0;
@@ -68549,7 +68556,6 @@ function createTypeChecker(host) {
68549
68556
  inference.priority = priority;
68550
68557
  }
68551
68558
  if (priority === inference.priority) {
68552
- const candidate = propagationType || source;
68553
68559
  if (contravariant && !bivariant) {
68554
68560
  if (!contains(inference.contraCandidates, candidate)) {
68555
68561
  inference.contraCandidates = append(inference.contraCandidates, candidate);
@@ -69121,7 +69127,7 @@ function createTypeChecker(host) {
69121
69127
  const constraint = getConstraintOfTypeParameter(inference.typeParameter);
69122
69128
  if (constraint) {
69123
69129
  const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
69124
- if (!inferredType || inferredType === blockedStringType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
69130
+ if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
69125
69131
  inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
69126
69132
  }
69127
69133
  }
@@ -69197,10 +69203,7 @@ function createTypeChecker(host) {
69197
69203
  node,
69198
69204
  !isWriteOnlyAccess(node),
69199
69205
  /*excludeGlobals*/
69200
- false,
69201
- /*getSpellingSuggestions*/
69202
- void 0,
69203
- isWriteAccess(node)
69206
+ false
69204
69207
  ) || unknownSymbol;
69205
69208
  }
69206
69209
  return links.resolvedSymbol;
@@ -69975,7 +69978,10 @@ function createTypeChecker(host) {
69975
69978
  let signature = links.effectsSignature;
69976
69979
  if (signature === void 0) {
69977
69980
  let funcType;
69978
- if (node.parent.kind === 244 /* ExpressionStatement */) {
69981
+ if (isBinaryExpression(node)) {
69982
+ const rightType = checkNonNullExpression(node.right);
69983
+ funcType = getSymbolHasInstanceMethodOfObjectType(rightType);
69984
+ } else if (node.parent.kind === 244 /* ExpressionStatement */) {
69979
69985
  funcType = getTypeOfDottedName(
69980
69986
  node.expression,
69981
69987
  /*diagnostic*/
@@ -70999,7 +71005,22 @@ function createTypeChecker(host) {
70999
71005
  }
71000
71006
  return type;
71001
71007
  }
71002
- const rightType = getTypeOfExpression(expr.right);
71008
+ const right = expr.right;
71009
+ const rightType = getTypeOfExpression(right);
71010
+ if (!isTypeDerivedFrom(rightType, globalObjectType)) {
71011
+ return type;
71012
+ }
71013
+ const signature = getEffectsSignature(expr);
71014
+ const predicate = signature && getTypePredicateOfSignature(signature);
71015
+ if (predicate && predicate.kind === 1 /* Identifier */ && predicate.parameterIndex === 0) {
71016
+ return getNarrowedType(
71017
+ type,
71018
+ predicate.type,
71019
+ assumeTrue,
71020
+ /*checkDerived*/
71021
+ true
71022
+ );
71023
+ }
71003
71024
  if (!isTypeDerivedFrom(rightType, globalFunctionType)) {
71004
71025
  return type;
71005
71026
  }
@@ -71251,7 +71272,7 @@ function createTypeChecker(host) {
71251
71272
  return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithoutNullableConstraint) : !!(type.flags & 465829888 /* Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* Nullable */));
71252
71273
  }
71253
71274
  function hasContextualTypeWithNoGenericTypes(node, checkMode) {
71254
- const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 64 /* RestBindingElement */ ? getContextualType2(node, 8 /* SkipBindingPatterns */) : getContextualType2(
71275
+ const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 32 /* RestBindingElement */ ? getContextualType2(node, 8 /* SkipBindingPatterns */) : getContextualType2(
71255
71276
  node,
71256
71277
  /*contextFlags*/
71257
71278
  void 0
@@ -72011,7 +72032,7 @@ function createTypeChecker(host) {
72011
72032
  function getContextualTypeForBindingElement(declaration, contextFlags) {
72012
72033
  const parent2 = declaration.parent.parent;
72013
72034
  const name = declaration.propertyName || declaration.name;
72014
- const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 208 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */);
72035
+ const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 208 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */);
72015
72036
  if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name))
72016
72037
  return void 0;
72017
72038
  if (parent2.name.kind === 207 /* ArrayBindingPattern */) {
@@ -74634,8 +74655,6 @@ function createTypeChecker(host) {
74634
74655
  false,
74635
74656
  /*getSpellingSuggestions*/
74636
74657
  true,
74637
- /*isWritten*/
74638
- false,
74639
74658
  (symbols, name, meaning2) => {
74640
74659
  Debug.assertEqual(outerName, name, "name should equal outerName");
74641
74660
  const symbol = getSymbol2(symbols, name, meaning2);
@@ -74859,7 +74878,9 @@ function createTypeChecker(host) {
74859
74878
  checkExpression(node.template);
74860
74879
  } else if (isJsxOpeningLikeElement(node)) {
74861
74880
  checkExpression(node.attributes);
74862
- } else if (node.kind !== 170 /* Decorator */) {
74881
+ } else if (isBinaryExpression(node)) {
74882
+ checkExpression(node.left);
74883
+ } else if (isCallOrNewExpression(node)) {
74863
74884
  forEach(node.arguments, (argument) => {
74864
74885
  checkExpression(argument);
74865
74886
  });
@@ -74932,6 +74953,8 @@ function createTypeChecker(host) {
74932
74953
  }
74933
74954
  } else if (node.kind === 170 /* Decorator */) {
74934
74955
  argCount = getDecoratorArgumentCount(node, signature);
74956
+ } else if (node.kind === 226 /* BinaryExpression */) {
74957
+ argCount = 1;
74935
74958
  } else if (isJsxOpeningLikeElement(node)) {
74936
74959
  callIsIncomplete = node.attributes.end === node.end;
74937
74960
  if (callIsIncomplete) {
@@ -75031,13 +75054,13 @@ function createTypeChecker(host) {
75031
75054
  return voidType;
75032
75055
  }
75033
75056
  const thisArgumentType = checkExpression(thisArgumentNode);
75034
- return isOptionalChainRoot(thisArgumentNode.parent) ? getNonNullableType(thisArgumentType) : isOptionalChain(thisArgumentNode.parent) ? removeOptionalTypeMarker(thisArgumentType) : thisArgumentType;
75057
+ return isRightSideOfInstanceofExpression(thisArgumentNode) ? thisArgumentType : isOptionalChainRoot(thisArgumentNode.parent) ? getNonNullableType(thisArgumentType) : isOptionalChain(thisArgumentNode.parent) ? removeOptionalTypeMarker(thisArgumentType) : thisArgumentType;
75035
75058
  }
75036
75059
  function inferTypeArguments(node, signature, args, checkMode, context) {
75037
75060
  if (isJsxOpeningLikeElement(node)) {
75038
75061
  return inferJsxTypeArguments(node, signature, checkMode, context);
75039
75062
  }
75040
- if (node.kind !== 170 /* Decorator */) {
75063
+ if (node.kind !== 170 /* Decorator */ && node.kind !== 226 /* BinaryExpression */) {
75041
75064
  const skipBindingPatterns = every(signature.typeParameters, (p) => !!getDefaultFromTypeParameter(p));
75042
75065
  const contextualType = getContextualType2(node, skipBindingPatterns ? 8 /* SkipBindingPatterns */ : 0 /* None */);
75043
75066
  if (contextualType) {
@@ -75074,7 +75097,7 @@ function createTypeChecker(host) {
75074
75097
  }
75075
75098
  for (let i = 0; i < argCount; i++) {
75076
75099
  const arg = args[i];
75077
- if (arg.kind !== 232 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
75100
+ if (arg.kind !== 232 /* OmittedExpression */) {
75078
75101
  const paramType = getTypeAtPosition(signature, i);
75079
75102
  if (couldContainTypeVariables(paramType)) {
75080
75103
  const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -75366,6 +75389,9 @@ function createTypeChecker(host) {
75366
75389
  }
75367
75390
  }
75368
75391
  function getThisArgumentOfCall(node) {
75392
+ if (node.kind === 226 /* BinaryExpression */) {
75393
+ return node.right;
75394
+ }
75369
75395
  const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : node.kind === 170 /* Decorator */ && !legacyDecorators ? node.expression : void 0;
75370
75396
  if (expression) {
75371
75397
  const callee = skipOuterExpressions(expression);
@@ -75394,6 +75420,9 @@ function createTypeChecker(host) {
75394
75420
  if (node.kind === 170 /* Decorator */) {
75395
75421
  return getEffectiveDecoratorArguments(node);
75396
75422
  }
75423
+ if (node.kind === 226 /* BinaryExpression */) {
75424
+ return [node.left];
75425
+ }
75397
75426
  if (isJsxOpeningLikeElement(node)) {
75398
75427
  return node.attributes.properties.length > 0 || isJsxOpeningElement(node) && node.parent.children.length > 0 ? [node.attributes] : emptyArray;
75399
75428
  }
@@ -75663,9 +75692,10 @@ function createTypeChecker(host) {
75663
75692
  const isTaggedTemplate = node.kind === 215 /* TaggedTemplateExpression */;
75664
75693
  const isDecorator2 = node.kind === 170 /* Decorator */;
75665
75694
  const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
75695
+ const isInstanceof = node.kind === 226 /* BinaryExpression */;
75666
75696
  const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray;
75667
75697
  let typeArguments;
75668
- if (!isDecorator2 && !isSuperCall(node)) {
75698
+ if (!isDecorator2 && !isInstanceof && !isSuperCall(node)) {
75669
75699
  typeArguments = node.typeArguments;
75670
75700
  if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 108 /* SuperKeyword */) {
75671
75701
  forEach(typeArguments, checkSourceElement);
@@ -75677,7 +75707,6 @@ function createTypeChecker(host) {
75677
75707
  const args = getEffectiveCallArguments(node);
75678
75708
  const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
75679
75709
  let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
75680
- argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
75681
75710
  let candidatesForArgumentError;
75682
75711
  let candidateForArgumentArityError;
75683
75712
  let candidateForTypeArgumentError;
@@ -75695,6 +75724,9 @@ function createTypeChecker(host) {
75695
75724
  result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
75696
75725
  getNodeLinks(node).resolvedSignature = result;
75697
75726
  if (reportErrors2) {
75727
+ if (!headMessage && isInstanceof) {
75728
+ headMessage = Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method;
75729
+ }
75698
75730
  if (candidatesForArgumentError) {
75699
75731
  if (candidatesForArgumentError.length === 1 || candidatesForArgumentError.length > 3) {
75700
75732
  const last2 = candidatesForArgumentError[candidatesForArgumentError.length - 1];
@@ -76481,6 +76513,30 @@ function createTypeChecker(host) {
76481
76513
  }
76482
76514
  return resolveCall(node, signatures, candidatesOutArray, checkMode, 0 /* None */);
76483
76515
  }
76516
+ function resolveInstanceofExpression(node, candidatesOutArray, checkMode) {
76517
+ const rightType = checkExpression(node.right);
76518
+ if (!isTypeAny(rightType)) {
76519
+ const hasInstanceMethodType = getSymbolHasInstanceMethodOfObjectType(rightType);
76520
+ if (hasInstanceMethodType) {
76521
+ const apparentType = getApparentType(hasInstanceMethodType);
76522
+ if (isErrorType(apparentType)) {
76523
+ return resolveErrorCall(node);
76524
+ }
76525
+ const callSignatures = getSignaturesOfType(apparentType, 0 /* Call */);
76526
+ const constructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */);
76527
+ if (isUntypedFunctionCall(hasInstanceMethodType, apparentType, callSignatures.length, constructSignatures.length)) {
76528
+ return resolveUntypedCall(node);
76529
+ }
76530
+ if (callSignatures.length) {
76531
+ return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */);
76532
+ }
76533
+ } else if (!(typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) {
76534
+ error2(node.right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method);
76535
+ return resolveErrorCall(node);
76536
+ }
76537
+ }
76538
+ return anySignature;
76539
+ }
76484
76540
  function isPotentiallyUncalledDecorator(decorator, signatures) {
76485
76541
  return signatures.length && every(signatures, (signature) => signature.minArgumentCount === 0 && !signatureHasRestParameter(signature) && signature.parameters.length < getDecoratorArgumentCount(decorator, signature));
76486
76542
  }
@@ -76497,6 +76553,8 @@ function createTypeChecker(host) {
76497
76553
  case 286 /* JsxOpeningElement */:
76498
76554
  case 285 /* JsxSelfClosingElement */:
76499
76555
  return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode);
76556
+ case 226 /* BinaryExpression */:
76557
+ return resolveInstanceofExpression(node, candidatesOutArray, checkMode);
76500
76558
  }
76501
76559
  Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
76502
76560
  }
@@ -78455,16 +78513,35 @@ function createTypeChecker(host) {
78455
78513
  function isConstEnumSymbol(symbol) {
78456
78514
  return (symbol.flags & 128 /* ConstEnum */) !== 0;
78457
78515
  }
78458
- function checkInstanceOfExpression(left, right, leftType, rightType) {
78516
+ function getSymbolHasInstanceMethodOfObjectType(type) {
78517
+ const hasInstancePropertyName = getPropertyNameForKnownSymbolName("hasInstance");
78518
+ const hasInstanceProperty = getPropertyOfObjectType(type, hasInstancePropertyName);
78519
+ if (hasInstanceProperty) {
78520
+ const hasInstancePropertyType = getTypeOfSymbol(hasInstanceProperty);
78521
+ if (hasInstancePropertyType && getSignaturesOfType(hasInstancePropertyType, 0 /* Call */).length !== 0) {
78522
+ return hasInstancePropertyType;
78523
+ }
78524
+ }
78525
+ }
78526
+ function checkInstanceOfExpression(left, right, leftType, rightType, checkMode) {
78459
78527
  if (leftType === silentNeverType || rightType === silentNeverType) {
78460
78528
  return silentNeverType;
78461
78529
  }
78462
78530
  if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType, 402784252 /* Primitive */)) {
78463
78531
  error2(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);
78464
78532
  }
78465
- if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) {
78466
- error2(right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type);
78533
+ Debug.assert(isInstanceOfExpression(left.parent));
78534
+ const signature = getResolvedSignature(
78535
+ left.parent,
78536
+ /*candidatesOutArray*/
78537
+ void 0,
78538
+ checkMode
78539
+ );
78540
+ if (signature === resolvingSignature) {
78541
+ return silentNeverType;
78467
78542
  }
78543
+ const returnType = getReturnTypeOfSignature(signature);
78544
+ checkTypeAssignableTo(returnType, booleanType, right, Diagnostics.An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression);
78468
78545
  return booleanType;
78469
78546
  }
78470
78547
  function hasEmptyObjectIntersection(type) {
@@ -79002,7 +79079,7 @@ function createTypeChecker(host) {
79002
79079
  case 36 /* ExclamationEqualsToken */:
79003
79080
  case 37 /* EqualsEqualsEqualsToken */:
79004
79081
  case 38 /* ExclamationEqualsEqualsToken */:
79005
- if (!(checkMode && checkMode & 128 /* TypeOnly */)) {
79082
+ if (!(checkMode && checkMode & 64 /* TypeOnly */)) {
79006
79083
  if ((isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) && // only report for === and !== in JS, not == or !=
79007
79084
  (!isInJSFile(left) || (operator === 37 /* EqualsEqualsEqualsToken */ || operator === 38 /* ExclamationEqualsEqualsToken */))) {
79008
79085
  const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
@@ -79013,7 +79090,7 @@ function createTypeChecker(host) {
79013
79090
  }
79014
79091
  return booleanType;
79015
79092
  case 104 /* InstanceOfKeyword */:
79016
- return checkInstanceOfExpression(left, right, leftType, rightType);
79093
+ return checkInstanceOfExpression(left, right, leftType, rightType, checkMode);
79017
79094
  case 103 /* InKeyword */:
79018
79095
  return checkInExpression(left, right, leftType, rightType);
79019
79096
  case 56 /* AmpersandAmpersandToken */:
@@ -79650,7 +79727,7 @@ function createTypeChecker(host) {
79650
79727
  }
79651
79728
  }
79652
79729
  const startInvocationCount = flowInvocationCount;
79653
- const type = checkExpression(node, 128 /* TypeOnly */);
79730
+ const type = checkExpression(node, 64 /* TypeOnly */);
79654
79731
  if (flowInvocationCount !== startInvocationCount) {
79655
79732
  const cache = flowTypeCache || (flowTypeCache = []);
79656
79733
  cache[getNodeId(node)] = type;
@@ -80090,7 +80167,7 @@ function createTypeChecker(host) {
80090
80167
  }
80091
80168
  }
80092
80169
  if (node.kind !== 181 /* IndexSignature */ && node.kind !== 324 /* JSDocFunctionType */) {
80093
- registerForUnusedOrUninitializedIdentifiersCheck(node);
80170
+ registerForUnusedIdentifiersCheck(node);
80094
80171
  }
80095
80172
  }
80096
80173
  }
@@ -80635,7 +80712,7 @@ function createTypeChecker(host) {
80635
80712
  }
80636
80713
  }
80637
80714
  }
80638
- registerForUnusedOrUninitializedIdentifiersCheck(node);
80715
+ registerForUnusedIdentifiersCheck(node);
80639
80716
  }
80640
80717
  function checkTemplateLiteralType(node) {
80641
80718
  for (const span of node.templateSpans) {
@@ -81621,27 +81698,25 @@ function createTypeChecker(host) {
81621
81698
  }
81622
81699
  }
81623
81700
  }
81624
- function registerForUnusedOrUninitializedIdentifiersCheck(node) {
81625
- addLazyDiagnostic(registerForUnusedOrUninitializedIdentifiersCheckDiagnostics);
81626
- function registerForUnusedOrUninitializedIdentifiersCheckDiagnostics() {
81701
+ function registerForUnusedIdentifiersCheck(node) {
81702
+ addLazyDiagnostic(registerForUnusedIdentifiersCheckDiagnostics);
81703
+ function registerForUnusedIdentifiersCheckDiagnostics() {
81627
81704
  const sourceFile = getSourceFileOfNode(node);
81628
- let potentiallyUnusedOrUninitializedIdentifiers = allPotentiallyUnusedOrUninitializedIdentifiers.get(sourceFile.path);
81629
- if (!potentiallyUnusedOrUninitializedIdentifiers) {
81630
- potentiallyUnusedOrUninitializedIdentifiers = [];
81631
- allPotentiallyUnusedOrUninitializedIdentifiers.set(sourceFile.path, potentiallyUnusedOrUninitializedIdentifiers);
81705
+ let potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path);
81706
+ if (!potentiallyUnusedIdentifiers) {
81707
+ potentiallyUnusedIdentifiers = [];
81708
+ allPotentiallyUnusedIdentifiers.set(sourceFile.path, potentiallyUnusedIdentifiers);
81632
81709
  }
81633
- potentiallyUnusedOrUninitializedIdentifiers.push(node);
81710
+ potentiallyUnusedIdentifiers.push(node);
81634
81711
  }
81635
81712
  }
81636
- function checkUnusedOrUninitializedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic, checkUnused, checkUninitialized) {
81713
+ function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) {
81637
81714
  for (const node of potentiallyUnusedIdentifiers) {
81638
81715
  switch (node.kind) {
81639
81716
  case 263 /* ClassDeclaration */:
81640
81717
  case 231 /* ClassExpression */:
81641
- if (checkUnused) {
81642
- checkUnusedClassMembers(node, addDiagnostic);
81643
- checkUnusedTypeParameters(node, addDiagnostic);
81644
- }
81718
+ checkUnusedClassMembers(node, addDiagnostic);
81719
+ checkUnusedTypeParameters(node, addDiagnostic);
81645
81720
  break;
81646
81721
  case 312 /* SourceFile */:
81647
81722
  case 267 /* ModuleDeclaration */:
@@ -81650,12 +81725,7 @@ function createTypeChecker(host) {
81650
81725
  case 248 /* ForStatement */:
81651
81726
  case 249 /* ForInStatement */:
81652
81727
  case 250 /* ForOfStatement */:
81653
- if (checkUnused) {
81654
- checkUnusedLocalsAndParameters(node, addDiagnostic);
81655
- }
81656
- if (checkUninitialized) {
81657
- checkUninitializedLocals(node);
81658
- }
81728
+ checkUnusedLocalsAndParameters(node, addDiagnostic);
81659
81729
  break;
81660
81730
  case 176 /* Constructor */:
81661
81731
  case 218 /* FunctionExpression */:
@@ -81664,15 +81734,10 @@ function createTypeChecker(host) {
81664
81734
  case 174 /* MethodDeclaration */:
81665
81735
  case 177 /* GetAccessor */:
81666
81736
  case 178 /* SetAccessor */:
81667
- if (checkUnused) {
81668
- if (node.body) {
81669
- checkUnusedLocalsAndParameters(node, addDiagnostic);
81670
- }
81671
- checkUnusedTypeParameters(node, addDiagnostic);
81672
- }
81673
- if (checkUninitialized) {
81674
- checkUninitializedLocals(node);
81737
+ if (node.body) {
81738
+ checkUnusedLocalsAndParameters(node, addDiagnostic);
81675
81739
  }
81740
+ checkUnusedTypeParameters(node, addDiagnostic);
81676
81741
  break;
81677
81742
  case 173 /* MethodSignature */:
81678
81743
  case 179 /* CallSignature */:
@@ -81681,14 +81746,10 @@ function createTypeChecker(host) {
81681
81746
  case 185 /* ConstructorType */:
81682
81747
  case 265 /* TypeAliasDeclaration */:
81683
81748
  case 264 /* InterfaceDeclaration */:
81684
- if (checkUnused) {
81685
- checkUnusedTypeParameters(node, addDiagnostic);
81686
- }
81749
+ checkUnusedTypeParameters(node, addDiagnostic);
81687
81750
  break;
81688
81751
  case 195 /* InferType */:
81689
- if (checkUnused) {
81690
- checkUnusedInferTypeParameter(node, addDiagnostic);
81691
- }
81752
+ checkUnusedInferTypeParameter(node, addDiagnostic);
81692
81753
  break;
81693
81754
  default:
81694
81755
  Debug.assertNever(node, "Node should not have been registered for unused identifiers check");
@@ -81878,26 +81939,6 @@ function createTypeChecker(host) {
81878
81939
  }
81879
81940
  });
81880
81941
  }
81881
- function checkUninitializedLocals(nodeWithLocals) {
81882
- nodeWithLocals.locals.forEach((local) => {
81883
- if (!(local.flags & 3 /* Variable */) || local.isAssigned || !local.isReferenced) {
81884
- return;
81885
- }
81886
- const declaration = local.valueDeclaration;
81887
- if (!declaration) {
81888
- return;
81889
- }
81890
- if (isVariableDeclaration(declaration)) {
81891
- if (getCombinedNodeFlagsCached(declaration) & 33554432 /* Ambient */ || declaration.exclamationToken || declaration.initializer || !declaration.type) {
81892
- return;
81893
- }
81894
- const type = getTypeFromTypeNode(declaration.type);
81895
- if (!(type.flags & 3 /* AnyOrUnknown */) && !containsUndefinedType(type)) {
81896
- error2(declaration, Diagnostics.Variable_0_is_used_before_being_assigned, idText(declaration.name));
81897
- }
81898
- }
81899
- });
81900
- }
81901
81942
  function checkPotentialUncheckedRenamedBindingElementsInTypes() {
81902
81943
  var _a;
81903
81944
  for (const node of potentialUnusedRenamedBindingElementsInTypes) {
@@ -81944,7 +81985,7 @@ function createTypeChecker(host) {
81944
81985
  forEach(node.statements, checkSourceElement);
81945
81986
  }
81946
81987
  if (node.locals) {
81947
- registerForUnusedOrUninitializedIdentifiersCheck(node);
81988
+ registerForUnusedIdentifiersCheck(node);
81948
81989
  }
81949
81990
  }
81950
81991
  function checkCollisionWithArgumentsInGeneratedCode(node) {
@@ -82152,7 +82193,7 @@ function createTypeChecker(host) {
82152
82193
  checkComputedPropertyName(node.propertyName);
82153
82194
  }
82154
82195
  const parent2 = node.parent.parent;
82155
- const parentCheckMode = node.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */;
82196
+ const parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
82156
82197
  const parentType = getTypeForBindingElementParent(parent2, parentCheckMode);
82157
82198
  const name = node.propertyName || node.name;
82158
82199
  if (parentType && !isBindingPattern(name)) {
@@ -82494,7 +82535,7 @@ function createTypeChecker(host) {
82494
82535
  checkExpression(node.incrementor);
82495
82536
  checkSourceElement(node.statement);
82496
82537
  if (node.locals) {
82497
- registerForUnusedOrUninitializedIdentifiersCheck(node);
82538
+ registerForUnusedIdentifiersCheck(node);
82498
82539
  }
82499
82540
  }
82500
82541
  function checkForOfStatement(node) {
@@ -82533,7 +82574,7 @@ function createTypeChecker(host) {
82533
82574
  }
82534
82575
  checkSourceElement(node.statement);
82535
82576
  if (node.locals) {
82536
- registerForUnusedOrUninitializedIdentifiersCheck(node);
82577
+ registerForUnusedIdentifiersCheck(node);
82537
82578
  }
82538
82579
  }
82539
82580
  function checkForInStatement(node) {
@@ -82565,7 +82606,7 @@ function createTypeChecker(host) {
82565
82606
  }
82566
82607
  checkSourceElement(node.statement);
82567
82608
  if (node.locals) {
82568
- registerForUnusedOrUninitializedIdentifiersCheck(node);
82609
+ registerForUnusedIdentifiersCheck(node);
82569
82610
  }
82570
82611
  }
82571
82612
  function checkRightHandSideOfForOf(statement) {
@@ -83297,7 +83338,7 @@ function createTypeChecker(host) {
83297
83338
  }
83298
83339
  });
83299
83340
  if (node.caseBlock.locals) {
83300
- registerForUnusedOrUninitializedIdentifiersCheck(node.caseBlock);
83341
+ registerForUnusedIdentifiersCheck(node.caseBlock);
83301
83342
  }
83302
83343
  }
83303
83344
  function checkLabeledStatement(node) {
@@ -83637,7 +83678,7 @@ function createTypeChecker(host) {
83637
83678
  }
83638
83679
  function checkClassExpressionDeferred(node) {
83639
83680
  forEach(node.members, checkSourceElement);
83640
- registerForUnusedOrUninitializedIdentifiersCheck(node);
83681
+ registerForUnusedIdentifiersCheck(node);
83641
83682
  }
83642
83683
  function checkClassDeclaration(node) {
83643
83684
  const firstDecorator = find(node.modifiers, isDecorator);
@@ -83649,7 +83690,7 @@ function createTypeChecker(host) {
83649
83690
  }
83650
83691
  checkClassLikeDeclaration(node);
83651
83692
  forEach(node.members, checkSourceElement);
83652
- registerForUnusedOrUninitializedIdentifiersCheck(node);
83693
+ registerForUnusedIdentifiersCheck(node);
83653
83694
  }
83654
83695
  function checkClassLikeDeclaration(node) {
83655
83696
  checkGrammarClassLikeDeclaration(node);
@@ -84210,7 +84251,7 @@ function createTypeChecker(host) {
84210
84251
  forEach(node.members, checkSourceElement);
84211
84252
  addLazyDiagnostic(() => {
84212
84253
  checkTypeForDuplicateIndexSignatures(node);
84213
- registerForUnusedOrUninitializedIdentifiersCheck(node);
84254
+ registerForUnusedIdentifiersCheck(node);
84214
84255
  });
84215
84256
  }
84216
84257
  function checkTypeAliasDeclaration(node) {
@@ -84224,7 +84265,7 @@ function createTypeChecker(host) {
84224
84265
  }
84225
84266
  } else {
84226
84267
  checkSourceElement(node.type);
84227
- registerForUnusedOrUninitializedIdentifiersCheck(node);
84268
+ registerForUnusedIdentifiersCheck(node);
84228
84269
  }
84229
84270
  }
84230
84271
  function computeEnumMemberValues(node) {
@@ -84495,7 +84536,7 @@ function createTypeChecker(host) {
84495
84536
  if (node.body) {
84496
84537
  checkSourceElement(node.body);
84497
84538
  if (!isGlobalScopeAugmentation(node)) {
84498
- registerForUnusedOrUninitializedIdentifiersCheck(node);
84539
+ registerForUnusedIdentifiersCheck(node);
84499
84540
  }
84500
84541
  }
84501
84542
  addLazyDiagnostic(checkModuleDeclarationDiagnostics);
@@ -85461,6 +85502,12 @@ function createTypeChecker(host) {
85461
85502
  case 234 /* AsExpression */:
85462
85503
  case 217 /* ParenthesizedExpression */:
85463
85504
  checkAssertionDeferred(node);
85505
+ break;
85506
+ case 226 /* BinaryExpression */:
85507
+ if (isInstanceOfExpression(node)) {
85508
+ resolveUntypedCall(node);
85509
+ }
85510
+ break;
85464
85511
  }
85465
85512
  currentNode = saveCurrentNode;
85466
85513
  (_b = tracing) == null ? void 0 : _b.pop();
@@ -85493,8 +85540,8 @@ function createTypeChecker(host) {
85493
85540
  return Debug.assertNever(kind);
85494
85541
  }
85495
85542
  }
85496
- function getPotentiallyUnusedOrUninitializedIdentifiers(sourceFile) {
85497
- return allPotentiallyUnusedOrUninitializedIdentifiers.get(sourceFile.path) || emptyArray;
85543
+ function getPotentiallyUnusedIdentifiers(sourceFile) {
85544
+ return allPotentiallyUnusedIdentifiers.get(sourceFile.path) || emptyArray;
85498
85545
  }
85499
85546
  function checkSourceFileWorker(node) {
85500
85547
  const links = getNodeLinks(node);
@@ -85512,21 +85559,15 @@ function createTypeChecker(host) {
85512
85559
  checkSourceElement(node.endOfFileToken);
85513
85560
  checkDeferredNodes(node);
85514
85561
  if (isExternalOrCommonJsModule(node)) {
85515
- registerForUnusedOrUninitializedIdentifiersCheck(node);
85562
+ registerForUnusedIdentifiersCheck(node);
85516
85563
  }
85517
85564
  addLazyDiagnostic(() => {
85518
- const checkUnused = !node.isDeclarationFile && (compilerOptions.noUnusedLocals || compilerOptions.noUnusedParameters);
85519
- if (checkUnused || strictNullChecks) {
85520
- checkUnusedOrUninitializedIdentifiers(
85521
- getPotentiallyUnusedOrUninitializedIdentifiers(node),
85522
- (containingNode, kind, diag2) => {
85523
- if (!containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 33554432 /* Ambient */))) {
85524
- diagnostics.add(diag2);
85525
- }
85526
- },
85527
- checkUnused,
85528
- strictNullChecks
85529
- );
85565
+ if (!node.isDeclarationFile && (compilerOptions.noUnusedLocals || compilerOptions.noUnusedParameters)) {
85566
+ checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(node), (containingNode, kind, diag2) => {
85567
+ if (!containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 33554432 /* Ambient */))) {
85568
+ diagnostics.add(diag2);
85569
+ }
85570
+ });
85530
85571
  }
85531
85572
  if (!node.isDeclarationFile) {
85532
85573
  checkPotentialUncheckedRenamedBindingElementsInTypes();
@@ -86083,6 +86124,13 @@ function createTypeChecker(host) {
86083
86124
  case 102 /* ImportKeyword */:
86084
86125
  case 105 /* NewKeyword */:
86085
86126
  return isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : void 0;
86127
+ case 104 /* InstanceOfKeyword */:
86128
+ if (isBinaryExpression(node.parent)) {
86129
+ const type = getTypeOfExpression(node.parent.right);
86130
+ const hasInstanceMethodType = getSymbolHasInstanceMethodOfObjectType(type);
86131
+ return (hasInstanceMethodType == null ? void 0 : hasInstanceMethodType.symbol) ?? type.symbol;
86132
+ }
86133
+ return void 0;
86086
86134
  case 236 /* MetaProperty */:
86087
86135
  return checkExpression(node).symbol;
86088
86136
  case 295 /* JsxNamespacedName */:
@@ -130553,10 +130601,10 @@ var LanguageServiceMode = /* @__PURE__ */ ((LanguageServiceMode2) => {
130553
130601
  return LanguageServiceMode2;
130554
130602
  })(LanguageServiceMode || {});
130555
130603
  var emptyOptions = {};
130556
- var SemanticClassificationFormat = /* @__PURE__ */ ((SemanticClassificationFormat3) => {
130557
- SemanticClassificationFormat3["Original"] = "original";
130558
- SemanticClassificationFormat3["TwentyTwenty"] = "2020";
130559
- return SemanticClassificationFormat3;
130604
+ var SemanticClassificationFormat = /* @__PURE__ */ ((SemanticClassificationFormat2) => {
130605
+ SemanticClassificationFormat2["Original"] = "original";
130606
+ SemanticClassificationFormat2["TwentyTwenty"] = "2020";
130607
+ return SemanticClassificationFormat2;
130560
130608
  })(SemanticClassificationFormat || {});
130561
130609
  var OrganizeImportsMode = /* @__PURE__ */ ((OrganizeImportsMode3) => {
130562
130610
  OrganizeImportsMode3["All"] = "All";
@@ -130673,15 +130721,15 @@ var OutputFileType = /* @__PURE__ */ ((OutputFileType2) => {
130673
130721
  OutputFileType2[OutputFileType2["Declaration"] = 2] = "Declaration";
130674
130722
  return OutputFileType2;
130675
130723
  })(OutputFileType || {});
130676
- var EndOfLineState = /* @__PURE__ */ ((EndOfLineState3) => {
130677
- EndOfLineState3[EndOfLineState3["None"] = 0] = "None";
130678
- EndOfLineState3[EndOfLineState3["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia";
130679
- EndOfLineState3[EndOfLineState3["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral";
130680
- EndOfLineState3[EndOfLineState3["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral";
130681
- EndOfLineState3[EndOfLineState3["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate";
130682
- EndOfLineState3[EndOfLineState3["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail";
130683
- EndOfLineState3[EndOfLineState3["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition";
130684
- return EndOfLineState3;
130724
+ var EndOfLineState = /* @__PURE__ */ ((EndOfLineState2) => {
130725
+ EndOfLineState2[EndOfLineState2["None"] = 0] = "None";
130726
+ EndOfLineState2[EndOfLineState2["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia";
130727
+ EndOfLineState2[EndOfLineState2["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral";
130728
+ EndOfLineState2[EndOfLineState2["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral";
130729
+ EndOfLineState2[EndOfLineState2["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate";
130730
+ EndOfLineState2[EndOfLineState2["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail";
130731
+ EndOfLineState2[EndOfLineState2["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition";
130732
+ return EndOfLineState2;
130685
130733
  })(EndOfLineState || {});
130686
130734
  var TokenClass = /* @__PURE__ */ ((TokenClass2) => {
130687
130735
  TokenClass2[TokenClass2["Punctuation"] = 0] = "Punctuation";
@@ -145490,926 +145538,6 @@ function transform(source, transformers, compilerOptions) {
145490
145538
  return result;
145491
145539
  }
145492
145540
 
145493
- // src/services/shims.ts
145494
- var debugObjectHost = function() {
145495
- return this;
145496
- }();
145497
- function logInternalError(logger, err) {
145498
- if (logger) {
145499
- logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message);
145500
- }
145501
- }
145502
- var ScriptSnapshotShimAdapter = class {
145503
- constructor(scriptSnapshotShim) {
145504
- this.scriptSnapshotShim = scriptSnapshotShim;
145505
- }
145506
- getText(start2, end) {
145507
- return this.scriptSnapshotShim.getText(start2, end);
145508
- }
145509
- getLength() {
145510
- return this.scriptSnapshotShim.getLength();
145511
- }
145512
- getChangeRange(oldSnapshot) {
145513
- const oldSnapshotShim = oldSnapshot;
145514
- const encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim);
145515
- if (encoded === null) {
145516
- return null;
145517
- }
145518
- const decoded = JSON.parse(encoded);
145519
- return createTextChangeRange(
145520
- createTextSpan(decoded.span.start, decoded.span.length),
145521
- decoded.newLength
145522
- );
145523
- }
145524
- dispose() {
145525
- if ("dispose" in this.scriptSnapshotShim) {
145526
- this.scriptSnapshotShim.dispose();
145527
- }
145528
- }
145529
- };
145530
- var LanguageServiceShimHostAdapter = class {
145531
- constructor(shimHost) {
145532
- this.shimHost = shimHost;
145533
- this.loggingEnabled = false;
145534
- this.tracingEnabled = false;
145535
- if ("getModuleResolutionsForFile" in this.shimHost) {
145536
- this.resolveModuleNames = (moduleNames, containingFile) => {
145537
- const resolutionsInFile = JSON.parse(this.shimHost.getModuleResolutionsForFile(containingFile));
145538
- return map(moduleNames, (name) => {
145539
- const result = getProperty(resolutionsInFile, name);
145540
- return result ? { resolvedFileName: result, extension: extensionFromPath(result), isExternalLibraryImport: false } : void 0;
145541
- });
145542
- };
145543
- }
145544
- if ("directoryExists" in this.shimHost) {
145545
- this.directoryExists = (directoryName) => this.shimHost.directoryExists(directoryName);
145546
- }
145547
- if ("getTypeReferenceDirectiveResolutionsForFile" in this.shimHost) {
145548
- this.resolveTypeReferenceDirectives = (typeDirectiveNames, containingFile) => {
145549
- const typeDirectivesForFile = JSON.parse(this.shimHost.getTypeReferenceDirectiveResolutionsForFile(containingFile));
145550
- return map(typeDirectiveNames, (name) => getProperty(typeDirectivesForFile, isString(name) ? name : toFileNameLowerCase(name.fileName)));
145551
- };
145552
- }
145553
- if ("jsDocParsingMode" in this.shimHost) {
145554
- this.jsDocParsingMode = this.shimHost.jsDocParsingMode;
145555
- }
145556
- }
145557
- log(s) {
145558
- if (this.loggingEnabled) {
145559
- this.shimHost.log(s);
145560
- }
145561
- }
145562
- trace(s) {
145563
- if (this.tracingEnabled) {
145564
- this.shimHost.trace(s);
145565
- }
145566
- }
145567
- error(s) {
145568
- this.shimHost.error(s);
145569
- }
145570
- getProjectVersion() {
145571
- if (!this.shimHost.getProjectVersion) {
145572
- return void 0;
145573
- }
145574
- return this.shimHost.getProjectVersion();
145575
- }
145576
- getTypeRootsVersion() {
145577
- if (!this.shimHost.getTypeRootsVersion) {
145578
- return 0;
145579
- }
145580
- return this.shimHost.getTypeRootsVersion();
145581
- }
145582
- useCaseSensitiveFileNames() {
145583
- return this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;
145584
- }
145585
- getCompilationSettings() {
145586
- const settingsJson = this.shimHost.getCompilationSettings();
145587
- if (settingsJson === null || settingsJson === "") {
145588
- throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");
145589
- }
145590
- const compilerOptions = JSON.parse(settingsJson);
145591
- compilerOptions.allowNonTsExtensions = true;
145592
- return compilerOptions;
145593
- }
145594
- getScriptFileNames() {
145595
- const encoded = this.shimHost.getScriptFileNames();
145596
- return JSON.parse(encoded);
145597
- }
145598
- getScriptSnapshot(fileName) {
145599
- const scriptSnapshot = this.shimHost.getScriptSnapshot(fileName);
145600
- return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot);
145601
- }
145602
- getScriptKind(fileName) {
145603
- if ("getScriptKind" in this.shimHost) {
145604
- return this.shimHost.getScriptKind(fileName);
145605
- } else {
145606
- return 0 /* Unknown */;
145607
- }
145608
- }
145609
- getScriptVersion(fileName) {
145610
- return this.shimHost.getScriptVersion(fileName);
145611
- }
145612
- getLocalizedDiagnosticMessages() {
145613
- const diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages();
145614
- if (diagnosticMessagesJson === null || diagnosticMessagesJson === "") {
145615
- return null;
145616
- }
145617
- try {
145618
- return JSON.parse(diagnosticMessagesJson);
145619
- } catch (e) {
145620
- this.log(e.description || "diagnosticMessages.generated.json has invalid JSON format");
145621
- return null;
145622
- }
145623
- }
145624
- getCancellationToken() {
145625
- const hostCancellationToken = this.shimHost.getCancellationToken();
145626
- return new ThrottledCancellationToken(hostCancellationToken);
145627
- }
145628
- getCurrentDirectory() {
145629
- return this.shimHost.getCurrentDirectory();
145630
- }
145631
- getDirectories(path) {
145632
- return JSON.parse(this.shimHost.getDirectories(path));
145633
- }
145634
- getDefaultLibFileName(options) {
145635
- return this.shimHost.getDefaultLibFileName(JSON.stringify(options));
145636
- }
145637
- readDirectory(path, extensions, exclude, include, depth) {
145638
- const pattern = getFileMatcherPatterns(path, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory());
145639
- return JSON.parse(this.shimHost.readDirectory(
145640
- path,
145641
- JSON.stringify(extensions),
145642
- JSON.stringify(pattern.basePaths),
145643
- pattern.excludePattern,
145644
- pattern.includeFilePattern,
145645
- pattern.includeDirectoryPattern,
145646
- depth
145647
- ));
145648
- }
145649
- readFile(path, encoding) {
145650
- return this.shimHost.readFile(path, encoding);
145651
- }
145652
- fileExists(path) {
145653
- return this.shimHost.fileExists(path);
145654
- }
145655
- };
145656
- var CoreServicesShimHostAdapter = class {
145657
- constructor(shimHost) {
145658
- this.shimHost = shimHost;
145659
- this.useCaseSensitiveFileNames = this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;
145660
- if ("directoryExists" in this.shimHost) {
145661
- this.directoryExists = (directoryName) => this.shimHost.directoryExists(directoryName);
145662
- } else {
145663
- this.directoryExists = void 0;
145664
- }
145665
- if ("realpath" in this.shimHost) {
145666
- this.realpath = (path) => this.shimHost.realpath(path);
145667
- } else {
145668
- this.realpath = void 0;
145669
- }
145670
- }
145671
- readDirectory(rootDir, extensions, exclude, include, depth) {
145672
- const pattern = getFileMatcherPatterns(rootDir, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory());
145673
- return JSON.parse(this.shimHost.readDirectory(
145674
- rootDir,
145675
- JSON.stringify(extensions),
145676
- JSON.stringify(pattern.basePaths),
145677
- pattern.excludePattern,
145678
- pattern.includeFilePattern,
145679
- pattern.includeDirectoryPattern,
145680
- depth
145681
- ));
145682
- }
145683
- fileExists(fileName) {
145684
- return this.shimHost.fileExists(fileName);
145685
- }
145686
- readFile(fileName) {
145687
- return this.shimHost.readFile(fileName);
145688
- }
145689
- getDirectories(path) {
145690
- return JSON.parse(this.shimHost.getDirectories(path));
145691
- }
145692
- };
145693
- function simpleForwardCall(logger, actionDescription2, action, logPerformance) {
145694
- let start2;
145695
- if (logPerformance) {
145696
- logger.log(actionDescription2);
145697
- start2 = timestamp();
145698
- }
145699
- const result = action();
145700
- if (logPerformance) {
145701
- const end = timestamp();
145702
- logger.log(`${actionDescription2} completed in ${end - start2} msec`);
145703
- if (isString(result)) {
145704
- let str = result;
145705
- if (str.length > 128) {
145706
- str = str.substring(0, 128) + "...";
145707
- }
145708
- logger.log(` result.length=${str.length}, result='${JSON.stringify(str)}'`);
145709
- }
145710
- }
145711
- return result;
145712
- }
145713
- function forwardJSONCall(logger, actionDescription2, action, logPerformance) {
145714
- return forwardCall(
145715
- logger,
145716
- actionDescription2,
145717
- /*returnJson*/
145718
- true,
145719
- action,
145720
- logPerformance
145721
- );
145722
- }
145723
- function forwardCall(logger, actionDescription2, returnJson, action, logPerformance) {
145724
- try {
145725
- const result = simpleForwardCall(logger, actionDescription2, action, logPerformance);
145726
- return returnJson ? JSON.stringify({ result }) : result;
145727
- } catch (err) {
145728
- if (err instanceof OperationCanceledException) {
145729
- return JSON.stringify({ canceled: true });
145730
- }
145731
- logInternalError(logger, err);
145732
- err.description = actionDescription2;
145733
- return JSON.stringify({ error: err });
145734
- }
145735
- }
145736
- var ShimBase = class {
145737
- constructor(factory2) {
145738
- this.factory = factory2;
145739
- factory2.registerShim(this);
145740
- }
145741
- dispose(_dummy) {
145742
- this.factory.unregisterShim(this);
145743
- }
145744
- };
145745
- function realizeDiagnostics(diagnostics, newLine) {
145746
- return diagnostics.map((d) => realizeDiagnostic(d, newLine));
145747
- }
145748
- function realizeDiagnostic(diagnostic, newLine) {
145749
- return {
145750
- message: flattenDiagnosticMessageText(diagnostic.messageText, newLine),
145751
- start: diagnostic.start,
145752
- // TODO: GH#18217
145753
- length: diagnostic.length,
145754
- // TODO: GH#18217
145755
- category: diagnosticCategoryName(diagnostic),
145756
- code: diagnostic.code,
145757
- reportsUnnecessary: diagnostic.reportsUnnecessary,
145758
- reportsDeprecated: diagnostic.reportsDeprecated
145759
- };
145760
- }
145761
- var LanguageServiceShimObject = class extends ShimBase {
145762
- constructor(factory2, host, languageService) {
145763
- super(factory2);
145764
- this.host = host;
145765
- this.languageService = languageService;
145766
- this.logPerformance = false;
145767
- this.logger = this.host;
145768
- }
145769
- forwardJSONCall(actionDescription2, action) {
145770
- return forwardJSONCall(this.logger, actionDescription2, action, this.logPerformance);
145771
- }
145772
- /// DISPOSE
145773
- /**
145774
- * Ensure (almost) deterministic release of internal Javascript resources when
145775
- * some external native objects holds onto us (e.g. Com/Interop).
145776
- */
145777
- dispose(dummy) {
145778
- this.logger.log("dispose()");
145779
- this.languageService.dispose();
145780
- this.languageService = null;
145781
- if (debugObjectHost && debugObjectHost.CollectGarbage) {
145782
- debugObjectHost.CollectGarbage();
145783
- this.logger.log("CollectGarbage()");
145784
- }
145785
- this.logger = null;
145786
- super.dispose(dummy);
145787
- }
145788
- /// REFRESH
145789
- /**
145790
- * Update the list of scripts known to the compiler
145791
- */
145792
- refresh(throwOnError) {
145793
- this.forwardJSONCall(
145794
- `refresh(${throwOnError})`,
145795
- () => null
145796
- // eslint-disable-line no-null/no-null
145797
- );
145798
- }
145799
- cleanupSemanticCache() {
145800
- this.forwardJSONCall(
145801
- "cleanupSemanticCache()",
145802
- () => {
145803
- this.languageService.cleanupSemanticCache();
145804
- return null;
145805
- }
145806
- );
145807
- }
145808
- realizeDiagnostics(diagnostics) {
145809
- const newLine = getNewLineOrDefaultFromHost(
145810
- this.host,
145811
- /*formatSettings*/
145812
- void 0
145813
- );
145814
- return realizeDiagnostics(diagnostics, newLine);
145815
- }
145816
- getSyntacticClassifications(fileName, start2, length2) {
145817
- return this.forwardJSONCall(
145818
- `getSyntacticClassifications('${fileName}', ${start2}, ${length2})`,
145819
- () => this.languageService.getSyntacticClassifications(fileName, createTextSpan(start2, length2))
145820
- );
145821
- }
145822
- getSemanticClassifications(fileName, start2, length2) {
145823
- return this.forwardJSONCall(
145824
- `getSemanticClassifications('${fileName}', ${start2}, ${length2})`,
145825
- () => this.languageService.getSemanticClassifications(fileName, createTextSpan(start2, length2))
145826
- );
145827
- }
145828
- getEncodedSyntacticClassifications(fileName, start2, length2) {
145829
- return this.forwardJSONCall(
145830
- `getEncodedSyntacticClassifications('${fileName}', ${start2}, ${length2})`,
145831
- // directly serialize the spans out to a string. This is much faster to decode
145832
- // on the managed side versus a full JSON array.
145833
- () => convertClassifications(this.languageService.getEncodedSyntacticClassifications(fileName, createTextSpan(start2, length2)))
145834
- );
145835
- }
145836
- getEncodedSemanticClassifications(fileName, start2, length2) {
145837
- return this.forwardJSONCall(
145838
- `getEncodedSemanticClassifications('${fileName}', ${start2}, ${length2})`,
145839
- // directly serialize the spans out to a string. This is much faster to decode
145840
- // on the managed side versus a full JSON array.
145841
- () => convertClassifications(this.languageService.getEncodedSemanticClassifications(fileName, createTextSpan(start2, length2)))
145842
- );
145843
- }
145844
- getSyntacticDiagnostics(fileName) {
145845
- return this.forwardJSONCall(
145846
- `getSyntacticDiagnostics('${fileName}')`,
145847
- () => {
145848
- const diagnostics = this.languageService.getSyntacticDiagnostics(fileName);
145849
- return this.realizeDiagnostics(diagnostics);
145850
- }
145851
- );
145852
- }
145853
- getSemanticDiagnostics(fileName) {
145854
- return this.forwardJSONCall(
145855
- `getSemanticDiagnostics('${fileName}')`,
145856
- () => {
145857
- const diagnostics = this.languageService.getSemanticDiagnostics(fileName);
145858
- return this.realizeDiagnostics(diagnostics);
145859
- }
145860
- );
145861
- }
145862
- getSuggestionDiagnostics(fileName) {
145863
- return this.forwardJSONCall(`getSuggestionDiagnostics('${fileName}')`, () => this.realizeDiagnostics(this.languageService.getSuggestionDiagnostics(fileName)));
145864
- }
145865
- getCompilerOptionsDiagnostics() {
145866
- return this.forwardJSONCall(
145867
- "getCompilerOptionsDiagnostics()",
145868
- () => {
145869
- const diagnostics = this.languageService.getCompilerOptionsDiagnostics();
145870
- return this.realizeDiagnostics(diagnostics);
145871
- }
145872
- );
145873
- }
145874
- /// QUICKINFO
145875
- /**
145876
- * Computes a string representation of the type at the requested position
145877
- * in the active file.
145878
- */
145879
- getQuickInfoAtPosition(fileName, position) {
145880
- return this.forwardJSONCall(
145881
- `getQuickInfoAtPosition('${fileName}', ${position})`,
145882
- () => this.languageService.getQuickInfoAtPosition(fileName, position)
145883
- );
145884
- }
145885
- /// NAMEORDOTTEDNAMESPAN
145886
- /**
145887
- * Computes span information of the name or dotted name at the requested position
145888
- * in the active file.
145889
- */
145890
- getNameOrDottedNameSpan(fileName, startPos, endPos) {
145891
- return this.forwardJSONCall(
145892
- `getNameOrDottedNameSpan('${fileName}', ${startPos}, ${endPos})`,
145893
- () => this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos)
145894
- );
145895
- }
145896
- /**
145897
- * STATEMENTSPAN
145898
- * Computes span information of statement at the requested position in the active file.
145899
- */
145900
- getBreakpointStatementAtPosition(fileName, position) {
145901
- return this.forwardJSONCall(
145902
- `getBreakpointStatementAtPosition('${fileName}', ${position})`,
145903
- () => this.languageService.getBreakpointStatementAtPosition(fileName, position)
145904
- );
145905
- }
145906
- /// SIGNATUREHELP
145907
- getSignatureHelpItems(fileName, position, options) {
145908
- return this.forwardJSONCall(
145909
- `getSignatureHelpItems('${fileName}', ${position})`,
145910
- () => this.languageService.getSignatureHelpItems(fileName, position, options)
145911
- );
145912
- }
145913
- /// GOTO DEFINITION
145914
- /**
145915
- * Computes the definition location and file for the symbol
145916
- * at the requested position.
145917
- */
145918
- getDefinitionAtPosition(fileName, position) {
145919
- return this.forwardJSONCall(
145920
- `getDefinitionAtPosition('${fileName}', ${position})`,
145921
- () => this.languageService.getDefinitionAtPosition(fileName, position)
145922
- );
145923
- }
145924
- /**
145925
- * Computes the definition location and file for the symbol
145926
- * at the requested position.
145927
- */
145928
- getDefinitionAndBoundSpan(fileName, position) {
145929
- return this.forwardJSONCall(
145930
- `getDefinitionAndBoundSpan('${fileName}', ${position})`,
145931
- () => this.languageService.getDefinitionAndBoundSpan(fileName, position)
145932
- );
145933
- }
145934
- /// GOTO Type
145935
- /**
145936
- * Computes the definition location of the type of the symbol
145937
- * at the requested position.
145938
- */
145939
- getTypeDefinitionAtPosition(fileName, position) {
145940
- return this.forwardJSONCall(
145941
- `getTypeDefinitionAtPosition('${fileName}', ${position})`,
145942
- () => this.languageService.getTypeDefinitionAtPosition(fileName, position)
145943
- );
145944
- }
145945
- /// GOTO Implementation
145946
- /**
145947
- * Computes the implementation location of the symbol
145948
- * at the requested position.
145949
- */
145950
- getImplementationAtPosition(fileName, position) {
145951
- return this.forwardJSONCall(
145952
- `getImplementationAtPosition('${fileName}', ${position})`,
145953
- () => this.languageService.getImplementationAtPosition(fileName, position)
145954
- );
145955
- }
145956
- getRenameInfo(fileName, position, preferences) {
145957
- return this.forwardJSONCall(
145958
- `getRenameInfo('${fileName}', ${position})`,
145959
- () => this.languageService.getRenameInfo(fileName, position, preferences)
145960
- );
145961
- }
145962
- getSmartSelectionRange(fileName, position) {
145963
- return this.forwardJSONCall(
145964
- `getSmartSelectionRange('${fileName}', ${position})`,
145965
- () => this.languageService.getSmartSelectionRange(fileName, position)
145966
- );
145967
- }
145968
- findRenameLocations(fileName, position, findInStrings, findInComments, preferences) {
145969
- return this.forwardJSONCall(
145970
- `findRenameLocations('${fileName}', ${position}, ${findInStrings}, ${findInComments})`,
145971
- () => this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, preferences)
145972
- );
145973
- }
145974
- /// GET BRACE MATCHING
145975
- getBraceMatchingAtPosition(fileName, position) {
145976
- return this.forwardJSONCall(
145977
- `getBraceMatchingAtPosition('${fileName}', ${position})`,
145978
- () => this.languageService.getBraceMatchingAtPosition(fileName, position)
145979
- );
145980
- }
145981
- isValidBraceCompletionAtPosition(fileName, position, openingBrace) {
145982
- return this.forwardJSONCall(
145983
- `isValidBraceCompletionAtPosition('${fileName}', ${position}, ${openingBrace})`,
145984
- () => this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace)
145985
- );
145986
- }
145987
- getSpanOfEnclosingComment(fileName, position, onlyMultiLine) {
145988
- return this.forwardJSONCall(
145989
- `getSpanOfEnclosingComment('${fileName}', ${position})`,
145990
- () => this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine)
145991
- );
145992
- }
145993
- /// GET SMART INDENT
145994
- getIndentationAtPosition(fileName, position, options) {
145995
- return this.forwardJSONCall(
145996
- `getIndentationAtPosition('${fileName}', ${position})`,
145997
- () => {
145998
- const localOptions = JSON.parse(options);
145999
- return this.languageService.getIndentationAtPosition(fileName, position, localOptions);
146000
- }
146001
- );
146002
- }
146003
- /// GET REFERENCES
146004
- getReferencesAtPosition(fileName, position) {
146005
- return this.forwardJSONCall(
146006
- `getReferencesAtPosition('${fileName}', ${position})`,
146007
- () => this.languageService.getReferencesAtPosition(fileName, position)
146008
- );
146009
- }
146010
- findReferences(fileName, position) {
146011
- return this.forwardJSONCall(
146012
- `findReferences('${fileName}', ${position})`,
146013
- () => this.languageService.findReferences(fileName, position)
146014
- );
146015
- }
146016
- getFileReferences(fileName) {
146017
- return this.forwardJSONCall(
146018
- `getFileReferences('${fileName})`,
146019
- () => this.languageService.getFileReferences(fileName)
146020
- );
146021
- }
146022
- getDocumentHighlights(fileName, position, filesToSearch) {
146023
- return this.forwardJSONCall(
146024
- `getDocumentHighlights('${fileName}', ${position})`,
146025
- () => {
146026
- const results = this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
146027
- const normalizedName = toFileNameLowerCase(normalizeSlashes(fileName));
146028
- return filter(results, (r) => toFileNameLowerCase(normalizeSlashes(r.fileName)) === normalizedName);
146029
- }
146030
- );
146031
- }
146032
- /// COMPLETION LISTS
146033
- /**
146034
- * Get a string based representation of the completions
146035
- * to provide at the given source position and providing a member completion
146036
- * list if requested.
146037
- */
146038
- getCompletionsAtPosition(fileName, position, preferences, formattingSettings) {
146039
- return this.forwardJSONCall(
146040
- `getCompletionsAtPosition('${fileName}', ${position}, ${preferences}, ${formattingSettings})`,
146041
- () => this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings)
146042
- );
146043
- }
146044
- /** Get a string based representation of a completion list entry details */
146045
- getCompletionEntryDetails(fileName, position, entryName, formatOptions, source, preferences, data) {
146046
- return this.forwardJSONCall(
146047
- `getCompletionEntryDetails('${fileName}', ${position}, '${entryName}')`,
146048
- () => {
146049
- const localOptions = formatOptions === void 0 ? void 0 : JSON.parse(formatOptions);
146050
- return this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source, preferences, data);
146051
- }
146052
- );
146053
- }
146054
- getFormattingEditsForRange(fileName, start2, end, options) {
146055
- return this.forwardJSONCall(
146056
- `getFormattingEditsForRange('${fileName}', ${start2}, ${end})`,
146057
- () => {
146058
- const localOptions = JSON.parse(options);
146059
- return this.languageService.getFormattingEditsForRange(fileName, start2, end, localOptions);
146060
- }
146061
- );
146062
- }
146063
- getFormattingEditsForDocument(fileName, options) {
146064
- return this.forwardJSONCall(
146065
- `getFormattingEditsForDocument('${fileName}')`,
146066
- () => {
146067
- const localOptions = JSON.parse(options);
146068
- return this.languageService.getFormattingEditsForDocument(fileName, localOptions);
146069
- }
146070
- );
146071
- }
146072
- getFormattingEditsAfterKeystroke(fileName, position, key, options) {
146073
- return this.forwardJSONCall(
146074
- `getFormattingEditsAfterKeystroke('${fileName}', ${position}, '${key}')`,
146075
- () => {
146076
- const localOptions = JSON.parse(options);
146077
- return this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);
146078
- }
146079
- );
146080
- }
146081
- getDocCommentTemplateAtPosition(fileName, position, options, formatOptions) {
146082
- return this.forwardJSONCall(
146083
- `getDocCommentTemplateAtPosition('${fileName}', ${position})`,
146084
- () => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options, formatOptions)
146085
- );
146086
- }
146087
- /// NAVIGATE TO
146088
- /** Return a list of symbols that are interesting to navigate to */
146089
- getNavigateToItems(searchValue, maxResultCount, fileName) {
146090
- return this.forwardJSONCall(
146091
- `getNavigateToItems('${searchValue}', ${maxResultCount}, ${fileName})`,
146092
- () => this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName)
146093
- );
146094
- }
146095
- getNavigationBarItems(fileName) {
146096
- return this.forwardJSONCall(
146097
- `getNavigationBarItems('${fileName}')`,
146098
- () => this.languageService.getNavigationBarItems(fileName)
146099
- );
146100
- }
146101
- getNavigationTree(fileName) {
146102
- return this.forwardJSONCall(
146103
- `getNavigationTree('${fileName}')`,
146104
- () => this.languageService.getNavigationTree(fileName)
146105
- );
146106
- }
146107
- getOutliningSpans(fileName) {
146108
- return this.forwardJSONCall(
146109
- `getOutliningSpans('${fileName}')`,
146110
- () => this.languageService.getOutliningSpans(fileName)
146111
- );
146112
- }
146113
- getTodoComments(fileName, descriptors) {
146114
- return this.forwardJSONCall(
146115
- `getTodoComments('${fileName}')`,
146116
- () => this.languageService.getTodoComments(fileName, JSON.parse(descriptors))
146117
- );
146118
- }
146119
- /// CALL HIERARCHY
146120
- prepareCallHierarchy(fileName, position) {
146121
- return this.forwardJSONCall(
146122
- `prepareCallHierarchy('${fileName}', ${position})`,
146123
- () => this.languageService.prepareCallHierarchy(fileName, position)
146124
- );
146125
- }
146126
- provideCallHierarchyIncomingCalls(fileName, position) {
146127
- return this.forwardJSONCall(
146128
- `provideCallHierarchyIncomingCalls('${fileName}', ${position})`,
146129
- () => this.languageService.provideCallHierarchyIncomingCalls(fileName, position)
146130
- );
146131
- }
146132
- provideCallHierarchyOutgoingCalls(fileName, position) {
146133
- return this.forwardJSONCall(
146134
- `provideCallHierarchyOutgoingCalls('${fileName}', ${position})`,
146135
- () => this.languageService.provideCallHierarchyOutgoingCalls(fileName, position)
146136
- );
146137
- }
146138
- provideInlayHints(fileName, span, preference) {
146139
- return this.forwardJSONCall(
146140
- `provideInlayHints('${fileName}', '${JSON.stringify(span)}', ${JSON.stringify(preference)})`,
146141
- () => this.languageService.provideInlayHints(fileName, span, preference)
146142
- );
146143
- }
146144
- /// Emit
146145
- getEmitOutput(fileName) {
146146
- return this.forwardJSONCall(
146147
- `getEmitOutput('${fileName}')`,
146148
- () => {
146149
- const { diagnostics, ...rest } = this.languageService.getEmitOutput(fileName);
146150
- return { ...rest, diagnostics: this.realizeDiagnostics(diagnostics) };
146151
- }
146152
- );
146153
- }
146154
- getEmitOutputObject(fileName) {
146155
- return forwardCall(
146156
- this.logger,
146157
- `getEmitOutput('${fileName}')`,
146158
- /*returnJson*/
146159
- false,
146160
- () => this.languageService.getEmitOutput(fileName),
146161
- this.logPerformance
146162
- );
146163
- }
146164
- toggleLineComment(fileName, textRange) {
146165
- return this.forwardJSONCall(
146166
- `toggleLineComment('${fileName}', '${JSON.stringify(textRange)}')`,
146167
- () => this.languageService.toggleLineComment(fileName, textRange)
146168
- );
146169
- }
146170
- toggleMultilineComment(fileName, textRange) {
146171
- return this.forwardJSONCall(
146172
- `toggleMultilineComment('${fileName}', '${JSON.stringify(textRange)}')`,
146173
- () => this.languageService.toggleMultilineComment(fileName, textRange)
146174
- );
146175
- }
146176
- commentSelection(fileName, textRange) {
146177
- return this.forwardJSONCall(
146178
- `commentSelection('${fileName}', '${JSON.stringify(textRange)}')`,
146179
- () => this.languageService.commentSelection(fileName, textRange)
146180
- );
146181
- }
146182
- uncommentSelection(fileName, textRange) {
146183
- return this.forwardJSONCall(
146184
- `uncommentSelection('${fileName}', '${JSON.stringify(textRange)}')`,
146185
- () => this.languageService.uncommentSelection(fileName, textRange)
146186
- );
146187
- }
146188
- };
146189
- function convertClassifications(classifications) {
146190
- return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState };
146191
- }
146192
- var ClassifierShimObject = class extends ShimBase {
146193
- constructor(factory2, logger) {
146194
- super(factory2);
146195
- this.logger = logger;
146196
- this.logPerformance = false;
146197
- this.classifier = createClassifier();
146198
- }
146199
- getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent = false) {
146200
- return forwardJSONCall(this.logger, "getEncodedLexicalClassifications", () => convertClassifications(this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)), this.logPerformance);
146201
- }
146202
- /// COLORIZATION
146203
- getClassificationsForLine(text, lexState, classifyKeywordsInGenerics = false) {
146204
- const classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics);
146205
- let result = "";
146206
- for (const item of classification.entries) {
146207
- result += item.length + "\n";
146208
- result += item.classification + "\n";
146209
- }
146210
- result += classification.finalLexState;
146211
- return result;
146212
- }
146213
- };
146214
- var CoreServicesShimObject = class extends ShimBase {
146215
- constructor(factory2, logger, host) {
146216
- super(factory2);
146217
- this.logger = logger;
146218
- this.host = host;
146219
- this.logPerformance = false;
146220
- }
146221
- forwardJSONCall(actionDescription2, action) {
146222
- return forwardJSONCall(this.logger, actionDescription2, action, this.logPerformance);
146223
- }
146224
- resolveModuleName(fileName, moduleName, compilerOptionsJson) {
146225
- return this.forwardJSONCall(`resolveModuleName('${fileName}')`, () => {
146226
- const compilerOptions = JSON.parse(compilerOptionsJson);
146227
- const result = resolveModuleName(moduleName, normalizeSlashes(fileName), compilerOptions, this.host);
146228
- let resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : void 0;
146229
- if (result.resolvedModule && result.resolvedModule.extension !== ".ts" /* Ts */ && result.resolvedModule.extension !== ".tsx" /* Tsx */ && result.resolvedModule.extension !== ".d.ts" /* Dts */) {
146230
- resolvedFileName = void 0;
146231
- }
146232
- return {
146233
- resolvedFileName,
146234
- failedLookupLocations: result.failedLookupLocations,
146235
- affectingLocations: result.affectingLocations
146236
- };
146237
- });
146238
- }
146239
- resolveTypeReferenceDirective(fileName, typeReferenceDirective, compilerOptionsJson) {
146240
- return this.forwardJSONCall(`resolveTypeReferenceDirective(${fileName})`, () => {
146241
- const compilerOptions = JSON.parse(compilerOptionsJson);
146242
- const result = resolveTypeReferenceDirective(typeReferenceDirective, normalizeSlashes(fileName), compilerOptions, this.host);
146243
- return {
146244
- resolvedFileName: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.resolvedFileName : void 0,
146245
- primary: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.primary : true,
146246
- failedLookupLocations: result.failedLookupLocations
146247
- };
146248
- });
146249
- }
146250
- getPreProcessedFileInfo(fileName, sourceTextSnapshot) {
146251
- return this.forwardJSONCall(
146252
- `getPreProcessedFileInfo('${fileName}')`,
146253
- () => {
146254
- const result = preProcessFile(
146255
- getSnapshotText(sourceTextSnapshot),
146256
- /*readImportFiles*/
146257
- true,
146258
- /*detectJavaScriptImports*/
146259
- true
146260
- );
146261
- return {
146262
- referencedFiles: this.convertFileReferences(result.referencedFiles),
146263
- importedFiles: this.convertFileReferences(result.importedFiles),
146264
- ambientExternalModules: result.ambientExternalModules,
146265
- isLibFile: result.isLibFile,
146266
- typeReferenceDirectives: this.convertFileReferences(result.typeReferenceDirectives),
146267
- libReferenceDirectives: this.convertFileReferences(result.libReferenceDirectives)
146268
- };
146269
- }
146270
- );
146271
- }
146272
- getAutomaticTypeDirectiveNames(compilerOptionsJson) {
146273
- return this.forwardJSONCall(
146274
- `getAutomaticTypeDirectiveNames('${compilerOptionsJson}')`,
146275
- () => {
146276
- const compilerOptions = JSON.parse(compilerOptionsJson);
146277
- return getAutomaticTypeDirectiveNames(compilerOptions, this.host);
146278
- }
146279
- );
146280
- }
146281
- convertFileReferences(refs) {
146282
- if (!refs) {
146283
- return void 0;
146284
- }
146285
- const result = [];
146286
- for (const ref of refs) {
146287
- result.push({
146288
- path: normalizeSlashes(ref.fileName),
146289
- position: ref.pos,
146290
- length: ref.end - ref.pos
146291
- });
146292
- }
146293
- return result;
146294
- }
146295
- getTSConfigFileInfo(fileName, sourceTextSnapshot) {
146296
- return this.forwardJSONCall(
146297
- `getTSConfigFileInfo('${fileName}')`,
146298
- () => {
146299
- const result = parseJsonText(fileName, getSnapshotText(sourceTextSnapshot));
146300
- const normalizedFileName = normalizeSlashes(fileName);
146301
- const configFile = parseJsonSourceFileConfigFileContent(
146302
- result,
146303
- this.host,
146304
- getDirectoryPath(normalizedFileName),
146305
- /*existingOptions*/
146306
- {},
146307
- normalizedFileName
146308
- );
146309
- return {
146310
- options: configFile.options,
146311
- typeAcquisition: configFile.typeAcquisition,
146312
- files: configFile.fileNames,
146313
- raw: configFile.raw,
146314
- errors: realizeDiagnostics([...result.parseDiagnostics, ...configFile.errors], "\r\n")
146315
- };
146316
- }
146317
- );
146318
- }
146319
- getDefaultCompilationSettings() {
146320
- return this.forwardJSONCall(
146321
- "getDefaultCompilationSettings()",
146322
- () => getDefaultCompilerOptions2()
146323
- );
146324
- }
146325
- discoverTypings(discoverTypingsJson) {
146326
- const getCanonicalFileName = createGetCanonicalFileName(
146327
- /*useCaseSensitiveFileNames*/
146328
- false
146329
- );
146330
- return this.forwardJSONCall("discoverTypings()", () => {
146331
- const info = JSON.parse(discoverTypingsJson);
146332
- if (this.safeList === void 0) {
146333
- this.safeList = ts_JsTyping_exports.loadSafeList(this.host, toPath(info.safeListPath, info.safeListPath, getCanonicalFileName));
146334
- }
146335
- return ts_JsTyping_exports.discoverTypings(
146336
- this.host,
146337
- (msg) => this.logger.log(msg),
146338
- info.fileNames,
146339
- toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName),
146340
- this.safeList,
146341
- info.packageNameToTypingLocation,
146342
- info.typeAcquisition,
146343
- info.unresolvedImports,
146344
- info.typesRegistry,
146345
- emptyOptions
146346
- );
146347
- });
146348
- }
146349
- };
146350
- var TypeScriptServicesFactory = class {
146351
- constructor() {
146352
- this._shims = [];
146353
- }
146354
- /*
146355
- * Returns script API version.
146356
- */
146357
- getServicesVersion() {
146358
- return servicesVersion;
146359
- }
146360
- createLanguageServiceShim(host) {
146361
- try {
146362
- if (this.documentRegistry === void 0) {
146363
- this.documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory());
146364
- }
146365
- const hostAdapter = new LanguageServiceShimHostAdapter(host);
146366
- const languageService = createLanguageService(
146367
- hostAdapter,
146368
- this.documentRegistry,
146369
- /*syntaxOnlyOrLanguageServiceMode*/
146370
- false
146371
- );
146372
- return new LanguageServiceShimObject(this, host, languageService);
146373
- } catch (err) {
146374
- logInternalError(host, err);
146375
- throw err;
146376
- }
146377
- }
146378
- createClassifierShim(logger) {
146379
- try {
146380
- return new ClassifierShimObject(this, logger);
146381
- } catch (err) {
146382
- logInternalError(logger, err);
146383
- throw err;
146384
- }
146385
- }
146386
- createCoreServicesShim(host) {
146387
- try {
146388
- const adapter = new CoreServicesShimHostAdapter(host);
146389
- return new CoreServicesShimObject(this, host, adapter);
146390
- } catch (err) {
146391
- logInternalError(host, err);
146392
- throw err;
146393
- }
146394
- }
146395
- close() {
146396
- clear(this._shims);
146397
- this.documentRegistry = void 0;
146398
- }
146399
- registerShim(shim) {
146400
- this._shims.push(shim);
146401
- }
146402
- unregisterShim(shim) {
146403
- for (let i = 0; i < this._shims.length; i++) {
146404
- if (this._shims[i] === shim) {
146405
- delete this._shims[i];
146406
- return;
146407
- }
146408
- }
146409
- throw new Error("Invalid operation");
146410
- }
146411
- };
146412
-
146413
145541
  // src/services/_namespaces/ts.BreakpointResolver.ts
146414
145542
  var ts_BreakpointResolver_exports = {};
146415
145543
  __export(ts_BreakpointResolver_exports, {
@@ -172808,7 +171936,6 @@ __export(ts_exports2, {
172808
171936
  ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel,
172809
171937
  ContainerFlags: () => ContainerFlags,
172810
171938
  ContextFlags: () => ContextFlags,
172811
- CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter,
172812
171939
  Debug: () => Debug,
172813
171940
  DiagnosticCategory: () => DiagnosticCategory,
172814
171941
  Diagnostics: () => Diagnostics,
@@ -172857,7 +171984,6 @@ __export(ts_exports2, {
172857
171984
  JsxFlags: () => JsxFlags,
172858
171985
  JsxReferenceKind: () => JsxReferenceKind,
172859
171986
  LanguageServiceMode: () => LanguageServiceMode,
172860
- LanguageServiceShimHostAdapter: () => LanguageServiceShimHostAdapter,
172861
171987
  LanguageVariant: () => LanguageVariant,
172862
171988
  LexicalEnvironmentFlags: () => LexicalEnvironmentFlags,
172863
171989
  ListFormat: () => ListFormat,
@@ -172931,7 +172057,6 @@ __export(ts_exports2, {
172931
172057
  TypeMapKind: () => TypeMapKind,
172932
172058
  TypePredicateKind: () => TypePredicateKind,
172933
172059
  TypeReferenceSerializationKind: () => TypeReferenceSerializationKind,
172934
- TypeScriptServicesFactory: () => TypeScriptServicesFactory,
172935
172060
  UnionReduction: () => UnionReduction,
172936
172061
  UpToDateStatusType: () => UpToDateStatusType,
172937
172062
  VarianceFlags: () => VarianceFlags,
@@ -174194,6 +173319,7 @@ __export(ts_exports2, {
174194
173319
  isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute,
174195
173320
  isInsideNodeModules: () => isInsideNodeModules,
174196
173321
  isInsideTemplateLiteral: () => isInsideTemplateLiteral,
173322
+ isInstanceOfExpression: () => isInstanceOfExpression,
174197
173323
  isInstantiatedModule: () => isInstantiatedModule,
174198
173324
  isInterfaceDeclaration: () => isInterfaceDeclaration,
174199
173325
  isInternalDeclaration: () => isInternalDeclaration,
@@ -174451,6 +173577,7 @@ __export(ts_exports2, {
174451
173577
  isReturnStatement: () => isReturnStatement,
174452
173578
  isReturnStatementWithFixablePromiseHandler: () => isReturnStatementWithFixablePromiseHandler,
174453
173579
  isRightSideOfAccessExpression: () => isRightSideOfAccessExpression,
173580
+ isRightSideOfInstanceofExpression: () => isRightSideOfInstanceofExpression,
174454
173581
  isRightSideOfPropertyAccess: () => isRightSideOfPropertyAccess,
174455
173582
  isRightSideOfQualifiedName: () => isRightSideOfQualifiedName,
174456
173583
  isRightSideOfQualifiedNameOrPropertyAccess: () => isRightSideOfQualifiedNameOrPropertyAccess,
@@ -174775,7 +173902,6 @@ __export(ts_exports2, {
174775
173902
  readJson: () => readJson,
174776
173903
  readJsonConfigFile: () => readJsonConfigFile,
174777
173904
  readJsonOrUndefined: () => readJsonOrUndefined,
174778
- realizeDiagnostics: () => realizeDiagnostics,
174779
173905
  reduceEachLeadingCommentRange: () => reduceEachLeadingCommentRange,
174780
173906
  reduceEachTrailingCommentRange: () => reduceEachTrailingCommentRange,
174781
173907
  reduceLeft: () => reduceLeft,
@@ -187489,7 +186615,6 @@ start(initializeNodeSystem(), require("os").platform());
187489
186615
  ConfigFileProgramReloadLevel,
187490
186616
  ContainerFlags,
187491
186617
  ContextFlags,
187492
- CoreServicesShimHostAdapter,
187493
186618
  Debug,
187494
186619
  DiagnosticCategory,
187495
186620
  Diagnostics,
@@ -187538,7 +186663,6 @@ start(initializeNodeSystem(), require("os").platform());
187538
186663
  JsxFlags,
187539
186664
  JsxReferenceKind,
187540
186665
  LanguageServiceMode,
187541
- LanguageServiceShimHostAdapter,
187542
186666
  LanguageVariant,
187543
186667
  LexicalEnvironmentFlags,
187544
186668
  ListFormat,
@@ -187612,7 +186736,6 @@ start(initializeNodeSystem(), require("os").platform());
187612
186736
  TypeMapKind,
187613
186737
  TypePredicateKind,
187614
186738
  TypeReferenceSerializationKind,
187615
- TypeScriptServicesFactory,
187616
186739
  UnionReduction,
187617
186740
  UpToDateStatusType,
187618
186741
  VarianceFlags,
@@ -188875,6 +187998,7 @@ start(initializeNodeSystem(), require("os").platform());
188875
187998
  isInsideJsxElementOrAttribute,
188876
187999
  isInsideNodeModules,
188877
188000
  isInsideTemplateLiteral,
188001
+ isInstanceOfExpression,
188878
188002
  isInstantiatedModule,
188879
188003
  isInterfaceDeclaration,
188880
188004
  isInternalDeclaration,
@@ -189132,6 +188256,7 @@ start(initializeNodeSystem(), require("os").platform());
189132
188256
  isReturnStatement,
189133
188257
  isReturnStatementWithFixablePromiseHandler,
189134
188258
  isRightSideOfAccessExpression,
188259
+ isRightSideOfInstanceofExpression,
189135
188260
  isRightSideOfPropertyAccess,
189136
188261
  isRightSideOfQualifiedName,
189137
188262
  isRightSideOfQualifiedNameOrPropertyAccess,
@@ -189456,7 +188581,6 @@ start(initializeNodeSystem(), require("os").platform());
189456
188581
  readJson,
189457
188582
  readJsonConfigFile,
189458
188583
  readJsonOrUndefined,
189459
- realizeDiagnostics,
189460
188584
  reduceEachLeadingCommentRange,
189461
188585
  reduceEachTrailingCommentRange,
189462
188586
  reduceLeft,