typescript 4.6.0-dev.20220102 → 4.6.0-dev.20220106

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
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-dev.20220102";
103
+ ts.version = ts.versionMajorMinor + ".0-dev.20220106";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -22242,7 +22242,7 @@ var ts;
22242
22242
  result.push(createModifier(144 /* ReadonlyKeyword */));
22243
22243
  if (flags & 256 /* Async */)
22244
22244
  result.push(createModifier(131 /* AsyncKeyword */));
22245
- return result;
22245
+ return result.length ? result : undefined;
22246
22246
  }
22247
22247
  //
22248
22248
  // Names
@@ -26199,32 +26199,36 @@ var ts;
26199
26199
  }
26200
26200
  function updateModifiers(node, modifiers) {
26201
26201
  var _a;
26202
+ var modifierArray;
26202
26203
  if (typeof modifiers === "number") {
26203
- modifiers = createModifiersFromModifierFlags(modifiers);
26204
- }
26205
- return ts.isParameter(node) ? updateParameterDeclaration(node, node.decorators, modifiers, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) :
26206
- ts.isPropertySignature(node) ? updatePropertySignature(node, modifiers, node.name, node.questionToken, node.type) :
26207
- ts.isPropertyDeclaration(node) ? updatePropertyDeclaration(node, node.decorators, modifiers, node.name, (_a = node.questionToken) !== null && _a !== void 0 ? _a : node.exclamationToken, node.type, node.initializer) :
26208
- ts.isMethodSignature(node) ? updateMethodSignature(node, modifiers, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) :
26209
- ts.isMethodDeclaration(node) ? updateMethodDeclaration(node, node.decorators, modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) :
26210
- ts.isConstructorDeclaration(node) ? updateConstructorDeclaration(node, node.decorators, modifiers, node.parameters, node.body) :
26211
- ts.isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, node.decorators, modifiers, node.name, node.parameters, node.type, node.body) :
26212
- ts.isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, node.decorators, modifiers, node.name, node.parameters, node.body) :
26213
- ts.isIndexSignatureDeclaration(node) ? updateIndexSignature(node, node.decorators, modifiers, node.parameters, node.type) :
26214
- ts.isFunctionExpression(node) ? updateFunctionExpression(node, modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
26215
- ts.isArrowFunction(node) ? updateArrowFunction(node, modifiers, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) :
26216
- ts.isClassExpression(node) ? updateClassExpression(node, node.decorators, modifiers, node.name, node.typeParameters, node.heritageClauses, node.members) :
26217
- ts.isVariableStatement(node) ? updateVariableStatement(node, modifiers, node.declarationList) :
26218
- ts.isFunctionDeclaration(node) ? updateFunctionDeclaration(node, node.decorators, modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
26219
- ts.isClassDeclaration(node) ? updateClassDeclaration(node, node.decorators, modifiers, node.name, node.typeParameters, node.heritageClauses, node.members) :
26220
- ts.isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, node.decorators, modifiers, node.name, node.typeParameters, node.heritageClauses, node.members) :
26221
- ts.isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, node.decorators, modifiers, node.name, node.typeParameters, node.type) :
26222
- ts.isEnumDeclaration(node) ? updateEnumDeclaration(node, node.decorators, modifiers, node.name, node.members) :
26223
- ts.isModuleDeclaration(node) ? updateModuleDeclaration(node, node.decorators, modifiers, node.name, node.body) :
26224
- ts.isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, node.decorators, modifiers, node.isTypeOnly, node.name, node.moduleReference) :
26225
- ts.isImportDeclaration(node) ? updateImportDeclaration(node, node.decorators, modifiers, node.importClause, node.moduleSpecifier, node.assertClause) :
26226
- ts.isExportAssignment(node) ? updateExportAssignment(node, node.decorators, modifiers, node.expression) :
26227
- ts.isExportDeclaration(node) ? updateExportDeclaration(node, node.decorators, modifiers, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) :
26204
+ modifierArray = createModifiersFromModifierFlags(modifiers);
26205
+ }
26206
+ else {
26207
+ modifierArray = modifiers;
26208
+ }
26209
+ return ts.isParameter(node) ? updateParameterDeclaration(node, node.decorators, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) :
26210
+ ts.isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) :
26211
+ ts.isPropertyDeclaration(node) ? updatePropertyDeclaration(node, node.decorators, modifierArray, node.name, (_a = node.questionToken) !== null && _a !== void 0 ? _a : node.exclamationToken, node.type, node.initializer) :
26212
+ ts.isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) :
26213
+ ts.isMethodDeclaration(node) ? updateMethodDeclaration(node, node.decorators, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) :
26214
+ ts.isConstructorDeclaration(node) ? updateConstructorDeclaration(node, node.decorators, modifierArray, node.parameters, node.body) :
26215
+ ts.isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, node.decorators, modifierArray, node.name, node.parameters, node.type, node.body) :
26216
+ ts.isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, node.decorators, modifierArray, node.name, node.parameters, node.body) :
26217
+ ts.isIndexSignatureDeclaration(node) ? updateIndexSignature(node, node.decorators, modifierArray, node.parameters, node.type) :
26218
+ ts.isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
26219
+ ts.isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) :
26220
+ ts.isClassExpression(node) ? updateClassExpression(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
26221
+ ts.isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) :
26222
+ ts.isFunctionDeclaration(node) ? updateFunctionDeclaration(node, node.decorators, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
26223
+ ts.isClassDeclaration(node) ? updateClassDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
26224
+ ts.isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
26225
+ ts.isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.type) :
26226
+ ts.isEnumDeclaration(node) ? updateEnumDeclaration(node, node.decorators, modifierArray, node.name, node.members) :
26227
+ ts.isModuleDeclaration(node) ? updateModuleDeclaration(node, node.decorators, modifierArray, node.name, node.body) :
26228
+ ts.isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, node.decorators, modifierArray, node.isTypeOnly, node.name, node.moduleReference) :
26229
+ ts.isImportDeclaration(node) ? updateImportDeclaration(node, node.decorators, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) :
26230
+ ts.isExportAssignment(node) ? updateExportAssignment(node, node.decorators, modifierArray, node.expression) :
26231
+ ts.isExportDeclaration(node) ? updateExportDeclaration(node, node.decorators, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) :
26228
26232
  ts.Debug.assertNever(node);
26229
26233
  }
26230
26234
  function asNodeArray(array) {
@@ -67437,7 +67441,8 @@ var ts;
67437
67441
  return access.kind === 205 /* PropertyAccessExpression */ ? access.name.escapedText :
67438
67442
  access.kind === 206 /* ElementAccessExpression */ && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
67439
67443
  access.kind === 202 /* BindingElement */ && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
67440
- undefined;
67444
+ access.kind === 163 /* Parameter */ ? ("" + access.parent.parameters.indexOf(access)) :
67445
+ undefined;
67441
67446
  }
67442
67447
  function containsMatchingReference(source, target) {
67443
67448
  while (ts.isAccessExpression(source)) {
@@ -68777,13 +68782,14 @@ var ts;
68777
68782
  return result;
68778
68783
  }
68779
68784
  function getCandidateDiscriminantPropertyAccess(expr) {
68780
- if (ts.isBindingPattern(reference)) {
68781
- // When the reference is a binding pattern, we are narrowing a pesudo-reference in getNarrowedTypeOfSymbol.
68782
- // An identifier for a destructuring variable declared in the same binding pattern is a candidate.
68785
+ if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference)) {
68786
+ // When the reference is a binding pattern or function or arrow expression, we are narrowing a pesudo-reference in
68787
+ // getNarrowedTypeOfSymbol. An identifier for a destructuring variable declared in the same binding pattern or
68788
+ // parameter declared in the same parameter list is a candidate.
68783
68789
  if (ts.isIdentifier(expr)) {
68784
68790
  var symbol = getResolvedSymbol(expr);
68785
68791
  var declaration = symbol.valueDeclaration;
68786
- if (declaration && ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && reference === declaration.parent) {
68792
+ if (declaration && (ts.isBindingElement(declaration) || ts.isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
68787
68793
  return declaration;
68788
68794
  }
68789
68795
  }
@@ -69585,42 +69591,78 @@ var ts;
69585
69591
  }
69586
69592
  }
69587
69593
  function getNarrowedTypeOfSymbol(symbol, location) {
69588
- // If we have a non-rest binding element with no initializer declared as a const variable or a const-like
69589
- // parameter (a parameter for which there are no assignments in the function body), and if the parent type
69590
- // for the destructuring is a union type, one or more of the binding elements may represent discriminant
69591
- // properties, and we want the effects of conditional checks on such discriminants to affect the types of
69592
- // other binding elements from the same destructuring. Consider:
69593
- //
69594
- // type Action =
69595
- // | { kind: 'A', payload: number }
69596
- // | { kind: 'B', payload: string };
69597
- //
69598
- // function f1({ kind, payload }: Action) {
69599
- // if (kind === 'A') {
69600
- // payload.toFixed();
69601
- // }
69602
- // if (kind === 'B') {
69603
- // payload.toUpperCase();
69604
- // }
69605
- // }
69606
- //
69607
- // Above, we want the conditional checks on 'kind' to affect the type of 'payload'. To facilitate this, we use
69608
- // the binding pattern AST instance for '{ kind, payload }' as a pseudo-reference and narrow this reference
69609
- // as if it occurred in the specified location. We then recompute the narrowed binding element type by
69610
- // destructuring from the narrowed parent type.
69611
69594
  var declaration = symbol.valueDeclaration;
69612
- if (declaration && ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
69613
- var parent = declaration.parent.parent;
69614
- if (parent.kind === 253 /* VariableDeclaration */ && ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || parent.kind === 163 /* Parameter */) {
69615
- var links = getNodeLinks(location);
69616
- if (!(links.flags & 268435456 /* InCheckIdentifier */)) {
69617
- links.flags |= 268435456 /* InCheckIdentifier */;
69618
- var parentType = getTypeForBindingElementParent(parent);
69619
- links.flags &= ~268435456 /* InCheckIdentifier */;
69620
- if (parentType && parentType.flags & 1048576 /* Union */ && !(parent.kind === 163 /* Parameter */ && isSymbolAssigned(symbol))) {
69621
- var pattern = declaration.parent;
69622
- var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, /*flowContainer*/ undefined, location.flowNode);
69623
- return getBindingElementTypeFromParentType(declaration, narrowedType);
69595
+ if (declaration) {
69596
+ // If we have a non-rest binding element with no initializer declared as a const variable or a const-like
69597
+ // parameter (a parameter for which there are no assignments in the function body), and if the parent type
69598
+ // for the destructuring is a union type, one or more of the binding elements may represent discriminant
69599
+ // properties, and we want the effects of conditional checks on such discriminants to affect the types of
69600
+ // other binding elements from the same destructuring. Consider:
69601
+ //
69602
+ // type Action =
69603
+ // | { kind: 'A', payload: number }
69604
+ // | { kind: 'B', payload: string };
69605
+ //
69606
+ // function f({ kind, payload }: Action) {
69607
+ // if (kind === 'A') {
69608
+ // payload.toFixed();
69609
+ // }
69610
+ // if (kind === 'B') {
69611
+ // payload.toUpperCase();
69612
+ // }
69613
+ // }
69614
+ //
69615
+ // Above, we want the conditional checks on 'kind' to affect the type of 'payload'. To facilitate this, we use
69616
+ // the binding pattern AST instance for '{ kind, payload }' as a pseudo-reference and narrow this reference
69617
+ // as if it occurred in the specified location. We then recompute the narrowed binding element type by
69618
+ // destructuring from the narrowed parent type.
69619
+ if (ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
69620
+ var parent = declaration.parent.parent;
69621
+ if (parent.kind === 253 /* VariableDeclaration */ && ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || parent.kind === 163 /* Parameter */) {
69622
+ var links = getNodeLinks(location);
69623
+ if (!(links.flags & 268435456 /* InCheckIdentifier */)) {
69624
+ links.flags |= 268435456 /* InCheckIdentifier */;
69625
+ var parentType = getTypeForBindingElementParent(parent);
69626
+ links.flags &= ~268435456 /* InCheckIdentifier */;
69627
+ if (parentType && parentType.flags & 1048576 /* Union */ && !(parent.kind === 163 /* Parameter */ && isSymbolAssigned(symbol))) {
69628
+ var pattern = declaration.parent;
69629
+ var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, /*flowContainer*/ undefined, location.flowNode);
69630
+ return getBindingElementTypeFromParentType(declaration, narrowedType);
69631
+ }
69632
+ }
69633
+ }
69634
+ }
69635
+ // If we have a const-like parameter with no type annotation or initializer, and if the parameter is contextually
69636
+ // typed by a signature with a single rest parameter of a union of tuple types, one or more of the parameters may
69637
+ // represent discriminant tuple elements, and we want the effects of conditional checks on such discriminants to
69638
+ // affect the types of other parameters in the same parameter list. Consider:
69639
+ //
69640
+ // type Action = [kind: 'A', payload: number] | [kind: 'B', payload: string];
69641
+ //
69642
+ // const f: (...args: Action) => void = (kind, payload) => {
69643
+ // if (kind === 'A') {
69644
+ // payload.toFixed();
69645
+ // }
69646
+ // if (kind === 'B') {
69647
+ // payload.toUpperCase();
69648
+ // }
69649
+ // }
69650
+ //
69651
+ // Above, we want the conditional checks on 'kind' to affect the type of 'payload'. To facilitate this, we use
69652
+ // the arrow function AST node for '(kind, payload) => ...' as a pseudo-reference and narrow this reference as
69653
+ // if it occurred in the specified location. We then recompute the narrowed parameter type by indexing into the
69654
+ // narrowed tuple type.
69655
+ if (ts.isParameter(declaration) && !declaration.type && !declaration.initializer && !declaration.dotDotDotToken) {
69656
+ var func = declaration.parent;
69657
+ if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
69658
+ var contextualSignature = getContextualSignature(func);
69659
+ if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
69660
+ var restType = getTypeOfSymbol(contextualSignature.parameters[0]);
69661
+ if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
69662
+ var narrowedType = getFlowTypeOfReference(func, restType, restType, /*flowContainer*/ undefined, location.flowNode);
69663
+ var index = func.parameters.indexOf(declaration) - (ts.getThisParameter(func) ? 1 : 0);
69664
+ return getIndexedAccessType(narrowedType, getNumberLiteralType(index));
69665
+ }
69624
69666
  }
69625
69667
  }
69626
69668
  }
@@ -109018,7 +109060,7 @@ var ts;
109018
109060
  emitPlaceholder(hint, node, snippet);
109019
109061
  break;
109020
109062
  case 0 /* TabStop */:
109021
- emitTabStop(snippet);
109063
+ emitTabStop(hint, node, snippet);
109022
109064
  break;
109023
109065
  }
109024
109066
  }
@@ -109028,7 +109070,10 @@ var ts;
109028
109070
  nonEscapingWrite("}"); // `}`
109029
109071
  // `${2:...}`
109030
109072
  }
109031
- function emitTabStop(snippet) {
109073
+ function emitTabStop(hint, node, snippet) {
109074
+ // A tab stop should only be attached to an empty node, i.e. a node that doesn't emit any text.
109075
+ ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
109076
+ ts.Debug.assert(hint !== 5 /* EmbeddedStatement */, "A tab stop cannot be attached to an embedded statement.");
109032
109077
  nonEscapingWrite("$" + snippet.order);
109033
109078
  }
109034
109079
  //
@@ -126166,6 +126211,16 @@ var ts;
126166
126211
  : ts.getLocaleSpecificMessage(diag);
126167
126212
  }
126168
126213
  ts.diagnosticToString = diagnosticToString;
126214
+ /**
126215
+ * Get format code settings for a code writing context (e.g. when formatting text changes or completions code).
126216
+ */
126217
+ function getFormatCodeSettingsForWriting(_a, sourceFile) {
126218
+ var options = _a.options;
126219
+ var shouldAutoDetectSemicolonPreference = !options.semicolons || options.semicolons === ts.SemicolonPreference.Ignore;
126220
+ var shouldRemoveSemicolons = options.semicolons === ts.SemicolonPreference.Remove || shouldAutoDetectSemicolonPreference && !probablyUsesSemicolons(sourceFile);
126221
+ return __assign(__assign({}, options), { semicolons: shouldRemoveSemicolons ? ts.SemicolonPreference.Remove : ts.SemicolonPreference.Ignore });
126222
+ }
126223
+ ts.getFormatCodeSettingsForWriting = getFormatCodeSettingsForWriting;
126169
126224
  // #endregion
126170
126225
  })(ts || (ts = {}));
126171
126226
  /*@internal*/
@@ -127789,7 +127844,8 @@ var ts;
127789
127844
  return convertPathCompletions(completion.paths);
127790
127845
  case 1 /* Properties */: {
127791
127846
  var entries = ts.createSortedArray();
127792
- Completions.getCompletionEntriesFromSymbols(completion.symbols, entries, contextToken, contextToken, sourceFile, sourceFile, host, program, 99 /* ESNext */, log, 4 /* String */, preferences, options); // Target will not be used, so arbitrary
127847
+ Completions.getCompletionEntriesFromSymbols(completion.symbols, entries, contextToken, contextToken, sourceFile, sourceFile, host, program, 99 /* ESNext */, log, 4 /* String */, preferences, options,
127848
+ /*formatContext*/ undefined); // Target will not be used, so arbitrary
127793
127849
  return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan: optionalReplacementSpan, entries: entries };
127794
127850
  }
127795
127851
  case 2 /* Types */: {
@@ -128610,7 +128666,7 @@ var ts;
128610
128666
  return result;
128611
128667
  }
128612
128668
  }
128613
- function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken) {
128669
+ function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext) {
128614
128670
  var _a;
128615
128671
  var previousToken = getRelevantTokens(position, sourceFile).previousToken;
128616
128672
  if (triggerCharacter && !ts.isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) {
@@ -128650,7 +128706,7 @@ var ts;
128650
128706
  }
128651
128707
  switch (completionData.kind) {
128652
128708
  case 0 /* Data */:
128653
- var response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences);
128709
+ var response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext);
128654
128710
  if (response === null || response === void 0 ? void 0 : response.isIncomplete) {
128655
128711
  incompleteCompletionsCache === null || incompleteCompletionsCache === void 0 ? void 0 : incompleteCompletionsCache.set(response);
128656
128712
  }
@@ -128770,7 +128826,7 @@ var ts;
128770
128826
  // StringLiteralLike locations are handled separately in stringCompletions.ts
128771
128827
  return (location === null || location === void 0 ? void 0 : location.kind) === 79 /* Identifier */ ? ts.createTextSpanFromNode(location) : undefined;
128772
128828
  }
128773
- function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences) {
128829
+ function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext) {
128774
128830
  var symbols = completionData.symbols, contextToken = completionData.contextToken, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, literals = completionData.literals, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer, isTypeOnlyLocation = completionData.isTypeOnlyLocation, isJsxIdentifierExpected = completionData.isJsxIdentifierExpected, importCompletionNode = completionData.importCompletionNode, insideJsDocTagTypeExpression = completionData.insideJsDocTagTypeExpression, symbolToSortTextIdMap = completionData.symbolToSortTextIdMap, hasUnresolvedAutoImports = completionData.hasUnresolvedAutoImports;
128775
128831
  // Verify if the file is JSX language variant
128776
128832
  if (ts.getLanguageVariant(sourceFile.scriptKind) === 1 /* JSX */) {
@@ -128782,7 +128838,7 @@ var ts;
128782
128838
  var entries = ts.createSortedArray();
128783
128839
  if (isUncheckedFile(sourceFile, compilerOptions)) {
128784
128840
  var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries,
128785
- /*replacementToken*/ undefined, contextToken, location, sourceFile, host, program, ts.getEmitScriptTarget(compilerOptions), log, completionKind, preferences, compilerOptions, isTypeOnlyLocation, propertyAccessToConvert, isJsxIdentifierExpected, isJsxInitializer, importCompletionNode, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextIdMap);
128841
+ /*replacementToken*/ undefined, contextToken, location, sourceFile, host, program, ts.getEmitScriptTarget(compilerOptions), log, completionKind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, isJsxIdentifierExpected, isJsxInitializer, importCompletionNode, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextIdMap);
128786
128842
  getJSCompletionEntries(sourceFile, location.pos, uniqueNames, ts.getEmitScriptTarget(compilerOptions), entries); // TODO: GH#18217
128787
128843
  }
128788
128844
  else {
@@ -128790,7 +128846,7 @@ var ts;
128790
128846
  return undefined;
128791
128847
  }
128792
128848
  getCompletionEntriesFromSymbols(symbols, entries,
128793
- /*replacementToken*/ undefined, contextToken, location, sourceFile, host, program, ts.getEmitScriptTarget(compilerOptions), log, completionKind, preferences, compilerOptions, isTypeOnlyLocation, propertyAccessToConvert, isJsxIdentifierExpected, isJsxInitializer, importCompletionNode, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextIdMap);
128849
+ /*replacementToken*/ undefined, contextToken, location, sourceFile, host, program, ts.getEmitScriptTarget(compilerOptions), log, completionKind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, isJsxIdentifierExpected, isJsxInitializer, importCompletionNode, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextIdMap);
128794
128850
  }
128795
128851
  if (keywordFilters !== 0 /* None */) {
128796
128852
  var entryNames = new ts.Set(entries.map(function (e) { return e.name; }));
@@ -128896,7 +128952,7 @@ var ts;
128896
128952
  function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
128897
128953
  return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
128898
128954
  }
128899
- function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importCompletionNode, useSemicolons, options, preferences, completionKind) {
128955
+ function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importCompletionNode, useSemicolons, options, preferences, completionKind, formatContext) {
128900
128956
  var _a, _b;
128901
128957
  var insertText;
128902
128958
  var replacementSpan = ts.getReplacementSpanForContextToken(replacementToken);
@@ -128961,7 +129017,7 @@ var ts;
128961
129017
  completionKind === 3 /* MemberLike */ &&
128962
129018
  isClassLikeMemberCompletion(symbol, location)) {
128963
129019
  var importAdder = void 0;
128964
- (_b = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken), insertText = _b.insertText, isSnippet = _b.isSnippet, importAdder = _b.importAdder);
129020
+ (_b = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext), insertText = _b.insertText, isSnippet = _b.isSnippet, importAdder = _b.importAdder);
128965
129021
  if (importAdder === null || importAdder === void 0 ? void 0 : importAdder.hasFixes()) {
128966
129022
  hasAction = true;
128967
129023
  source = CompletionSource.ClassMemberSnippet;
@@ -129060,7 +129116,7 @@ var ts;
129060
129116
  ts.isSyntaxList(location) &&
129061
129117
  ts.isClassLike(location.parent)));
129062
129118
  }
129063
- function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken) {
129119
+ function getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext) {
129064
129120
  var classLikeDeclaration = ts.findAncestor(location, ts.isClassLike);
129065
129121
  if (!classLikeDeclaration) {
129066
129122
  return { insertText: name };
@@ -129077,15 +129133,16 @@ var ts;
129077
129133
  newLine: ts.getNewLineKind(ts.getNewLineCharacter(options, ts.maybeBind(host, host.getNewLine))),
129078
129134
  });
129079
129135
  var importAdder = ts.codefix.createImportAdder(sourceFile, program, preferences, host);
129136
+ // Create empty body for possible method implementation.
129080
129137
  var body;
129081
129138
  if (preferences.includeCompletionsWithSnippetText) {
129082
129139
  isSnippet = true;
129083
129140
  // We are adding a tabstop (i.e. `$0`) in the body of the suggested member,
129084
129141
  // if it has one, so that the cursor ends up in the body once the completion is inserted.
129085
129142
  // Note: this assumes we won't have more than one body in the completion nodes, which should be the case.
129086
- var emptyStatement = ts.factory.createExpressionStatement(ts.factory.createIdentifier(""));
129087
- ts.setSnippetElement(emptyStatement, { kind: 0 /* TabStop */, order: 0 });
129088
- body = ts.factory.createBlock([emptyStatement], /* multiline */ true);
129143
+ var emptyStmt = ts.factory.createEmptyStatement();
129144
+ body = ts.factory.createBlock([emptyStmt], /* multiline */ true);
129145
+ ts.setSnippetElement(emptyStmt, { kind: 0 /* TabStop */, order: 0 });
129089
129146
  }
129090
129147
  else {
129091
129148
  body = ts.factory.createBlock([], /* multiline */ true);
@@ -129131,7 +129188,27 @@ var ts;
129131
129188
  completionNodes.push(node);
129132
129189
  }, body, 2 /* Property */, isAbstract);
129133
129190
  if (completionNodes.length) {
129134
- insertText = printer.printSnippetList(1 /* MultiLine */ | 131072 /* NoTrailingNewLine */, ts.factory.createNodeArray(completionNodes), sourceFile);
129191
+ // If we have access to formatting settings, we print the nodes using the emitter,
129192
+ // and then format the printed text.
129193
+ if (formatContext) {
129194
+ var syntheticFile_1 = {
129195
+ text: printer.printSnippetList(1 /* MultiLine */ | 131072 /* NoTrailingNewLine */, ts.factory.createNodeArray(completionNodes), sourceFile),
129196
+ getLineAndCharacterOfPosition: function (pos) {
129197
+ return ts.getLineAndCharacterOfPosition(this, pos);
129198
+ },
129199
+ };
129200
+ var formatOptions_1 = ts.getFormatCodeSettingsForWriting(formatContext, sourceFile);
129201
+ var changes = ts.flatMap(completionNodes, function (node) {
129202
+ var nodeWithPos = ts.textChanges.assignPositionsToNode(node);
129203
+ return ts.formatting.formatNodeGivenIndentation(nodeWithPos, syntheticFile_1, sourceFile.languageVariant,
129204
+ /* indentation */ 0,
129205
+ /* delta */ 0, __assign(__assign({}, formatContext), { options: formatOptions_1 }));
129206
+ });
129207
+ insertText = ts.textChanges.applyChanges(syntheticFile_1.text, changes);
129208
+ }
129209
+ else { // Otherwise, just use emitter to print the new nodes.
129210
+ insertText = printer.printSnippetList(1 /* MultiLine */ | 131072 /* NoTrailingNewLine */, ts.factory.createNodeArray(completionNodes), sourceFile);
129211
+ }
129135
129212
  }
129136
129213
  return { insertText: insertText, isSnippet: isSnippet, importAdder: importAdder };
129137
129214
  }
@@ -129175,8 +129252,8 @@ var ts;
129175
129252
  return undefined;
129176
129253
  }
129177
129254
  function createSnippetPrinter(printerOptions) {
129178
- var printer = ts.createPrinter(printerOptions);
129179
- var baseWriter = ts.createTextWriter(ts.getNewLineCharacter(printerOptions));
129255
+ var baseWriter = ts.textChanges.createWriter(ts.getNewLineCharacter(printerOptions));
129256
+ var printer = ts.createPrinter(printerOptions, baseWriter);
129180
129257
  var writer = __assign(__assign({}, baseWriter), { write: function (s) { return baseWriter.write(ts.escapeSnippetText(s)); }, nonEscapingWrite: baseWriter.write, writeLiteral: function (s) { return baseWriter.writeLiteral(ts.escapeSnippetText(s)); }, writeStringLiteral: function (s) { return baseWriter.writeStringLiteral(ts.escapeSnippetText(s)); }, writeSymbol: function (s, symbol) { return baseWriter.writeSymbol(ts.escapeSnippetText(s), symbol); }, writeParameter: function (s) { return baseWriter.writeParameter(ts.escapeSnippetText(s)); }, writeComment: function (s) { return baseWriter.writeComment(ts.escapeSnippetText(s)); }, writeProperty: function (s) { return baseWriter.writeProperty(ts.escapeSnippetText(s)); } });
129181
129258
  return {
129182
129259
  printSnippetList: printSnippetList,
@@ -129281,7 +129358,7 @@ var ts;
129281
129358
  return CompletionSource.ThisProperty;
129282
129359
  }
129283
129360
  }
129284
- function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, sourceFile, host, program, target, log, kind, preferences, compilerOptions, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importCompletionNode, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextIdMap) {
129361
+ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importCompletionNode, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextIdMap) {
129285
129362
  var _a;
129286
129363
  var start = ts.timestamp();
129287
129364
  var variableDeclaration = getVariableDeclaration(location);
@@ -129302,7 +129379,7 @@ var ts;
129302
129379
  var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess;
129303
129380
  var sortTextId = (_a = symbolToSortTextIdMap === null || symbolToSortTextIdMap === void 0 ? void 0 : symbolToSortTextIdMap[ts.getSymbolId(symbol)]) !== null && _a !== void 0 ? _a : 11 /* LocationPriority */;
129304
129381
  var sortText = (isDeprecated(symbol, typeChecker) ? 8 /* DeprecatedOffset */ + sortTextId : sortTextId).toString();
129305
- var entry = createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importCompletionNode, useSemicolons, compilerOptions, preferences, kind);
129382
+ var entry = createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importCompletionNode, useSemicolons, compilerOptions, preferences, kind, formatContext);
129306
129383
  if (!entry) {
129307
129384
  continue;
129308
129385
  }
@@ -129498,7 +129575,7 @@ var ts;
129498
129575
  }
129499
129576
  }
