More removals of long deprecated APIs (#52343)

This commit is contained in:
Sheetal Nandi
2023-01-20 15:25:06 -08:00
committed by GitHub
parent 1d81c1dfef
commit d76f3612c1
6 changed files with 8 additions and 54 deletions
-16
View File
@@ -1597,12 +1597,6 @@ export type AssertKeyword = KeywordToken<SyntaxKind.AssertKeyword>;
export type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>;
export type CaseKeyword = KeywordToken<SyntaxKind.CaseKeyword>;
/** @deprecated Use `AwaitKeyword` instead. */
export type AwaitKeywordToken = AwaitKeyword;
/** @deprecated Use `AssertsKeyword` instead. */
export type AssertsToken = AssertsKeyword;
export interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> {
}
@@ -1622,9 +1616,6 @@ export type OutKeyword = ModifierToken<SyntaxKind.OutKeyword>;
export type OverrideKeyword = ModifierToken<SyntaxKind.OverrideKeyword>;
export type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>;
/** @deprecated Use `ReadonlyKeyword` instead. */
export type ReadonlyToken = ReadonlyKeyword;
export type Modifier =
| AbstractKeyword
| AccessorKeyword
@@ -5278,8 +5269,6 @@ export const enum NodeBuilderFlags {
// Error handling
AllowThisInObjectLiteral = 1 << 15,
AllowQualifiedNameInPlaceOfIdentifier = 1 << 16,
/** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
AllowQualifedNameInPlaceOfIdentifier = AllowQualifiedNameInPlaceOfIdentifier,
AllowAnonymousIdentifier = 1 << 17,
AllowEmptyUnionOrIntersection = 1 << 18,
AllowEmptyTuple = 1 << 19,
@@ -5335,8 +5324,6 @@ export const enum TypeFormatFlags {
InFirstTypeArgument = 1 << 22, // Writing first type argument of the instantiated type
InTypeAlias = 1 << 23, // Writing type in type alias declaration
/** @deprecated */ WriteOwnNameForAnyLike = 0, // Does nothing
NodeBuilderFlagsMask = NoTruncation | WriteArrayAsGenericType | UseStructuralFallback | WriteTypeArgumentsOfSignature |
UseFullyQualifiedType | SuppressAnyReturnType | MultilineObjectLiterals | WriteClassExpressionAsTypeLiteral |
UseTypeOfFunction | OmitParameterModifiers | UseAliasDefinedOutsideCurrentScope | AllowUniqueESSymbolType | InTypeAlias |
@@ -6825,9 +6812,6 @@ export const enum AssignmentDeclarationKind {
ObjectDefinePrototypeProperty,
}
/** @deprecated Use FileExtensionInfo instead. */
export type JsFileExtensionInfo = FileExtensionInfo;
export interface FileExtensionInfo {
extension: string;
isMixedContent: boolean;
+2 -7
View File
@@ -1180,13 +1180,8 @@ export class Session<TMessage = string> implements EventSender {
this.send(toEvent(eventName, body));
}
// For backwards-compatibility only.
/** @deprecated */
public output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void {
this.doOutput(info, cmdName, reqSeq!, /*success*/ !errorMsg, errorMsg); // TODO: GH#18217
}
private doOutput(info: {} | undefined, cmdName: string, reqSeq: number, success: boolean, message?: string): void {
/** @internal */
doOutput(info: {} | undefined, cmdName: string, reqSeq: number, success: boolean, message?: string): void {
const res: protocol.Response = {
seq: 0,
type: "response",
@@ -1,5 +1,5 @@
import {
AwaitKeywordToken,
AwaitKeyword,
Diagnostics,
findPrecedingToken,
getLeftmostExpression,
@@ -40,7 +40,7 @@ registerCodeFix({
});
function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, span: TextSpan) {
const awaitKeyword = tryCast(getTokenAtPosition(sourceFile, span.start), (node): node is AwaitKeywordToken => node.kind === SyntaxKind.AwaitKeyword);
const awaitKeyword = tryCast(getTokenAtPosition(sourceFile, span.start), (node): node is AwaitKeyword => node.kind === SyntaxKind.AwaitKeyword);
const awaitExpression = awaitKeyword && tryCast(awaitKeyword.parent, isAwaitExpression);
if (!awaitExpression) {
return;
+4 -4
View File
@@ -334,7 +334,7 @@ describe("unittests:: tsserver:: Session:: General functionality", () => {
};
const command = "test";
session.output(body, command, /*reqSeq*/ 0);
session.doOutput(body, command, /*reqSeq*/ 0, /*success*/ true);
expect(lastSent).to.deep.equal({
seq: 0,
@@ -454,7 +454,7 @@ describe("unittests:: tsserver:: Session:: how Session is extendable via subclas
};
const command = "test";
session.output(body, command, /*reqSeq*/ 0);
session.doOutput(body, command, /*reqSeq*/ 0, /*success*/ true);
expect(session.lastSent).to.deep.equal({
seq: 0,
@@ -524,11 +524,11 @@ describe("unittests:: tsserver:: Session:: an example of using the Session API t
response = this.executeCommand(msg).response as ts.server.protocol.Response;
}
catch (e) {
this.output(undefined, msg.command, msg.seq, e.toString());
this.doOutput(/*info*/ undefined, msg.command, msg.seq, /*success*/ false, e.toString());
return;
}
if (response) {
this.output(response, msg.command, msg.seq);
this.doOutput(response, msg.command, msg.seq, /*success*/ true);
}
}
-14
View File
@@ -3846,9 +3846,6 @@ declare namespace ts {
send(msg: protocol.Message): void;
protected writeMessage(msg: protocol.Message): void;
event<T extends object>(body: T, eventName: string): void;
/** @deprecated */
output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void;
private doOutput;
private semanticCheck;
private syntacticCheck;
private suggestionCheck;
@@ -4568,10 +4565,6 @@ declare namespace ts {
type AssertKeyword = KeywordToken<SyntaxKind.AssertKeyword>;
type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>;
type CaseKeyword = KeywordToken<SyntaxKind.CaseKeyword>;
/** @deprecated Use `AwaitKeyword` instead. */
type AwaitKeywordToken = AwaitKeyword;
/** @deprecated Use `AssertsKeyword` instead. */
type AssertsToken = AssertsKeyword;
interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> {
}
type AbstractKeyword = ModifierToken<SyntaxKind.AbstractKeyword>;
@@ -4589,8 +4582,6 @@ declare namespace ts {
type OutKeyword = ModifierToken<SyntaxKind.OutKeyword>;
type OverrideKeyword = ModifierToken<SyntaxKind.OverrideKeyword>;
type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>;
/** @deprecated Use `ReadonlyKeyword` instead. */
type ReadonlyToken = ReadonlyKeyword;
type Modifier = AbstractKeyword | AccessorKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | InKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | OutKeyword | OverrideKeyword | ReadonlyKeyword | StaticKeyword;
type ModifierLike = Modifier | Decorator;
type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword;
@@ -6434,8 +6425,6 @@ declare namespace ts {
OmitThisParameter = 33554432,
AllowThisInObjectLiteral = 32768,
AllowQualifiedNameInPlaceOfIdentifier = 65536,
/** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
AllowQualifedNameInPlaceOfIdentifier = 65536,
AllowAnonymousIdentifier = 131072,
AllowEmptyUnionOrIntersection = 262144,
AllowEmptyTuple = 524288,
@@ -6470,7 +6459,6 @@ declare namespace ts {
InElementType = 2097152,
InFirstTypeArgument = 4194304,
InTypeAlias = 8388608,
/** @deprecated */ WriteOwnNameForAnyLike = 0,
NodeBuilderFlagsMask = 848330091
}
enum SymbolFormatFlags {
@@ -6926,8 +6914,6 @@ declare namespace ts {
PriorityImpliesCombination = 416,
Circularity = -1
}
/** @deprecated Use FileExtensionInfo instead. */
type JsFileExtensionInfo = FileExtensionInfo;
interface FileExtensionInfo {
extension: string;
isMixedContent: boolean;
-11
View File
@@ -586,10 +586,6 @@ declare namespace ts {
type AssertKeyword = KeywordToken<SyntaxKind.AssertKeyword>;
type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>;
type CaseKeyword = KeywordToken<SyntaxKind.CaseKeyword>;
/** @deprecated Use `AwaitKeyword` instead. */
type AwaitKeywordToken = AwaitKeyword;
/** @deprecated Use `AssertsKeyword` instead. */
type AssertsToken = AssertsKeyword;
interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> {
}
type AbstractKeyword = ModifierToken<SyntaxKind.AbstractKeyword>;
@@ -607,8 +603,6 @@ declare namespace ts {
type OutKeyword = ModifierToken<SyntaxKind.OutKeyword>;
type OverrideKeyword = ModifierToken<SyntaxKind.OverrideKeyword>;
type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>;
/** @deprecated Use `ReadonlyKeyword` instead. */
type ReadonlyToken = ReadonlyKeyword;
type Modifier = AbstractKeyword | AccessorKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | InKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | OutKeyword | OverrideKeyword | ReadonlyKeyword | StaticKeyword;
type ModifierLike = Modifier | Decorator;
type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword;
@@ -2452,8 +2446,6 @@ declare namespace ts {
OmitThisParameter = 33554432,
AllowThisInObjectLiteral = 32768,
AllowQualifiedNameInPlaceOfIdentifier = 65536,
/** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
AllowQualifedNameInPlaceOfIdentifier = 65536,
AllowAnonymousIdentifier = 131072,
AllowEmptyUnionOrIntersection = 262144,
AllowEmptyTuple = 524288,
@@ -2488,7 +2480,6 @@ declare namespace ts {
InElementType = 2097152,
InFirstTypeArgument = 4194304,
InTypeAlias = 8388608,
/** @deprecated */ WriteOwnNameForAnyLike = 0,
NodeBuilderFlagsMask = 848330091
}
enum SymbolFormatFlags {
@@ -2944,8 +2935,6 @@ declare namespace ts {
PriorityImpliesCombination = 416,
Circularity = -1
}
/** @deprecated Use FileExtensionInfo instead. */
type JsFileExtensionInfo = FileExtensionInfo;
interface FileExtensionInfo {
extension: string;
isMixedContent: boolean;