Skip to content

Commit d76f361

Browse files
authored
More removals of long deprecated APIs (microsoft#52343)
1 parent 1d81c1d commit d76f361

File tree

6 files changed

+8
-54
lines changed

6 files changed

+8
-54
lines changed

src/compiler/types.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,12 +1597,6 @@ export type AssertKeyword = KeywordToken<SyntaxKind.AssertKeyword>;
15971597
export type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>;
15981598
export type CaseKeyword = KeywordToken<SyntaxKind.CaseKeyword>;
15991599

1600-
/** @deprecated Use `AwaitKeyword` instead. */
1601-
export type AwaitKeywordToken = AwaitKeyword;
1602-
1603-
/** @deprecated Use `AssertsKeyword` instead. */
1604-
export type AssertsToken = AssertsKeyword;
1605-
16061600
export interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> {
16071601
}
16081602

@@ -1622,9 +1616,6 @@ export type OutKeyword = ModifierToken<SyntaxKind.OutKeyword>;
16221616
export type OverrideKeyword = ModifierToken<SyntaxKind.OverrideKeyword>;
16231617
export type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>;
16241618

1625-
/** @deprecated Use `ReadonlyKeyword` instead. */
1626-
export type ReadonlyToken = ReadonlyKeyword;
1627-
16281619
export type Modifier =
16291620
| AbstractKeyword
16301621
| AccessorKeyword
@@ -5278,8 +5269,6 @@ export const enum NodeBuilderFlags {
52785269
// Error handling
52795270
AllowThisInObjectLiteral = 1 << 15,
52805271
AllowQualifiedNameInPlaceOfIdentifier = 1 << 16,
5281-
/** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
5282-
AllowQualifedNameInPlaceOfIdentifier = AllowQualifiedNameInPlaceOfIdentifier,
52835272
AllowAnonymousIdentifier = 1 << 17,
52845273
AllowEmptyUnionOrIntersection = 1 << 18,
52855274
AllowEmptyTuple = 1 << 19,
@@ -5335,8 +5324,6 @@ export const enum TypeFormatFlags {
53355324
InFirstTypeArgument = 1 << 22, // Writing first type argument of the instantiated type
53365325
InTypeAlias = 1 << 23, // Writing type in type alias declaration
53375326

5338-
/** @deprecated */ WriteOwnNameForAnyLike = 0, // Does nothing
5339-
53405327
NodeBuilderFlagsMask = NoTruncation | WriteArrayAsGenericType | UseStructuralFallback | WriteTypeArgumentsOfSignature |
53415328
UseFullyQualifiedType | SuppressAnyReturnType | MultilineObjectLiterals | WriteClassExpressionAsTypeLiteral |
53425329
UseTypeOfFunction | OmitParameterModifiers | UseAliasDefinedOutsideCurrentScope | AllowUniqueESSymbolType | InTypeAlias |
@@ -6825,9 +6812,6 @@ export const enum AssignmentDeclarationKind {
68256812
ObjectDefinePrototypeProperty,
68266813
}
68276814

6828-
/** @deprecated Use FileExtensionInfo instead. */
6829-
export type JsFileExtensionInfo = FileExtensionInfo;
6830-
68316815
export interface FileExtensionInfo {
68326816
extension: string;
68336817
isMixedContent: boolean;

src/server/session.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,13 +1180,8 @@ export class Session<TMessage = string> implements EventSender {
11801180
this.send(toEvent(eventName, body));
11811181
}
11821182

1183-
// For backwards-compatibility only.
1184-
/** @deprecated */
1185-
public output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void {
1186-
this.doOutput(info, cmdName, reqSeq!, /*success*/ !errorMsg, errorMsg); // TODO: GH#18217
1187-
}
1188-
1189-
private doOutput(info: {} | undefined, cmdName: string, reqSeq: number, success: boolean, message?: string): void {
1183+
/** @internal */
1184+
doOutput(info: {} | undefined, cmdName: string, reqSeq: number, success: boolean, message?: string): void {
11901185
const res: protocol.Response = {
11911186
seq: 0,
11921187
type: "response",

src/services/codefixes/removeUnnecessaryAwait.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
AwaitKeywordToken,
2+
AwaitKeyword,
33
Diagnostics,
44
findPrecedingToken,
55
getLeftmostExpression,
@@ -40,7 +40,7 @@ registerCodeFix({
4040
});
4141

4242
function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, span: TextSpan) {
43-
const awaitKeyword = tryCast(getTokenAtPosition(sourceFile, span.start), (node): node is AwaitKeywordToken => node.kind === SyntaxKind.AwaitKeyword);
43+
const awaitKeyword = tryCast(getTokenAtPosition(sourceFile, span.start), (node): node is AwaitKeyword => node.kind === SyntaxKind.AwaitKeyword);
4444
const awaitExpression = awaitKeyword && tryCast(awaitKeyword.parent, isAwaitExpression);
4545
if (!awaitExpression) {
4646
return;

src/testRunner/unittests/tsserver/session.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ describe("unittests:: tsserver:: Session:: General functionality", () => {
334334
};
335335
const command = "test";
336336

337-
session.output(body, command, /*reqSeq*/ 0);
337+
session.doOutput(body, command, /*reqSeq*/ 0, /*success*/ true);
338338

339339
expect(lastSent).to.deep.equal({
340340
seq: 0,
@@ -454,7 +454,7 @@ describe("unittests:: tsserver:: Session:: how Session is extendable via subclas
454454
};
455455
const command = "test";
456456

457-
session.output(body, command, /*reqSeq*/ 0);
457+
session.doOutput(body, command, /*reqSeq*/ 0, /*success*/ true);
458458

459459
expect(session.lastSent).to.deep.equal({
460460
seq: 0,
@@ -524,11 +524,11 @@ describe("unittests:: tsserver:: Session:: an example of using the Session API t
524524
response = this.executeCommand(msg).response as ts.server.protocol.Response;
525525
}
526526
catch (e) {
527-
this.output(undefined, msg.command, msg.seq, e.toString());
527+
this.doOutput(/*info*/ undefined, msg.command, msg.seq, /*success*/ false, e.toString());
528528
return;
529529
}
530530
if (response) {
531-
this.output(response, msg.command, msg.seq);
531+
this.doOutput(response, msg.command, msg.seq, /*success*/ true);
532532
}
533533
}
534534

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3846,9 +3846,6 @@ declare namespace ts {
38463846
send(msg: protocol.Message): void;
38473847
protected writeMessage(msg: protocol.Message): void;
38483848
event<T extends object>(body: T, eventName: string): void;
3849-
/** @deprecated */
3850-
output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void;
3851-
private doOutput;
38523849
private semanticCheck;
38533850
private syntacticCheck;
38543851
private suggestionCheck;
@@ -4568,10 +4565,6 @@ declare namespace ts {
45684565
type AssertKeyword = KeywordToken<SyntaxKind.AssertKeyword>;
45694566
type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>;
45704567
type CaseKeyword = KeywordToken<SyntaxKind.CaseKeyword>;
4571-
/** @deprecated Use `AwaitKeyword` instead. */
4572-
type AwaitKeywordToken = AwaitKeyword;
4573-
/** @deprecated Use `AssertsKeyword` instead. */
4574-
type AssertsToken = AssertsKeyword;
45754568
interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> {
45764569
}
45774570
type AbstractKeyword = ModifierToken<SyntaxKind.AbstractKeyword>;
@@ -4589,8 +4582,6 @@ declare namespace ts {
45894582
type OutKeyword = ModifierToken<SyntaxKind.OutKeyword>;
45904583
type OverrideKeyword = ModifierToken<SyntaxKind.OverrideKeyword>;
45914584
type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>;
4592-
/** @deprecated Use `ReadonlyKeyword` instead. */
4593-
type ReadonlyToken = ReadonlyKeyword;
45944585
type Modifier = AbstractKeyword | AccessorKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | InKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | OutKeyword | OverrideKeyword | ReadonlyKeyword | StaticKeyword;
45954586
type ModifierLike = Modifier | Decorator;
45964587
type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword;
@@ -6434,8 +6425,6 @@ declare namespace ts {
64346425
OmitThisParameter = 33554432,
64356426
AllowThisInObjectLiteral = 32768,
64366427
AllowQualifiedNameInPlaceOfIdentifier = 65536,
6437-
/** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
6438-
AllowQualifedNameInPlaceOfIdentifier = 65536,
64396428
AllowAnonymousIdentifier = 131072,
64406429
AllowEmptyUnionOrIntersection = 262144,
64416430
AllowEmptyTuple = 524288,
@@ -6470,7 +6459,6 @@ declare namespace ts {
64706459
InElementType = 2097152,
64716460
InFirstTypeArgument = 4194304,
64726461
InTypeAlias = 8388608,
6473-
/** @deprecated */ WriteOwnNameForAnyLike = 0,
64746462
NodeBuilderFlagsMask = 848330091
64756463
}
64766464
enum SymbolFormatFlags {
@@ -6926,8 +6914,6 @@ declare namespace ts {
69266914
PriorityImpliesCombination = 416,
69276915
Circularity = -1
69286916
}
6929-
/** @deprecated Use FileExtensionInfo instead. */
6930-
type JsFileExtensionInfo = FileExtensionInfo;
69316917
interface FileExtensionInfo {
69326918
extension: string;
69336919
isMixedContent: boolean;

tests/baselines/reference/api/typescript.d.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -586,10 +586,6 @@ declare namespace ts {
586586
type AssertKeyword = KeywordToken<SyntaxKind.AssertKeyword>;
587587
type AwaitKeyword = KeywordToken<SyntaxKind.AwaitKeyword>;
588588
type CaseKeyword = KeywordToken<SyntaxKind.CaseKeyword>;
589-
/** @deprecated Use `AwaitKeyword` instead. */
590-
type AwaitKeywordToken = AwaitKeyword;
591-
/** @deprecated Use `AssertsKeyword` instead. */
592-
type AssertsToken = AssertsKeyword;
593589
interface ModifierToken<TKind extends ModifierSyntaxKind> extends KeywordToken<TKind> {
594590
}
595591
type AbstractKeyword = ModifierToken<SyntaxKind.AbstractKeyword>;
@@ -607,8 +603,6 @@ declare namespace ts {
607603
type OutKeyword = ModifierToken<SyntaxKind.OutKeyword>;
608604
type OverrideKeyword = ModifierToken<SyntaxKind.OverrideKeyword>;
609605
type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>;
610-
/** @deprecated Use `ReadonlyKeyword` instead. */
611-
type ReadonlyToken = ReadonlyKeyword;
612606
type Modifier = AbstractKeyword | AccessorKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | InKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | OutKeyword | OverrideKeyword | ReadonlyKeyword | StaticKeyword;
613607
type ModifierLike = Modifier | Decorator;
614608
type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword;
@@ -2452,8 +2446,6 @@ declare namespace ts {
24522446
OmitThisParameter = 33554432,
24532447
AllowThisInObjectLiteral = 32768,
24542448
AllowQualifiedNameInPlaceOfIdentifier = 65536,
2455-
/** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
2456-
AllowQualifedNameInPlaceOfIdentifier = 65536,
24572449
AllowAnonymousIdentifier = 131072,
24582450
AllowEmptyUnionOrIntersection = 262144,
24592451
AllowEmptyTuple = 524288,
@@ -2488,7 +2480,6 @@ declare namespace ts {
24882480
InElementType = 2097152,
24892481
InFirstTypeArgument = 4194304,
24902482
InTypeAlias = 8388608,
2491-
/** @deprecated */ WriteOwnNameForAnyLike = 0,
24922483
NodeBuilderFlagsMask = 848330091
24932484
}
24942485
enum SymbolFormatFlags {
@@ -2944,8 +2935,6 @@ declare namespace ts {
29442935
PriorityImpliesCombination = 416,
29452936
Circularity = -1
29462937
}
2947-
/** @deprecated Use FileExtensionInfo instead. */
2948-
type JsFileExtensionInfo = FileExtensionInfo;
29492938
interface FileExtensionInfo {
29502939
extension: string;
29512940
isMixedContent: boolean;

0 commit comments

Comments
 (0)