129500
129577
  if (source === CompletionSource.ClassMemberSnippet) {
129501
- var importAdder = getEntryForMemberCompletion(host, program, compilerOptions, preferences, name, symbol, location, contextToken).importAdder;
129578
+ var importAdder = getEntryForMemberCompletion(host, program, compilerOptions, preferences, name, symbol, location, contextToken, formatContext).importAdder;
129502
129579
  if (importAdder) {
129503
129580
  var changes = ts.textChanges.ChangeTracker.with({ host: host, formatContext: formatContext, preferences: preferences }, importAdder.writeFixes);
129504
129581
  return {
@@ -145382,19 +145459,13 @@ var ts;
145382
145459
  + ((!options.suffix || ts.endsWith(noIndent, options.suffix))
145383
145460
  ? "" : options.suffix);
145384
145461
  }
145385
- function getFormatCodeSettingsForWriting(_a, sourceFile) {
145386
- var options = _a.options;
145387
- var shouldAutoDetectSemicolonPreference = !options.semicolons || options.semicolons === ts.SemicolonPreference.Ignore;
145388
- var shouldRemoveSemicolons = options.semicolons === ts.SemicolonPreference.Remove || shouldAutoDetectSemicolonPreference && !ts.probablyUsesSemicolons(sourceFile);
145389
- return __assign(__assign({}, options), { semicolons: shouldRemoveSemicolons ? ts.SemicolonPreference.Remove : ts.SemicolonPreference.Ignore });
145390
- }
145391
145462
  /** Note: this may mutate `nodeIn`. */
145392
145463
  function getFormattedTextOfNode(nodeIn, sourceFile, pos, _a, newLineCharacter, formatContext, validate) {
145393
145464
  var indentation = _a.indentation, prefix = _a.prefix, delta = _a.delta;
145394
145465
  var _b = getNonformattedText(nodeIn, sourceFile, newLineCharacter), node = _b.node, text = _b.text;
145395
145466
  if (validate)
145396
145467
  validate(node, text);
145397
- var formatOptions = getFormatCodeSettingsForWriting(formatContext, sourceFile);
145468
+ var formatOptions = ts.getFormatCodeSettingsForWriting(formatContext, sourceFile);
145398
145469
  var initialIndentation = indentation !== undefined
145399
145470
  ? indentation
145400
145471
  : ts.formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, prefix === newLineCharacter || ts.getLineStartPositionForPosition(pos, sourceFile) === pos);
@@ -145442,6 +145513,7 @@ var ts;
145442
145513
  ts.setTextRangePosEnd(newNode, getPos(node), getEnd(node));
145443
145514
  return newNode;
145444
145515
  }
145516
+ textChanges_3.assignPositionsToNode = assignPositionsToNode;
145445
145517
  function assignPositionsToNodeArray(nodes, visitor, test, start, count) {
145446
145518
  var visited = ts.visitNodes(nodes, visitor, test, start, count);
145447
145519
  if (!visited) {
@@ -145612,6 +145684,7 @@ var ts;
145612
145684
  clear: clear
145613
145685
  };
145614
145686
  }
145687
+ textChanges_3.createWriter = createWriter;
145615
145688
  function getInsertionPositionAtSourceFileTop(sourceFile) {
145616
145689
  var lastPrologue;
145617
145690
  for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
@@ -160509,12 +160582,12 @@ var ts;
160509
160582
  synchronizeHostData();
160510
160583
  return __spreadArray(__spreadArray([], program.getOptionsDiagnostics(cancellationToken), true), program.getGlobalDiagnostics(cancellationToken), true);
160511
160584
  }
160512
- function getCompletionsAtPosition(fileName, position, options) {
160585
+ function getCompletionsAtPosition(fileName, position, options, formattingSettings) {
160513
160586
  if (options === void 0) { options = ts.emptyOptions; }
160514
160587
  // Convert from deprecated options names to new names
160515
160588
  var fullPreferences = __assign(__assign({}, ts.identity(options)), { includeCompletionsForModuleExports: options.includeCompletionsForModuleExports || options.includeExternalModuleExports, includeCompletionsWithInsertText: options.includeCompletionsWithInsertText || options.includeInsertTextCompletions });
160516
160589
  synchronizeHostData();
160517
- return ts.Completions.getCompletionsAtPosition(host, program, log, getValidSourceFile(fileName), position, fullPreferences, options.triggerCharacter, options.triggerKind, cancellationToken);
160590
+ return ts.Completions.getCompletionsAtPosition(host, program, log, getValidSourceFile(fileName), position, fullPreferences, options.triggerCharacter, options.triggerKind, cancellationToken, formattingSettings && ts.formatting.getFormatContext(formattingSettings, host));
160518
160591
  }
160519
160592
  function getCompletionEntryDetails(fileName, position, name, formattingOptions, source, preferences, data) {
160520
160593
  if (preferences === void 0) { preferences = ts.emptyOptions; }
@@ -162677,9 +162750,9 @@ var ts;
162677
162750
  * to provide at the given source position and providing a member completion
162678
162751
  * list if requested.
162679
162752
  */
162680
- LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences) {
162753
+ LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences, formattingSettings) {
162681
162754
  var _this = this;
162682
- return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + preferences + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences); });
162755
+ return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + preferences + ", " + formattingSettings + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings); });
162683
162756
  };
162684
162757
  /** Get a string based representation of a completion list entry details */
162685
162758
  LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, formatOptions, source, preferences, data) {
@@ -171233,6 +171306,9 @@ var ts;
171233
171306
  }
171234
171307
  return;
171235
171308
  }
171309
+ this.writeMessage(msg);
171310
+ };
171311
+ Session.prototype.writeMessage = function (msg) {
171236
171312
  var msgText = formatMessage(msg, this.logger, this.byteLength, this.host.newLine);
171237
171313
  ts.perfLogger.logEvent("Response message size: " + msgText.length);
171238
171314
  this.host.write(msgText);
@@ -171984,7 +172060,7 @@ var ts;
171984
172060
  var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
171985
172061
  var scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file);
171986
172062
  var position = this.getPosition(args, scriptInfo);
171987
- var completions = project.getLanguageService().getCompletionsAtPosition(file, position, __assign(__assign({}, server.convertUserPreferences(this.getPreferences(file))), { triggerCharacter: args.triggerCharacter, triggerKind: args.triggerKind, includeExternalModuleExports: args.includeExternalModuleExports, includeInsertTextCompletions: args.includeInsertTextCompletions }));
172063
+ var completions = project.getLanguageService().getCompletionsAtPosition(file, position, __assign(__assign({}, server.convertUserPreferences(this.getPreferences(file))), { triggerCharacter: args.triggerCharacter, triggerKind: args.triggerKind, includeExternalModuleExports: args.includeExternalModuleExports, includeInsertTextCompletions: args.includeInsertTextCompletions }), project.projectService.getFormatCodeOptions(file));
171988
172064
  if (completions === undefined)
171989
172065
  return undefined;
171990
172066
  if (kind === "completions-full" /* CompletionsFull */)
@@ -175272,12 +175348,40 @@ var ts;
175272
175348
  };
175273
175349
  return IOSession;
175274
175350
  }(server.Session));
175351
+ var IpcIOSession = /** @class */ (function (_super) {
175352
+ __extends(IpcIOSession, _super);
175353
+ function IpcIOSession() {
175354
+ return _super !== null && _super.apply(this, arguments) || this;
175355
+ }
175356
+ IpcIOSession.prototype.writeMessage = function (msg) {
175357
+ var verboseLogging = logger.hasLevel(server.LogLevel.verbose);
175358
+ if (verboseLogging) {
175359
+ var json = JSON.stringify(msg);
175360
+ logger.info(msg.type + ":" + server.indent(json));
175361
+ }
175362
+ process.send(msg);
175363
+ };
175364
+ IpcIOSession.prototype.parseMessage = function (message) {
175365
+ return message;
175366
+ };
175367
+ IpcIOSession.prototype.toStringMessage = function (message) {
175368
+ return JSON.stringify(message, undefined, 2);
175369
+ };
175370
+ IpcIOSession.prototype.listen = function () {
175371
+ var _this = this;
175372
+ process.on("message", function (e) {
175373
+ _this.onMessage(e);
175374
+ });
175375
+ };
175376
+ return IpcIOSession;
175377
+ }(IOSession));
175275
175378
  var eventPort = parseEventPort(server.findArgument("--eventPort"));
175276
175379
  var typingSafeListLocation = server.findArgument(server.Arguments.TypingSafeListLocation); // TODO: GH#18217
175277
175380
  var typesMapLocation = server.findArgument(server.Arguments.TypesMapLocation) || ts.combinePaths(ts.getDirectoryPath(ts.sys.getExecutingFilePath()), "typesMap.json");
175278
175381
  var npmLocation = server.findArgument(server.Arguments.NpmLocation);
175279
175382
  var validateDefaultNpmLocation = server.hasArgument(server.Arguments.ValidateDefaultNpmLocation);
175280
175383
  var disableAutomaticTypingAcquisition = server.hasArgument("--disableAutomaticTypingAcquisition");
175384
+ var useNodeIpc = server.hasArgument("--useNodeIpc");
175281
175385
  var telemetryEnabled = server.hasArgument(server.Arguments.EnableTelemetry);
175282
175386
  var commandLineTraceDir = server.findArgument("--traceDirectory");
175283
175387
  var traceDir = commandLineTraceDir
@@ -175286,7 +175390,7 @@ var ts;
175286
175390
  if (traceDir) {
175287
175391
  ts.startTracing("server", traceDir);
175288
175392
  }
175289
- var ioSession = new IOSession();
175393
+ var ioSession = useNodeIpc ? new IpcIOSession() : new IOSession();
175290
175394
  process.on("uncaughtException", function (err) {
175291
175395
  ioSession.logError(err, "unknown");
175292
175396
  });
@@ -3344,7 +3344,7 @@ declare namespace ts {
3344
3344
  createTrue(): TrueLiteral;
3345
3345
  createFalse(): FalseLiteral;
3346
3346
  createModifier<T extends ModifierSyntaxKind>(kind: T): ModifierToken<T>;
3347
- createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[];
3347
+ createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[] | undefined;
3348
3348
  createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName;
3349
3349
  updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName;
3350
3350
  createComputedPropertyName(expression: Expression): ComputedPropertyName;
@@ -5760,8 +5760,9 @@ declare namespace ts {
5760
5760
  * @param position A zero-based index of the character where you want the entries
5761
5761
  * @param options An object describing how the request was triggered and what kinds
5762
5762
  * of code actions can be returned with the completions.
5763
+ * @param formattingSettings settings needed for calling formatting functions.
5763
5764
  */
5764
- getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): WithMetadata<CompletionInfo> | undefined;
5765
+ getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined, formattingSettings?: FormatCodeSettings): WithMetadata<CompletionInfo> | undefined;
5765
5766
  /**
5766
5767
  * Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`.
5767
5768
  *
@@ -10486,6 +10487,7 @@ declare namespace ts.server {
10486
10487
  logError(err: Error, cmd: string): void;
10487
10488
  private logErrorWorker;
10488
10489
  send(msg: protocol.Message): void;
10490
+ protected writeMessage(msg: protocol.Message): void;
10489
10491
  event<T extends object>(body: T, eventName: string): void;
10490
10492
  /** @deprecated */
10491
10493
  output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void;
@@ -10671,7 +10673,7 @@ declare namespace ts {
10671
10673
  /** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */
10672
10674
  const createModifier: <T extends ModifierSyntaxKind>(kind: T) => ModifierToken<T>;
10673
10675
  /** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */
10674
- const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[];
10676
+ const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[] | undefined;
10675
10677
  /** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */
10676
10678
  const createQualifiedName: (left: EntityName, right: string | Identifier) => QualifiedName;
10677
10679
  /** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */