@typescript-deploys/pr-build 5.1.0-pr-53001-3 → 5.1.0-pr-53034-6

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.
@@ -82,7 +82,7 @@ interface WeakMap<K extends object, V> {
82
82
  }
83
83
 
84
84
  interface WeakMapConstructor {
85
- new <K extends object = object, V = any>(entries?: readonly [K, V][] | null): WeakMap<K, V>;
85
+ new <K extends object = object, V = any>(entries?: readonly (readonly [K, V])[] | null): WeakMap<K, V>;
86
86
  readonly prototype: WeakMap<object, any>;
87
87
  }
88
88
  declare var WeakMap: WeakMapConstructor;
package/lib/tsc.js CHANGED
@@ -842,9 +842,6 @@ function multiMapRemove(key, value) {
842
842
  }
843
843
  }
844
844
  }
845
- function createUnderscoreEscapedMultiMap() {
846
- return createMultiMap();
847
- }
848
845
  function createQueue(items) {
849
846
  const elements = (items == null ? void 0 : items.slice()) || [];
850
847
  let headIndex = 0;
@@ -45908,6 +45905,10 @@ function createTypeChecker(host) {
45908
45905
  return;
45909
45906
  merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
45910
45907
  });
45908
+ if (merged === exported) {
45909
+ getSymbolLinks(merged).resolvedExports = void 0;
45910
+ getSymbolLinks(merged).resolvedMembers = void 0;
45911
+ }
45911
45912
  getSymbolLinks(merged).cjsExportMerged = merged;
45912
45913
  return links.cjsExportMerged = merged;
45913
45914
  }
@@ -47794,7 +47795,7 @@ function createTypeChecker(host) {
47794
47795
  }
47795
47796
  }
47796
47797
  const mayHaveNameCollisions = !(context.flags & 64 /* UseFullyQualifiedType */);
47797
- const seenNames = mayHaveNameCollisions ? createUnderscoreEscapedMultiMap() : void 0;
47798
+ const seenNames = mayHaveNameCollisions ? createMultiMap() : void 0;
47798
47799
  const result = [];
47799
47800
  let i = 0;
47800
47801
  for (const type of types) {
@@ -49361,7 +49362,8 @@ function createTypeChecker(host) {
49361
49362
  ), modifierFlags);
49362
49363
  }
49363
49364
  function getNamespaceMembersForSerialization(symbol) {
49364
- return !symbol.exports ? [] : filter(arrayFrom(symbol.exports.values()), isNamespaceMember);
49365
+ const exports = getExportsOfSymbol(symbol);
49366
+ return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
49365
49367
  }
49366
49368
  function isTypeOnlyNamespace(symbol) {
49367
49369
  return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
@@ -103837,7 +103839,7 @@ function transformNodeModule(context) {
103837
103839
 
103838
103840
  // src/compiler/transformers/declarations/diagnostics.ts
103839
103841
  function canProduceDiagnostics(node) {
103840
- return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
103842
+ return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
103841
103843
  }
103842
103844
  function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
103843
103845
  if (isSetAccessor(node) || isGetAccessor(node)) {
@@ -103883,7 +103885,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
103883
103885
  }
103884
103886
  }
103885
103887
  function createGetSymbolAccessibilityDiagnosticForNode(node) {
103886
- if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
103888
+ if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
103887
103889
  return getVariableDeclarationTypeVisibilityError;
103888
103890
  } else if (isSetAccessor(node) || isGetAccessor(node)) {
103889
103891
  return getAccessorDeclarationTypeVisibilityError;
@@ -103908,7 +103910,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
103908
103910
  function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
103909
103911
  if (node.kind === 257 /* VariableDeclaration */ || node.kind === 205 /* BindingElement */) {
103910
103912
  return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
103911
- } else if (node.kind === 169 /* PropertyDeclaration */ || node.kind === 208 /* PropertyAccessExpression */ || node.kind === 168 /* PropertySignature */ || node.kind === 166 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
103913
+ } else if (node.kind === 169 /* PropertyDeclaration */ || node.kind === 208 /* PropertyAccessExpression */ || node.kind === 209 /* ElementAccessExpression */ || node.kind === 223 /* BinaryExpression */ || node.kind === 168 /* PropertySignature */ || node.kind === 166 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
103912
103914
  if (isStatic(node)) {
103913
103915
  return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
103914
103916
  } else if (node.parent.kind === 260 /* ClassDeclaration */ || node.kind === 166 /* Parameter */) {
@@ -105361,13 +105363,16 @@ function transformDeclarations(context) {
105361
105363
  fakespace.symbol = props[0].parent;
105362
105364
  const exportMappings = [];
105363
105365
  let declarations = mapDefined(props, (p) => {
105364
- if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
105366
+ if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
105367
+ return void 0;
105368
+ }
105369
+ const nameStr = unescapeLeadingUnderscores(p.escapedName);
105370
+ if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
105365
105371
  return void 0;
105366
105372
  }
105367
105373
  getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
105368
105374
  const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
105369
105375
  getSymbolAccessibilityDiagnostic = oldDiag;
105370
- const nameStr = unescapeLeadingUnderscores(p.escapedName);
105371
105376
  const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
105372
105377
  const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
105373
105378
  if (isNonContextualKeywordName) {
package/lib/tsserver.js CHANGED
@@ -472,7 +472,6 @@ __export(server_exports, {
472
472
  createTypeChecker: () => createTypeChecker,
473
473
  createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache,
474
474
  createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader,
475
- createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap,
476
475
  createUnparsedSourceFile: () => createUnparsedSourceFile,
477
476
  createWatchCompilerHost: () => createWatchCompilerHost2,
478
477
  createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile,
@@ -3271,9 +3270,6 @@ function multiMapRemove(key, value) {
3271
3270
  }
3272
3271
  }
3273
3272
  }
3274
- function createUnderscoreEscapedMultiMap() {
3275
- return createMultiMap();
3276
- }
3277
3273
  function createQueue(items) {
3278
3274
  const elements = (items == null ? void 0 : items.slice()) || [];
3279
3275
  let headIndex = 0;
@@ -50515,6 +50511,10 @@ function createTypeChecker(host) {
50515
50511
  return;
50516
50512
  merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
50517
50513
  });
50514
+ if (merged === exported) {
50515
+ getSymbolLinks(merged).resolvedExports = void 0;
50516
+ getSymbolLinks(merged).resolvedMembers = void 0;
50517
+ }
50518
50518
  getSymbolLinks(merged).cjsExportMerged = merged;
50519
50519
  return links.cjsExportMerged = merged;
50520
50520
  }
@@ -52401,7 +52401,7 @@ function createTypeChecker(host) {
52401
52401
  }
52402
52402
  }
52403
52403
  const mayHaveNameCollisions = !(context.flags & 64 /* UseFullyQualifiedType */);
52404
- const seenNames = mayHaveNameCollisions ? createUnderscoreEscapedMultiMap() : void 0;
52404
+ const seenNames = mayHaveNameCollisions ? createMultiMap() : void 0;
52405
52405
  const result = [];
52406
52406
  let i = 0;
52407
52407
  for (const type of types) {
@@ -53968,7 +53968,8 @@ function createTypeChecker(host) {
53968
53968
  ), modifierFlags);
53969
53969
  }
53970
53970
  function getNamespaceMembersForSerialization(symbol) {
53971
- return !symbol.exports ? [] : filter(arrayFrom(symbol.exports.values()), isNamespaceMember);
53971
+ const exports = getExportsOfSymbol(symbol);
53972
+ return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
53972
53973
  }
53973
53974
  function isTypeOnlyNamespace(symbol) {
53974
53975
  return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
@@ -108615,7 +108616,7 @@ function transformNodeModule(context) {
108615
108616
 
108616
108617
  // src/compiler/transformers/declarations/diagnostics.ts
108617
108618
  function canProduceDiagnostics(node) {
108618
- return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
108619
+ return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
108619
108620
  }
108620
108621
  function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
108621
108622
  if (isSetAccessor(node) || isGetAccessor(node)) {
@@ -108661,7 +108662,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
108661
108662
  }
108662
108663
  }
108663
108664
  function createGetSymbolAccessibilityDiagnosticForNode(node) {
108664
- if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
108665
+ if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
108665
108666
  return getVariableDeclarationTypeVisibilityError;
108666
108667
  } else if (isSetAccessor(node) || isGetAccessor(node)) {
108667
108668
  return getAccessorDeclarationTypeVisibilityError;
@@ -108686,7 +108687,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
108686
108687
  function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
108687
108688
  if (node.kind === 257 /* VariableDeclaration */ || node.kind === 205 /* BindingElement */) {
108688
108689
  return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
108689
- } else if (node.kind === 169 /* PropertyDeclaration */ || node.kind === 208 /* PropertyAccessExpression */ || node.kind === 168 /* PropertySignature */ || node.kind === 166 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
108690
+ } else if (node.kind === 169 /* PropertyDeclaration */ || node.kind === 208 /* PropertyAccessExpression */ || node.kind === 209 /* ElementAccessExpression */ || node.kind === 223 /* BinaryExpression */ || node.kind === 168 /* PropertySignature */ || node.kind === 166 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
108690
108691
  if (isStatic(node)) {
108691
108692
  return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
108692
108693
  } else if (node.parent.kind === 260 /* ClassDeclaration */ || node.kind === 166 /* Parameter */) {
@@ -110139,13 +110140,16 @@ function transformDeclarations(context) {
110139
110140
  fakespace.symbol = props[0].parent;
110140
110141
  const exportMappings = [];
110141
110142
  let declarations = mapDefined(props, (p) => {
110142
- if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
110143
+ if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
110144
+ return void 0;
110145
+ }
110146
+ const nameStr = unescapeLeadingUnderscores(p.escapedName);
110147
+ if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
110143
110148
  return void 0;
110144
110149
  }
110145
110150
  getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
110146
110151
  const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
110147
110152
  getSymbolAccessibilityDiagnostic = oldDiag;
110148
- const nameStr = unescapeLeadingUnderscores(p.escapedName);
110149
110153
  const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
110150
110154
  const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
110151
110155
  if (isNonContextualKeywordName) {
@@ -150115,7 +150119,8 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
150115
150119
  }
150116
150120
  log("getCompletionData: Semantic work: " + (timestamp() - semanticStart));
150117
150121
  const contextualType = previousToken && getContextualType(previousToken, position, sourceFile, typeChecker);
150118
- const literals = mapDefined(
150122
+ const isLiteralExpected = !tryCast(previousToken, isStringLiteralLike) && !isJsxIdentifierExpected;
150123
+ const literals = !isLiteralExpected ? [] : mapDefined(
150119
150124
  contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]),
150120
150125
  (t) => t.isLiteral() && !(t.flags & 1024 /* EnumLiteral */) ? t.value : void 0
150121
150126
  );
@@ -168107,7 +168112,6 @@ __export(ts_exports3, {
168107
168112
  createTypeChecker: () => createTypeChecker,
168108
168113
  createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache,
168109
168114
  createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader,
168110
- createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap,
168111
168115
  createUnparsedSourceFile: () => createUnparsedSourceFile,
168112
168116
  createWatchCompilerHost: () => createWatchCompilerHost2,
168113
168117
  createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile,
@@ -170600,14 +170604,17 @@ var TextStorage = class {
170600
170604
  * True when reloading contents of file from the disk is pending
170601
170605
  */
170602
170606
  this.pendingReloadFromDisk = false;
170603
- this.version = initialVersion || 0;
170607
+ this.version = initialVersion || { svc: 0, text: 0 };
170604
170608
  }
170605
170609
  getVersion() {
170606
- return this.svc ? `SVC-${this.version}-${this.svc.getSnapshotVersion()}` : `Text-${this.version}`;
170610
+ return this.svc ? `SVC-${this.version.svc}-${this.svc.getSnapshotVersion()}` : `Text-${this.version.text}`;
170607
170611
  }
170608
170612
  hasScriptVersionCache_TestOnly() {
170609
170613
  return this.svc !== void 0;
170610
170614
  }
170615
+ useScriptVersionCache_TestOnly() {
170616
+ this.switchToScriptVersionCache();
170617
+ }
170611
170618
  resetSourceMapInfo() {
170612
170619
  this.info.sourceFileLike = void 0;
170613
170620
  this.info.closeSourceMapFileWatcher();
@@ -170620,17 +170627,15 @@ var TextStorage = class {
170620
170627
  useText(newText) {
170621
170628
  this.svc = void 0;
170622
170629
  this.text = newText;
170623
- this.textSnapshot = void 0;
170624
170630
  this.lineMap = void 0;
170625
170631
  this.fileSize = void 0;
170626
170632
  this.resetSourceMapInfo();
170627
- this.version++;
170633
+ this.version.text++;
170628
170634
  }
170629
170635
  edit(start2, end, newText) {
170630
170636
  this.switchToScriptVersionCache().edit(start2, end - start2, newText);
170631
170637
  this.ownFileText = false;
170632
170638
  this.text = void 0;
170633
- this.textSnapshot = void 0;
170634
170639
  this.lineMap = void 0;
170635
170640
  this.fileSize = void 0;
170636
170641
  this.resetSourceMapInfo();
@@ -170642,9 +170647,6 @@ var TextStorage = class {
170642
170647
  reload(newText) {
170643
170648
  Debug.assert(newText !== void 0);
170644
170649
  this.pendingReloadFromDisk = false;
170645
- if (!this.text && this.svc) {
170646
- this.text = getSnapshotText(this.svc.getSnapshot());
170647
- }
170648
170650
  if (this.text !== newText) {
170649
170651
  this.useText(newText);
170650
170652
  this.ownFileText = false;
@@ -170657,18 +170659,21 @@ var TextStorage = class {
170657
170659
  * returns true if text changed
170658
170660
  */
170659
170661
  reloadWithFileText(tempFileName) {
170660
- const { text: newText, fileSize } = tempFileName || !this.info.isDynamicOrHasMixedContent() ? this.getFileTextAndSize(tempFileName) : { text: "", fileSize: void 0 };
170662
+ const { text: newText, fileSize } = this.getFileTextAndSize(tempFileName);
170661
170663
  const reloaded = this.reload(newText);
170662
170664
  this.fileSize = fileSize;
170663
170665
  this.ownFileText = !tempFileName || tempFileName === this.info.fileName;
170664
170666
  return reloaded;
170665
170667
  }
170666
170668
  /**
170667
- * Schedule reload from the disk if its not already scheduled and its not own text
170668
- * returns true when scheduling reload
170669
+ * Reloads the contents from the file if there is no pending reload from disk or the contents of file are same as file text
170670
+ * returns true if text changed
170669
170671
  */
170670
- scheduleReloadIfNeeded() {
170671
- return !this.pendingReloadFromDisk && !this.ownFileText ? this.pendingReloadFromDisk = true : false;
170672
+ reloadFromDisk() {
170673
+ if (!this.pendingReloadFromDisk && !this.ownFileText) {
170674
+ return this.reloadWithFileText();
170675
+ }
170676
+ return false;
170672
170677
  }
170673
170678
  delayReloadFromFileIntoText() {
170674
170679
  this.pendingReloadFromDisk = true;
@@ -170684,48 +170689,39 @@ var TextStorage = class {
170684
170689
  return !!this.fileSize ? this.fileSize : !!this.text ? this.text.length : !!this.svc ? this.svc.getSnapshot().getLength() : this.getSnapshot().getLength();
170685
170690
  }
170686
170691
  getSnapshot() {
170687
- var _a2, _b;
170688
- return ((_a2 = this.tryUseScriptVersionCache()) == null ? void 0 : _a2.getSnapshot()) || ((_b = this.textSnapshot) != null ? _b : this.textSnapshot = ScriptSnapshot.fromString(Debug.checkDefined(this.text)));
170692
+ return this.useScriptVersionCacheIfValidOrOpen() ? this.svc.getSnapshot() : ScriptSnapshot.fromString(this.getOrLoadText());
170689
170693
  }
170690
- getAbsolutePositionAndLineText(oneBasedLine) {
170691
- const svc = this.tryUseScriptVersionCache();
170692
- if (svc)
170693
- return svc.getAbsolutePositionAndLineText(oneBasedLine);
170694
- const lineMap = this.getLineMap();
170695
- return oneBasedLine <= lineMap.length ? {
170696
- absolutePosition: lineMap[oneBasedLine - 1],
170697
- lineText: this.text.substring(lineMap[oneBasedLine - 1], lineMap[oneBasedLine])
170698
- } : {
170699
- absolutePosition: this.text.length,
170700
- lineText: void 0
170701
- };
170694
+ getAbsolutePositionAndLineText(line) {
170695
+ return this.switchToScriptVersionCache().getAbsolutePositionAndLineText(line);
170702
170696
  }
170703
170697
  /**
170704
170698
  * @param line 0 based index
170705
170699
  */
170706
170700
  lineToTextSpan(line) {
170707
- const svc = this.tryUseScriptVersionCache();
170708
- if (svc)
170709
- return svc.lineToTextSpan(line);
170710
- const lineMap = this.getLineMap();
170711
- const start2 = lineMap[line];
170712
- const end = line + 1 < lineMap.length ? lineMap[line + 1] : this.text.length;
170713
- return createTextSpanFromBounds(start2, end);
170701
+ if (!this.useScriptVersionCacheIfValidOrOpen()) {
170702
+ const lineMap = this.getLineMap();
170703
+ const start2 = lineMap[line];
170704
+ const end = line + 1 < lineMap.length ? lineMap[line + 1] : this.text.length;
170705
+ return createTextSpanFromBounds(start2, end);
170706
+ }
170707
+ return this.svc.lineToTextSpan(line);
170714
170708
  }
170715
170709
  /**
170716
170710
  * @param line 1 based index
170717
170711
  * @param offset 1 based index
170718
170712
  */
170719
170713
  lineOffsetToPosition(line, offset, allowEdits) {
170720
- const svc = this.tryUseScriptVersionCache();
170721
- return svc ? svc.lineOffsetToPosition(line, offset) : computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1, this.text, allowEdits);
170714
+ if (!this.useScriptVersionCacheIfValidOrOpen()) {
170715
+ return computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1, this.text, allowEdits);
170716
+ }
170717
+ return this.svc.lineOffsetToPosition(line, offset);
170722
170718
  }
170723
170719
  positionToLineOffset(position) {
170724
- const svc = this.tryUseScriptVersionCache();
170725
- if (svc)
170726
- return svc.positionToLineOffset(position);
170727
- const { line, character } = computeLineAndCharacterOfPosition(this.getLineMap(), position);
170728
- return { line: line + 1, offset: character + 1 };
170720
+ if (!this.useScriptVersionCacheIfValidOrOpen()) {
170721
+ const { line, character } = computeLineAndCharacterOfPosition(this.getLineMap(), position);
170722
+ return { line: line + 1, offset: character + 1 };
170723
+ }
170724
+ return this.svc.positionToLineOffset(position);
170729
170725
  }
170730
170726
  getFileTextAndSize(tempFileName) {
170731
170727
  let text;
@@ -170743,25 +170739,19 @@ var TextStorage = class {
170743
170739
  }
170744
170740
  return { text: getText() };
170745
170741
  }
170746
- /** @internal */
170747
170742
  switchToScriptVersionCache() {
170748
170743
  if (!this.svc || this.pendingReloadFromDisk) {
170749
170744
  this.svc = ScriptVersionCache.fromString(this.getOrLoadText());
170750
- this.textSnapshot = void 0;
170751
- this.version++;
170745
+ this.version.svc++;
170752
170746
  }
170753
170747
  return this.svc;
170754
170748
  }
170755
- tryUseScriptVersionCache() {
170756
- if (!this.svc || this.pendingReloadFromDisk) {
170757
- this.getOrLoadText();
170758
- }
170749
+ useScriptVersionCacheIfValidOrOpen() {
170759
170750
  if (this.isOpen) {
170760
- if (!this.svc && !this.textSnapshot) {
170761
- this.svc = ScriptVersionCache.fromString(Debug.checkDefined(this.text));
170762
- this.textSnapshot = void 0;
170763
- }
170764
- return this.svc;
170751
+ return this.switchToScriptVersionCache();
170752
+ }
170753
+ if (this.pendingReloadFromDisk) {
170754
+ this.reloadWithFileText();
170765
170755
  }
170766
170756
  return this.svc;
170767
170757
  }
@@ -170774,14 +170764,13 @@ var TextStorage = class {
170774
170764
  }
170775
170765
  getLineMap() {
170776
170766
  Debug.assert(!this.svc, "ScriptVersionCache should not be set");
170777
- return this.lineMap || (this.lineMap = computeLineStarts(Debug.checkDefined(this.text)));
170767
+ return this.lineMap || (this.lineMap = computeLineStarts(this.getOrLoadText()));
170778
170768
  }
170779
170769
  getLineInfo() {
170780
- const svc = this.tryUseScriptVersionCache();
170781
- if (svc) {
170770
+ if (this.svc) {
170782
170771
  return {
170783
- getLineCount: () => svc.getLineCount(),
170784
- getLineText: (line) => svc.getAbsolutePositionAndLineText(line + 1).lineText
170772
+ getLineCount: () => this.svc.getLineCount(),
170773
+ getLineText: (line) => this.svc.getAbsolutePositionAndLineText(line + 1).lineText
170785
170774
  };
170786
170775
  }
170787
170776
  const lineMap = this.getLineMap();
@@ -170805,11 +170794,20 @@ var ScriptInfo = class {
170805
170794
  this.isDynamic = isDynamicFileName(fileName);
170806
170795
  this.textStorage = new TextStorage(host, this, initialVersion);
170807
170796
  if (hasMixedContent || this.isDynamic) {
170797
+ this.textStorage.reload("");
170808
170798
  this.realpath = this.path;
170809
170799
  }
170810
170800
  this.scriptKind = scriptKind ? scriptKind : getScriptKindFromFileName(fileName);
170811
170801
  }
170812
170802
  /** @internal */
170803
+ getVersion() {
170804
+ return this.textStorage.version;
170805
+ }
170806
+ /** @internal */
170807
+ getTelemetryFileSize() {
170808
+ return this.textStorage.getTelemetryFileSize();
170809
+ }
170810
+ /** @internal */
170813
170811
  isDynamicOrHasMixedContent() {
170814
170812
  return this.hasMixedContent || this.isDynamic;
170815
170813
  }
@@ -170824,7 +170822,11 @@ var ScriptInfo = class {
170824
170822
  }
170825
170823
  close(fileExists = true) {
170826
170824
  this.textStorage.isOpen = false;
170827
- if (fileExists && this.textStorage.scheduleReloadIfNeeded()) {
170825
+ if (this.isDynamicOrHasMixedContent() || !fileExists) {
170826
+ if (this.textStorage.reload("")) {
170827
+ this.markContainingProjectsAsDirty();
170828
+ }
170829
+ } else if (this.textStorage.reloadFromDisk()) {
170828
170830
  this.markContainingProjectsAsDirty();
170829
170831
  }
170830
170832
  }
@@ -171004,12 +171006,22 @@ var ScriptInfo = class {
171004
171006
  this.markContainingProjectsAsDirty();
171005
171007
  }
171006
171008
  reloadFromFile(tempFileName) {
171007
- if (this.textStorage.reloadWithFileText(tempFileName)) {
171009
+ if (this.isDynamicOrHasMixedContent()) {
171010
+ this.textStorage.reload("");
171008
171011
  this.markContainingProjectsAsDirty();
171009
171012
  return true;
171013
+ } else {
171014
+ if (this.textStorage.reloadWithFileText(tempFileName)) {
171015
+ this.markContainingProjectsAsDirty();
171016
+ return true;
171017
+ }
171010
171018
  }
171011
171019
  return false;
171012
171020
  }
171021
+ /** @internal */
171022
+ getAbsolutePositionAndLineText(line) {
171023
+ return this.textStorage.getAbsolutePositionAndLineText(line);
171024
+ }
171013
171025
  editContent(start2, end, newText) {
171014
171026
  this.textStorage.edit(start2, end, newText);
171015
171027
  this.markContainingProjectsAsDirty();
@@ -171049,6 +171061,10 @@ var ScriptInfo = class {
171049
171061
  return this.scriptKind === 1 /* JS */ || this.scriptKind === 2 /* JSX */;
171050
171062
  }
171051
171063
  /** @internal */
171064
+ getLineInfo() {
171065
+ return this.textStorage.getLineInfo();
171066
+ }
171067
+ /** @internal */
171052
171068
  closeSourceMapFileWatcher() {
171053
171069
  if (this.sourceMapFilePath && !isString(this.sourceMapFilePath)) {
171054
171070
  closeFileWatcherOf(this.sourceMapFilePath);
@@ -171193,7 +171209,7 @@ function countEachFileTypes(infos, includeSizes = false) {
171193
171209
  deferredSize: 0
171194
171210
  };
171195
171211
  for (const info of infos) {
171196
- const fileSize = includeSizes ? info.textStorage.getTelemetryFileSize() : 0;
171212
+ const fileSize = includeSizes ? info.getTelemetryFileSize() : 0;
171197
171213
  switch (info.scriptKind) {
171198
171214
  case 1 /* JS */:
171199
171215
  result.js += 1;
@@ -172177,26 +172193,10 @@ var Project3 = class {
172177
172193
  const elapsed = timestamp() - start2;
172178
172194
  this.sendPerformanceEvent("UpdateGraph", elapsed);
172179
172195
  this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} Version: ${this.getProjectVersion()} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`);
172180
- if (this.projectService.logger.isTestLogger) {
172181
- if (this.program !== oldProgram) {
172182
- this.print(
172183
- /*writeProjectFileNames*/
172184
- true,
172185
- this.hasAddedorRemovedFiles,
172186
- /*writeFileVersionAndText*/
172187
- true
172188
- );
172189
- } else {
172190
- this.writeLog(`Same program as before`);
172191
- }
172192
- } else if (this.hasAddedorRemovedFiles) {
172196
+ if (this.hasAddedorRemovedFiles) {
172193
172197
  this.print(
172194
172198
  /*writeProjectFileNames*/
172195
- true,
172196
- /*writeFileExplaination*/
172197
- true,
172198
- /*writeFileVersionAndText*/
172199
- false
172199
+ true
172200
172200
  );
172201
172201
  } else if (this.program !== oldProgram) {
172202
172202
  this.writeLog(`Different program with same set of files`);
@@ -172306,16 +172306,6 @@ var Project3 = class {
172306
172306
  return this.projectService.getScriptInfo(uncheckedFileName);
172307
172307
  }
172308
172308
  filesToString(writeProjectFileNames) {
172309
- return this.filesToStringWorker(
172310
- writeProjectFileNames,
172311
- /*writeFileExplaination*/
172312
- true,
172313
- /*writeFileVersionAndText*/
172314
- false
172315
- );
172316
- }
172317
- /** @internal */
172318
- filesToStringWorker(writeProjectFileNames, writeFileExplaination, writeFileVersionAndText) {
172319
172309
  if (this.isInitialLoadPending())
172320
172310
  return " Files (0) InitialLoadPending\n";
172321
172311
  if (!this.program)
@@ -172325,33 +172315,23 @@ var Project3 = class {
172325
172315
  `;
172326
172316
  if (writeProjectFileNames) {
172327
172317
  for (const file of sourceFiles) {
172328
- strBuilder += ` ${file.fileName}${writeFileVersionAndText ? ` ${file.version} ${JSON.stringify(file.text)}` : ""}
172318
+ strBuilder += ` ${file.fileName}
172329
172319
  `;
172330
172320
  }
172331
- if (writeFileExplaination) {
172332
- strBuilder += "\n\n";
172333
- explainFiles(this.program, (s) => strBuilder += ` ${s}
172321
+ strBuilder += "\n\n";
172322
+ explainFiles(this.program, (s) => strBuilder += ` ${s}
172334
172323
  `);
172335
- }
172336
172324
  }
172337
172325
  return strBuilder;
172338
172326
  }
172339
172327
  /** @internal */
172340
- print(writeProjectFileNames, writeFileExplaination, writeFileVersionAndText) {
172328
+ print(writeProjectFileNames) {
172341
172329
  this.writeLog(`Project '${this.projectName}' (${ProjectKind[this.projectKind]})`);
172342
- this.writeLog(this.filesToStringWorker(
172343
- writeProjectFileNames && this.projectService.logger.hasLevel(3 /* verbose */),
172344
- writeFileExplaination && this.projectService.logger.hasLevel(3 /* verbose */),
172345
- writeFileVersionAndText && this.projectService.logger.hasLevel(3 /* verbose */)
172346
- ));
172330
+ this.writeLog(this.filesToString(writeProjectFileNames && this.projectService.logger.hasLevel(3 /* verbose */)));
172347
172331
  this.writeLog("-----------------------------------------------");
172348
172332
  if (this.autoImportProviderHost) {
172349
172333
  this.autoImportProviderHost.print(
172350
172334
  /*writeProjectFileNames*/
172351
- false,
172352
- /*writeFileExplaination*/
172353
- false,
172354
- /*writeFileVersionAndText*/
172355
172335
  false
172356
172336
  );
172357
172337
  }
@@ -174306,11 +174286,7 @@ var _ProjectService = class {
174306
174286
  this.logger.info("`remove Project::");
174307
174287
  project.print(
174308
174288
  /*writeProjectFileNames*/
174309
- true,
174310
- /*writeFileExplaination*/
174311
- true,
174312
- /*writeFileVersionAndText*/
174313
- false
174289
+ true
174314
174290
  );
174315
174291
  project.close();
174316
174292
  if (Debug.shouldAssert(1 /* Normal */)) {
@@ -174449,7 +174425,7 @@ var _ProjectService = class {
174449
174425
  }
174450
174426
  deleteScriptInfo(info) {
174451
174427
  this.filenameToScriptInfo.delete(info.path);
174452
- this.filenameToScriptInfoVersion.set(info.path, info.textStorage.version);
174428
+ this.filenameToScriptInfoVersion.set(info.path, info.getVersion());
174453
174429
  const realpath = info.getRealpathIfDifferent();
174454
174430
  if (realpath) {
174455
174431
  this.realpathToScriptInfos.remove(realpath, info);
@@ -175533,7 +175509,7 @@ Dynamic files must always be opened with service's current directory or service
175533
175509
  const documentPositionMapper = getDocumentPositionMapper(
175534
175510
  { getCanonicalFileName: this.toCanonicalFileName, log: (s) => this.logger.info(s), getSourceFileLike: (f) => this.getSourceFileLike(f, projectName, declarationInfo) },
175535
175511
  declarationInfo.fileName,
175536
- declarationInfo.textStorage.getLineInfo(),
175512
+ declarationInfo.getLineInfo(),
175537
175513
  readMapFile
175538
175514
  );
175539
175515
  readMapFile = void 0;
@@ -176664,10 +176640,6 @@ function isConfigFile(config) {
176664
176640
  function printProjectWithoutFileNames(project) {
176665
176641
  project.print(
176666
176642
  /*writeProjectFileNames*/
176667
- false,
176668
- /*writeFileExplaination*/
176669
- false,
176670
- /*writeFileVersionAndText*/
176671
176643
  false
176672
176644
  );
176673
176645
  }
@@ -179129,7 +179101,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
179129
179101
  formatOptions
179130
179102
  );
179131
179103
  if (args.key === "\n" && (!edits || edits.length === 0 || allEditsBeforePos(edits, position))) {
179132
- const { lineText, absolutePosition } = scriptInfo.textStorage.getAbsolutePositionAndLineText(args.line);
179104
+ const { lineText, absolutePosition } = scriptInfo.getAbsolutePositionAndLineText(args.line);
179133
179105
  if (lineText && lineText.search("\\S") < 0) {
179134
179106
  const preferredIndent = languageService.getIndentationAtPosition(file, position, formatOptions);
179135
179107
  let hasIndent = 0;
@@ -179354,7 +179326,6 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
179354
179326
  change(args) {
179355
179327
  const scriptInfo = this.projectService.getScriptInfo(args.file);
179356
179328
  Debug.assert(!!scriptInfo);
179357
- scriptInfo.textStorage.switchToScriptVersionCache();
179358
179329
  const start2 = scriptInfo.lineOffsetToPosition(args.line, args.offset);
179359
179330
  const end = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset);
179360
179331
  if (start2 >= 0) {
@@ -182090,7 +182061,6 @@ start(initializeNodeSystem(), require("os").platform());
182090
182061
  createTypeChecker,
182091
182062
  createTypeReferenceDirectiveResolutionCache,
182092
182063
  createTypeReferenceResolutionLoader,
182093
- createUnderscoreEscapedMultiMap,
182094
182064
  createUnparsedSourceFile,
182095
182065
  createWatchCompilerHost,
182096
182066
  createWatchCompilerHostOfConfigFile,
@@ -3065,6 +3065,10 @@ declare namespace ts {
3065
3065
  remove(path: NormalizedPath): void;
3066
3066
  }
3067
3067
  function isDynamicFileName(fileName: NormalizedPath): boolean;
3068
+ interface ScriptInfoVersion {
3069
+ svc: number;
3070
+ text: number;
3071
+ }
3068
3072
  class ScriptInfo {
3069
3073
  private readonly host;
3070
3074
  readonly fileName: NormalizedPath;
@@ -3077,9 +3081,10 @@ declare namespace ts {
3077
3081
  readonly containingProjects: Project[];
3078
3082
  private formatSettings;
3079
3083
  private preferences;
3080
- constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: number);
3084
+ private textStorage;
3085
+ constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: ScriptInfoVersion);
3081
3086
  isScriptOpen(): boolean;
3082
- open(newText: string | undefined): void;
3087
+ open(newText: string): void;
3083
3088
  close(fileExists?: boolean): void;
3084
3089
  getSnapshot(): IScriptSnapshot;
3085
3090
  private ensureRealPath;
@@ -1000,9 +1000,6 @@ var ts = (() => {
1000
1000
  }
1001
1001
  }
1002
1002
  }
1003
- function createUnderscoreEscapedMultiMap() {
1004
- return createMultiMap();
1005
- }
1006
1003
  function createQueue(items) {
1007
1004
  const elements = (items == null ? void 0 : items.slice()) || [];
1008
1005
  let headIndex = 0;
@@ -48323,6 +48320,10 @@ ${lanes.join("\n")}
48323
48320
  return;
48324
48321
  merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
48325
48322
  });
48323
+ if (merged === exported) {
48324
+ getSymbolLinks(merged).resolvedExports = void 0;
48325
+ getSymbolLinks(merged).resolvedMembers = void 0;
48326
+ }
48326
48327
  getSymbolLinks(merged).cjsExportMerged = merged;
48327
48328
  return links.cjsExportMerged = merged;
48328
48329
  }
@@ -50209,7 +50210,7 @@ ${lanes.join("\n")}
50209
50210
  }
50210
50211
  }
50211
50212
  const mayHaveNameCollisions = !(context.flags & 64 /* UseFullyQualifiedType */);
50212
- const seenNames = mayHaveNameCollisions ? createUnderscoreEscapedMultiMap() : void 0;
50213
+ const seenNames = mayHaveNameCollisions ? createMultiMap() : void 0;
50213
50214
  const result = [];
50214
50215
  let i = 0;
50215
50216
  for (const type of types) {
@@ -51776,7 +51777,8 @@ ${lanes.join("\n")}
51776
51777
  ), modifierFlags);
51777
51778
  }
51778
51779
  function getNamespaceMembersForSerialization(symbol) {
51779
- return !symbol.exports ? [] : filter(arrayFrom(symbol.exports.values()), isNamespaceMember);
51780
+ const exports = getExportsOfSymbol(symbol);
51781
+ return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
51780
51782
  }
51781
51783
  function isTypeOnlyNamespace(symbol) {
51782
51784
  return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
@@ -106714,7 +106716,7 @@ ${lanes.join("\n")}
106714
106716
 
106715
106717
  // src/compiler/transformers/declarations/diagnostics.ts
106716
106718
  function canProduceDiagnostics(node) {
106717
- return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
106719
+ return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
106718
106720
  }
106719
106721
  function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
106720
106722
  if (isSetAccessor(node) || isGetAccessor(node)) {
@@ -106760,7 +106762,7 @@ ${lanes.join("\n")}
106760
106762
  }
106761
106763
  }
106762
106764
  function createGetSymbolAccessibilityDiagnosticForNode(node) {
106763
- if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
106765
+ if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
106764
106766
  return getVariableDeclarationTypeVisibilityError;
106765
106767
  } else if (isSetAccessor(node) || isGetAccessor(node)) {
106766
106768
  return getAccessorDeclarationTypeVisibilityError;
@@ -106785,7 +106787,7 @@ ${lanes.join("\n")}
106785
106787
  function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
106786
106788
  if (node.kind === 257 /* VariableDeclaration */ || node.kind === 205 /* BindingElement */) {
106787
106789
  return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
106788
- } else if (node.kind === 169 /* PropertyDeclaration */ || node.kind === 208 /* PropertyAccessExpression */ || node.kind === 168 /* PropertySignature */ || node.kind === 166 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
106790
+ } else if (node.kind === 169 /* PropertyDeclaration */ || node.kind === 208 /* PropertyAccessExpression */ || node.kind === 209 /* ElementAccessExpression */ || node.kind === 223 /* BinaryExpression */ || node.kind === 168 /* PropertySignature */ || node.kind === 166 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
106789
106791
  if (isStatic(node)) {
106790
106792
  return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
106791
106793
  } else if (node.parent.kind === 260 /* ClassDeclaration */ || node.kind === 166 /* Parameter */) {
@@ -108243,13 +108245,16 @@ ${lanes.join("\n")}
108243
108245
  fakespace.symbol = props[0].parent;
108244
108246
  const exportMappings = [];
108245
108247
  let declarations = mapDefined(props, (p) => {
108246
- if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
108248
+ if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
108249
+ return void 0;
108250
+ }
108251
+ const nameStr = unescapeLeadingUnderscores(p.escapedName);
108252
+ if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
108247
108253
  return void 0;
108248
108254
  }
108249
108255
  getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
108250
108256
  const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
108251
108257
  getSymbolAccessibilityDiagnostic = oldDiag;
108252
- const nameStr = unescapeLeadingUnderscores(p.escapedName);
108253
108258
  const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
108254
108259
  const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
108255
108260
  if (isNonContextualKeywordName) {
@@ -149158,7 +149163,8 @@ ${lanes.join("\n")}
149158
149163
  }
149159
149164
  log("getCompletionData: Semantic work: " + (timestamp() - semanticStart));
149160
149165
  const contextualType = previousToken && getContextualType(previousToken, position, sourceFile, typeChecker);
149161
- const literals = mapDefined(
149166
+ const isLiteralExpected = !tryCast(previousToken, isStringLiteralLike) && !isJsxIdentifierExpected;
149167
+ const literals = !isLiteralExpected ? [] : mapDefined(
149162
149168
  contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]),
149163
149169
  (t) => t.isLiteral() && !(t.flags & 1024 /* EnumLiteral */) ? t.value : void 0
149164
149170
  );
@@ -167926,14 +167932,17 @@ ${options.prefix}` : "\n" : options.prefix
167926
167932
  * True when reloading contents of file from the disk is pending
167927
167933
  */
167928
167934
  this.pendingReloadFromDisk = false;
167929
- this.version = initialVersion || 0;
167935
+ this.version = initialVersion || { svc: 0, text: 0 };
167930
167936
  }
167931
167937
  getVersion() {
167932
- return this.svc ? `SVC-${this.version}-${this.svc.getSnapshotVersion()}` : `Text-${this.version}`;
167938
+ return this.svc ? `SVC-${this.version.svc}-${this.svc.getSnapshotVersion()}` : `Text-${this.version.text}`;
167933
167939
  }
167934
167940
  hasScriptVersionCache_TestOnly() {
167935
167941
  return this.svc !== void 0;
167936
167942
  }
167943
+ useScriptVersionCache_TestOnly() {
167944
+ this.switchToScriptVersionCache();
167945
+ }
167937
167946
  resetSourceMapInfo() {
167938
167947
  this.info.sourceFileLike = void 0;
167939
167948
  this.info.closeSourceMapFileWatcher();
@@ -167946,17 +167955,15 @@ ${options.prefix}` : "\n" : options.prefix
167946
167955
  useText(newText) {
167947
167956
  this.svc = void 0;
167948
167957
  this.text = newText;
167949
- this.textSnapshot = void 0;
167950
167958
  this.lineMap = void 0;
167951
167959
  this.fileSize = void 0;
167952
167960
  this.resetSourceMapInfo();
167953
- this.version++;
167961
+ this.version.text++;
167954
167962
  }
167955
167963
  edit(start, end, newText) {
167956
167964
  this.switchToScriptVersionCache().edit(start, end - start, newText);
167957
167965
  this.ownFileText = false;
167958
167966
  this.text = void 0;
167959
- this.textSnapshot = void 0;
167960
167967
  this.lineMap = void 0;
167961
167968
  this.fileSize = void 0;
167962
167969
  this.resetSourceMapInfo();
@@ -167968,9 +167975,6 @@ ${options.prefix}` : "\n" : options.prefix
167968
167975
  reload(newText) {
167969
167976
  Debug.assert(newText !== void 0);
167970
167977
  this.pendingReloadFromDisk = false;
167971
- if (!this.text && this.svc) {
167972
- this.text = getSnapshotText(this.svc.getSnapshot());
167973
- }
167974
167978
  if (this.text !== newText) {
167975
167979
  this.useText(newText);
167976
167980
  this.ownFileText = false;
@@ -167983,18 +167987,21 @@ ${options.prefix}` : "\n" : options.prefix
167983
167987
  * returns true if text changed
167984
167988
  */
167985
167989
  reloadWithFileText(tempFileName) {
167986
- const { text: newText, fileSize } = tempFileName || !this.info.isDynamicOrHasMixedContent() ? this.getFileTextAndSize(tempFileName) : { text: "", fileSize: void 0 };
167990
+ const { text: newText, fileSize } = this.getFileTextAndSize(tempFileName);
167987
167991
  const reloaded = this.reload(newText);
167988
167992
  this.fileSize = fileSize;
167989
167993
  this.ownFileText = !tempFileName || tempFileName === this.info.fileName;
167990
167994
  return reloaded;
167991
167995
  }
167992
167996
  /**
167993
- * Schedule reload from the disk if its not already scheduled and its not own text
167994
- * returns true when scheduling reload
167997
+ * Reloads the contents from the file if there is no pending reload from disk or the contents of file are same as file text
167998
+ * returns true if text changed
167995
167999
  */
167996
- scheduleReloadIfNeeded() {
167997
- return !this.pendingReloadFromDisk && !this.ownFileText ? this.pendingReloadFromDisk = true : false;
168000
+ reloadFromDisk() {
168001
+ if (!this.pendingReloadFromDisk && !this.ownFileText) {
168002
+ return this.reloadWithFileText();
168003
+ }
168004
+ return false;
167998
168005
  }
167999
168006
  delayReloadFromFileIntoText() {
168000
168007
  this.pendingReloadFromDisk = true;
@@ -168010,48 +168017,39 @@ ${options.prefix}` : "\n" : options.prefix
168010
168017
  return !!this.fileSize ? this.fileSize : !!this.text ? this.text.length : !!this.svc ? this.svc.getSnapshot().getLength() : this.getSnapshot().getLength();
168011
168018
  }
168012
168019
  getSnapshot() {
168013
- var _a2, _b;
168014
- return ((_a2 = this.tryUseScriptVersionCache()) == null ? void 0 : _a2.getSnapshot()) || ((_b = this.textSnapshot) != null ? _b : this.textSnapshot = ScriptSnapshot.fromString(Debug.checkDefined(this.text)));
168020
+ return this.useScriptVersionCacheIfValidOrOpen() ? this.svc.getSnapshot() : ScriptSnapshot.fromString(this.getOrLoadText());
168015
168021
  }
168016
- getAbsolutePositionAndLineText(oneBasedLine) {
168017
- const svc = this.tryUseScriptVersionCache();
168018
- if (svc)
168019
- return svc.getAbsolutePositionAndLineText(oneBasedLine);
168020
- const lineMap = this.getLineMap();
168021
- return oneBasedLine <= lineMap.length ? {
168022
- absolutePosition: lineMap[oneBasedLine - 1],
168023
- lineText: this.text.substring(lineMap[oneBasedLine - 1], lineMap[oneBasedLine])
168024
- } : {
168025
- absolutePosition: this.text.length,
168026
- lineText: void 0
168027
- };
168022
+ getAbsolutePositionAndLineText(line) {
168023
+ return this.switchToScriptVersionCache().getAbsolutePositionAndLineText(line);
168028
168024
  }
168029
168025
  /**
168030
168026
  * @param line 0 based index
168031
168027
  */
168032
168028
  lineToTextSpan(line) {
168033
- const svc = this.tryUseScriptVersionCache();
168034
- if (svc)
168035
- return svc.lineToTextSpan(line);
168036
- const lineMap = this.getLineMap();
168037
- const start = lineMap[line];
168038
- const end = line + 1 < lineMap.length ? lineMap[line + 1] : this.text.length;
168039
- return createTextSpanFromBounds(start, end);
168029
+ if (!this.useScriptVersionCacheIfValidOrOpen()) {
168030
+ const lineMap = this.getLineMap();
168031
+ const start = lineMap[line];
168032
+ const end = line + 1 < lineMap.length ? lineMap[line + 1] : this.text.length;
168033
+ return createTextSpanFromBounds(start, end);
168034
+ }
168035
+ return this.svc.lineToTextSpan(line);
168040
168036
  }
168041
168037
  /**
168042
168038
  * @param line 1 based index
168043
168039
  * @param offset 1 based index
168044
168040
  */
168045
168041
  lineOffsetToPosition(line, offset, allowEdits) {
168046
- const svc = this.tryUseScriptVersionCache();
168047
- return svc ? svc.lineOffsetToPosition(line, offset) : computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1, this.text, allowEdits);
168042
+ if (!this.useScriptVersionCacheIfValidOrOpen()) {
168043
+ return computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1, this.text, allowEdits);
168044
+ }
168045
+ return this.svc.lineOffsetToPosition(line, offset);
168048
168046
  }
168049
168047
  positionToLineOffset(position) {
168050
- const svc = this.tryUseScriptVersionCache();
168051
- if (svc)
168052
- return svc.positionToLineOffset(position);
168053
- const { line, character } = computeLineAndCharacterOfPosition(this.getLineMap(), position);
168054
- return { line: line + 1, offset: character + 1 };
168048
+ if (!this.useScriptVersionCacheIfValidOrOpen()) {
168049
+ const { line, character } = computeLineAndCharacterOfPosition(this.getLineMap(), position);
168050
+ return { line: line + 1, offset: character + 1 };
168051
+ }
168052
+ return this.svc.positionToLineOffset(position);
168055
168053
  }
168056
168054
  getFileTextAndSize(tempFileName) {
168057
168055
  let text;
@@ -168069,25 +168067,19 @@ ${options.prefix}` : "\n" : options.prefix
168069
168067
  }
168070
168068
  return { text: getText() };
168071
168069
  }
168072
- /** @internal */
168073
168070
  switchToScriptVersionCache() {
168074
168071
  if (!this.svc || this.pendingReloadFromDisk) {
168075
168072
  this.svc = ScriptVersionCache.fromString(this.getOrLoadText());
168076
- this.textSnapshot = void 0;
168077
- this.version++;
168073
+ this.version.svc++;
168078
168074
  }
168079
168075
  return this.svc;
168080
168076
  }
168081
- tryUseScriptVersionCache() {
168082
- if (!this.svc || this.pendingReloadFromDisk) {
168083
- this.getOrLoadText();
168084
- }
168077
+ useScriptVersionCacheIfValidOrOpen() {
168085
168078
  if (this.isOpen) {
168086
- if (!this.svc && !this.textSnapshot) {
168087
- this.svc = ScriptVersionCache.fromString(Debug.checkDefined(this.text));
168088
- this.textSnapshot = void 0;
168089
- }
168090
- return this.svc;
168079
+ return this.switchToScriptVersionCache();
168080
+ }
168081
+ if (this.pendingReloadFromDisk) {
168082
+ this.reloadWithFileText();
168091
168083
  }
168092
168084
  return this.svc;
168093
168085
  }
@@ -168100,14 +168092,13 @@ ${options.prefix}` : "\n" : options.prefix
168100
168092
  }
168101
168093
  getLineMap() {
168102
168094
  Debug.assert(!this.svc, "ScriptVersionCache should not be set");
168103
- return this.lineMap || (this.lineMap = computeLineStarts(Debug.checkDefined(this.text)));
168095
+ return this.lineMap || (this.lineMap = computeLineStarts(this.getOrLoadText()));
168104
168096
  }
168105
168097
  getLineInfo() {
168106
- const svc = this.tryUseScriptVersionCache();
168107
- if (svc) {
168098
+ if (this.svc) {
168108
168099
  return {
168109
- getLineCount: () => svc.getLineCount(),
168110
- getLineText: (line) => svc.getAbsolutePositionAndLineText(line + 1).lineText
168100
+ getLineCount: () => this.svc.getLineCount(),
168101
+ getLineText: (line) => this.svc.getAbsolutePositionAndLineText(line + 1).lineText
168111
168102
  };
168112
168103
  }
168113
168104
  const lineMap = this.getLineMap();
@@ -168128,11 +168119,20 @@ ${options.prefix}` : "\n" : options.prefix
168128
168119
  this.isDynamic = isDynamicFileName(fileName);
168129
168120
  this.textStorage = new TextStorage(host, this, initialVersion);
168130
168121
  if (hasMixedContent || this.isDynamic) {
168122
+ this.textStorage.reload("");
168131
168123
  this.realpath = this.path;
168132
168124
  }
168133
168125
  this.scriptKind = scriptKind ? scriptKind : getScriptKindFromFileName(fileName);
168134
168126
  }
168135
168127
  /** @internal */
168128
+ getVersion() {
168129
+ return this.textStorage.version;
168130
+ }
168131
+ /** @internal */
168132
+ getTelemetryFileSize() {
168133
+ return this.textStorage.getTelemetryFileSize();
168134
+ }
168135
+ /** @internal */
168136
168136
  isDynamicOrHasMixedContent() {
168137
168137
  return this.hasMixedContent || this.isDynamic;
168138
168138
  }
@@ -168147,7 +168147,11 @@ ${options.prefix}` : "\n" : options.prefix
168147
168147
  }
168148
168148
  close(fileExists = true) {
168149
168149
  this.textStorage.isOpen = false;
168150
- if (fileExists && this.textStorage.scheduleReloadIfNeeded()) {
168150
+ if (this.isDynamicOrHasMixedContent() || !fileExists) {
168151
+ if (this.textStorage.reload("")) {
168152
+ this.markContainingProjectsAsDirty();
168153
+ }
168154
+ } else if (this.textStorage.reloadFromDisk()) {
168151
168155
  this.markContainingProjectsAsDirty();
168152
168156
  }
168153
168157
  }
@@ -168327,12 +168331,22 @@ ${options.prefix}` : "\n" : options.prefix
168327
168331
  this.markContainingProjectsAsDirty();
168328
168332
  }
168329
168333
  reloadFromFile(tempFileName) {
168330
- if (this.textStorage.reloadWithFileText(tempFileName)) {
168334
+ if (this.isDynamicOrHasMixedContent()) {
168335
+ this.textStorage.reload("");
168331
168336
  this.markContainingProjectsAsDirty();
168332
168337
  return true;
168338
+ } else {
168339
+ if (this.textStorage.reloadWithFileText(tempFileName)) {
168340
+ this.markContainingProjectsAsDirty();
168341
+ return true;
168342
+ }
168333
168343
  }
168334
168344
  return false;
168335
168345
  }
168346
+ /** @internal */
168347
+ getAbsolutePositionAndLineText(line) {
168348
+ return this.textStorage.getAbsolutePositionAndLineText(line);
168349
+ }
168336
168350
  editContent(start, end, newText) {
168337
168351
  this.textStorage.edit(start, end, newText);
168338
168352
  this.markContainingProjectsAsDirty();
@@ -168372,6 +168386,10 @@ ${options.prefix}` : "\n" : options.prefix
168372
168386
  return this.scriptKind === 1 /* JS */ || this.scriptKind === 2 /* JSX */;
168373
168387
  }
168374
168388
  /** @internal */
168389
+ getLineInfo() {
168390
+ return this.textStorage.getLineInfo();
168391
+ }
168392
+ /** @internal */
168375
168393
  closeSourceMapFileWatcher() {
168376
168394
  if (this.sourceMapFilePath && !isString(this.sourceMapFilePath)) {
168377
168395
  closeFileWatcherOf(this.sourceMapFilePath);
@@ -168502,7 +168520,7 @@ ${options.prefix}` : "\n" : options.prefix
168502
168520
  deferredSize: 0
168503
168521
  };
168504
168522
  for (const info of infos) {
168505
- const fileSize = includeSizes ? info.textStorage.getTelemetryFileSize() : 0;
168523
+ const fileSize = includeSizes ? info.getTelemetryFileSize() : 0;
168506
168524
  switch (info.scriptKind) {
168507
168525
  case 1 /* JS */:
168508
168526
  result.js += 1;
@@ -169532,26 +169550,10 @@ ${options.prefix}` : "\n" : options.prefix
169532
169550
  const elapsed = timestamp() - start;
169533
169551
  this.sendPerformanceEvent("UpdateGraph", elapsed);
169534
169552
  this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} Version: ${this.getProjectVersion()} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`);
169535
- if (this.projectService.logger.isTestLogger) {
169536
- if (this.program !== oldProgram) {
169537
- this.print(
169538
- /*writeProjectFileNames*/
169539
- true,
169540
- this.hasAddedorRemovedFiles,
169541
- /*writeFileVersionAndText*/
169542
- true
169543
- );
169544
- } else {
169545
- this.writeLog(`Same program as before`);
169546
- }
169547
- } else if (this.hasAddedorRemovedFiles) {
169553
+ if (this.hasAddedorRemovedFiles) {
169548
169554
  this.print(
169549
169555
  /*writeProjectFileNames*/
169550
- true,
169551
- /*writeFileExplaination*/
169552
- true,
169553
- /*writeFileVersionAndText*/
169554
- false
169556
+ true
169555
169557
  );
169556
169558
  } else if (this.program !== oldProgram) {
169557
169559
  this.writeLog(`Different program with same set of files`);
@@ -169661,16 +169663,6 @@ ${options.prefix}` : "\n" : options.prefix
169661
169663
  return this.projectService.getScriptInfo(uncheckedFileName);
169662
169664
  }
169663
169665
  filesToString(writeProjectFileNames) {
169664
- return this.filesToStringWorker(
169665
- writeProjectFileNames,
169666
- /*writeFileExplaination*/
169667
- true,
169668
- /*writeFileVersionAndText*/
169669
- false
169670
- );
169671
- }
169672
- /** @internal */
169673
- filesToStringWorker(writeProjectFileNames, writeFileExplaination, writeFileVersionAndText) {
169674
169666
  if (this.isInitialLoadPending())
169675
169667
  return " Files (0) InitialLoadPending\n";
169676
169668
  if (!this.program)
@@ -169680,33 +169672,23 @@ ${options.prefix}` : "\n" : options.prefix
169680
169672
  `;
169681
169673
  if (writeProjectFileNames) {
169682
169674
  for (const file of sourceFiles) {
169683
- strBuilder += ` ${file.fileName}${writeFileVersionAndText ? ` ${file.version} ${JSON.stringify(file.text)}` : ""}
169675
+ strBuilder += ` ${file.fileName}
169684
169676
  `;
169685
169677
  }
169686
- if (writeFileExplaination) {
169687
- strBuilder += "\n\n";
169688
- explainFiles(this.program, (s) => strBuilder += ` ${s}
169678
+ strBuilder += "\n\n";
169679
+ explainFiles(this.program, (s) => strBuilder += ` ${s}
169689
169680
  `);
169690
- }
169691
169681
  }
169692
169682
  return strBuilder;
169693
169683
  }
169694
169684
  /** @internal */
169695
- print(writeProjectFileNames, writeFileExplaination, writeFileVersionAndText) {
169685
+ print(writeProjectFileNames) {
169696
169686
  this.writeLog(`Project '${this.projectName}' (${ProjectKind[this.projectKind]})`);
169697
- this.writeLog(this.filesToStringWorker(
169698
- writeProjectFileNames && this.projectService.logger.hasLevel(3 /* verbose */),
169699
- writeFileExplaination && this.projectService.logger.hasLevel(3 /* verbose */),
169700
- writeFileVersionAndText && this.projectService.logger.hasLevel(3 /* verbose */)
169701
- ));
169687
+ this.writeLog(this.filesToString(writeProjectFileNames && this.projectService.logger.hasLevel(3 /* verbose */)));
169702
169688
  this.writeLog("-----------------------------------------------");
169703
169689
  if (this.autoImportProviderHost) {
169704
169690
  this.autoImportProviderHost.print(
169705
169691
  /*writeProjectFileNames*/
169706
- false,
169707
- /*writeFileExplaination*/
169708
- false,
169709
- /*writeFileVersionAndText*/
169710
169692
  false
169711
169693
  );
169712
169694
  }
@@ -170957,10 +170939,6 @@ ${options.prefix}` : "\n" : options.prefix
170957
170939
  function printProjectWithoutFileNames(project) {
170958
170940
  project.print(
170959
170941
  /*writeProjectFileNames*/
170960
- false,
170961
- /*writeFileExplaination*/
170962
- false,
170963
- /*writeFileVersionAndText*/
170964
170942
  false
170965
170943
  );
170966
170944
  }
@@ -171665,11 +171643,7 @@ ${options.prefix}` : "\n" : options.prefix
171665
171643
  this.logger.info("`remove Project::");
171666
171644
  project.print(
171667
171645
  /*writeProjectFileNames*/
171668
- true,
171669
- /*writeFileExplaination*/
171670
- true,
171671
- /*writeFileVersionAndText*/
171672
- false
171646
+ true
171673
171647
  );
171674
171648
  project.close();
171675
171649
  if (Debug.shouldAssert(1 /* Normal */)) {
@@ -171808,7 +171782,7 @@ ${options.prefix}` : "\n" : options.prefix
171808
171782
  }
171809
171783
  deleteScriptInfo(info) {
171810
171784
  this.filenameToScriptInfo.delete(info.path);
171811
- this.filenameToScriptInfoVersion.set(info.path, info.textStorage.version);
171785
+ this.filenameToScriptInfoVersion.set(info.path, info.getVersion());
171812
171786
  const realpath = info.getRealpathIfDifferent();
171813
171787
  if (realpath) {
171814
171788
  this.realpathToScriptInfos.remove(realpath, info);
@@ -172892,7 +172866,7 @@ Dynamic files must always be opened with service's current directory or service
172892
172866
  const documentPositionMapper = getDocumentPositionMapper(
172893
172867
  { getCanonicalFileName: this.toCanonicalFileName, log: (s) => this.logger.info(s), getSourceFileLike: (f) => this.getSourceFileLike(f, projectName, declarationInfo) },
172894
172868
  declarationInfo.fileName,
172895
- declarationInfo.textStorage.getLineInfo(),
172869
+ declarationInfo.getLineInfo(),
172896
172870
  readMapFile
172897
172871
  );
172898
172872
  readMapFile = void 0;
@@ -176544,7 +176518,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
176544
176518
  formatOptions
176545
176519
  );
176546
176520
  if (args.key === "\n" && (!edits || edits.length === 0 || allEditsBeforePos(edits, position))) {
176547
- const { lineText, absolutePosition } = scriptInfo.textStorage.getAbsolutePositionAndLineText(args.line);
176521
+ const { lineText, absolutePosition } = scriptInfo.getAbsolutePositionAndLineText(args.line);
176548
176522
  if (lineText && lineText.search("\\S") < 0) {
176549
176523
  const preferredIndent = languageService.getIndentationAtPosition(file, position, formatOptions);
176550
176524
  let hasIndent = 0;
@@ -176769,7 +176743,6 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
176769
176743
  change(args) {
176770
176744
  const scriptInfo = this.projectService.getScriptInfo(args.file);
176771
176745
  Debug.assert(!!scriptInfo);
176772
- scriptInfo.textStorage.switchToScriptVersionCache();
176773
176746
  const start = scriptInfo.lineOffsetToPosition(args.line, args.offset);
176774
176747
  const end = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset);
176775
176748
  if (start >= 0) {
@@ -178725,7 +178698,6 @@ ${e.message}`;
178725
178698
  createTypeChecker: () => createTypeChecker,
178726
178699
  createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache,
178727
178700
  createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader,
178728
- createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap,
178729
178701
  createUnparsedSourceFile: () => createUnparsedSourceFile,
178730
178702
  createWatchCompilerHost: () => createWatchCompilerHost2,
178731
178703
  createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile,
@@ -181085,7 +181057,6 @@ ${e.message}`;
181085
181057
  createTypeChecker: () => createTypeChecker,
181086
181058
  createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache,
181087
181059
  createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader,
181088
- createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap,
181089
181060
  createUnparsedSourceFile: () => createUnparsedSourceFile,
181090
181061
  createWatchCompilerHost: () => createWatchCompilerHost2,
181091
181062
  createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile,
package/lib/typescript.js CHANGED
@@ -1000,9 +1000,6 @@ var ts = (() => {
1000
1000
  }
1001
1001
  }
1002
1002
  }
1003
- function createUnderscoreEscapedMultiMap() {
1004
- return createMultiMap();
1005
- }
1006
1003
  function createQueue(items) {
1007
1004
  const elements = (items == null ? void 0 : items.slice()) || [];
1008
1005
  let headIndex = 0;
@@ -48323,6 +48320,10 @@ ${lanes.join("\n")}
48323
48320
  return;
48324
48321
  merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
48325
48322
  });
48323
+ if (merged === exported) {
48324
+ getSymbolLinks(merged).resolvedExports = void 0;
48325
+ getSymbolLinks(merged).resolvedMembers = void 0;
48326
+ }
48326
48327
  getSymbolLinks(merged).cjsExportMerged = merged;
48327
48328
  return links.cjsExportMerged = merged;
48328
48329
  }
@@ -50209,7 +50210,7 @@ ${lanes.join("\n")}
50209
50210
  }
50210
50211
  }
50211
50212
  const mayHaveNameCollisions = !(context.flags & 64 /* UseFullyQualifiedType */);
50212
- const seenNames = mayHaveNameCollisions ? createUnderscoreEscapedMultiMap() : void 0;
50213
+ const seenNames = mayHaveNameCollisions ? createMultiMap() : void 0;
50213
50214
  const result = [];
50214
50215
  let i = 0;
50215
50216
  for (const type of types) {
@@ -51776,7 +51777,8 @@ ${lanes.join("\n")}
51776
51777
  ), modifierFlags);
51777
51778
  }
51778
51779
  function getNamespaceMembersForSerialization(symbol) {
51779
- return !symbol.exports ? [] : filter(arrayFrom(symbol.exports.values()), isNamespaceMember);
51780
+ const exports = getExportsOfSymbol(symbol);
51781
+ return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
51780
51782
  }
51781
51783
  function isTypeOnlyNamespace(symbol) {
51782
51784
  return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
@@ -106714,7 +106716,7 @@ ${lanes.join("\n")}
106714
106716
 
106715
106717
  // src/compiler/transformers/declarations/diagnostics.ts
106716
106718
  function canProduceDiagnostics(node) {
106717
- return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
106719
+ return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
106718
106720
  }
106719
106721
  function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
106720
106722
  if (isSetAccessor(node) || isGetAccessor(node)) {
@@ -106760,7 +106762,7 @@ ${lanes.join("\n")}
106760
106762
  }
106761
106763
  }
106762
106764
  function createGetSymbolAccessibilityDiagnosticForNode(node) {
106763
- if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
106765
+ if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
106764
106766
  return getVariableDeclarationTypeVisibilityError;
106765
106767
  } else if (isSetAccessor(node) || isGetAccessor(node)) {
106766
106768
  return getAccessorDeclarationTypeVisibilityError;
@@ -106785,7 +106787,7 @@ ${lanes.join("\n")}
106785
106787
  function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
106786
106788
  if (node.kind === 257 /* VariableDeclaration */ || node.kind === 205 /* BindingElement */) {
106787
106789
  return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
106788
- } else if (node.kind === 169 /* PropertyDeclaration */ || node.kind === 208 /* PropertyAccessExpression */ || node.kind === 168 /* PropertySignature */ || node.kind === 166 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
106790
+ } else if (node.kind === 169 /* PropertyDeclaration */ || node.kind === 208 /* PropertyAccessExpression */ || node.kind === 209 /* ElementAccessExpression */ || node.kind === 223 /* BinaryExpression */ || node.kind === 168 /* PropertySignature */ || node.kind === 166 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
106789
106791
  if (isStatic(node)) {
106790
106792
  return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
106791
106793
  } else if (node.parent.kind === 260 /* ClassDeclaration */ || node.kind === 166 /* Parameter */) {
@@ -108243,13 +108245,16 @@ ${lanes.join("\n")}
108243
108245
  fakespace.symbol = props[0].parent;
108244
108246
  const exportMappings = [];
108245
108247
  let declarations = mapDefined(props, (p) => {
108246
- if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
108248
+ if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
108249
+ return void 0;
108250
+ }
108251
+ const nameStr = unescapeLeadingUnderscores(p.escapedName);
108252
+ if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
108247
108253
  return void 0;
108248
108254
  }
108249
108255
  getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
108250
108256
  const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
108251
108257
  getSymbolAccessibilityDiagnostic = oldDiag;
108252
- const nameStr = unescapeLeadingUnderscores(p.escapedName);
108253
108258
  const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
108254
108259
  const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
108255
108260
  if (isNonContextualKeywordName) {
@@ -149172,7 +149177,8 @@ ${lanes.join("\n")}
149172
149177
  }
149173
149178
  log("getCompletionData: Semantic work: " + (timestamp() - semanticStart));
149174
149179
  const contextualType = previousToken && getContextualType(previousToken, position, sourceFile, typeChecker);
149175
- const literals = mapDefined(
149180
+ const isLiteralExpected = !tryCast(previousToken, isStringLiteralLike) && !isJsxIdentifierExpected;
149181
+ const literals = !isLiteralExpected ? [] : mapDefined(
149176
149182
  contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]),
149177
149183
  (t) => t.isLiteral() && !(t.flags & 1024 /* EnumLiteral */) ? t.value : void 0
149178
149184
  );
@@ -167873,7 +167879,6 @@ ${options.prefix}` : "\n" : options.prefix
167873
167879
  createTypeChecker: () => createTypeChecker,
167874
167880
  createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache,
167875
167881
  createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader,
167876
- createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap,
167877
167882
  createUnparsedSourceFile: () => createUnparsedSourceFile,
167878
167883
  createWatchCompilerHost: () => createWatchCompilerHost2,
167879
167884
  createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.1.0-pr-53001-3",
5
+ "version": "5.1.0-pr-53034-6",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [