diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 3740d25779f..c500979361e 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1597,12 +1597,6 @@ export type AssertKeyword = KeywordToken; export type AwaitKeyword = KeywordToken; export type CaseKeyword = KeywordToken; -/** @deprecated Use `AwaitKeyword` instead. */ -export type AwaitKeywordToken = AwaitKeyword; - -/** @deprecated Use `AssertsKeyword` instead. */ -export type AssertsToken = AssertsKeyword; - export interface ModifierToken extends KeywordToken { } @@ -1622,9 +1616,6 @@ export type OutKeyword = ModifierToken; export type OverrideKeyword = ModifierToken; export type StaticKeyword = ModifierToken; -/** @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; diff --git a/src/server/session.ts b/src/server/session.ts index d9593568d94..762469e1f60 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1180,13 +1180,8 @@ export class Session 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", diff --git a/src/services/codefixes/removeUnnecessaryAwait.ts b/src/services/codefixes/removeUnnecessaryAwait.ts index 521c8e9dc08..45e6dcdef0d 100644 --- a/src/services/codefixes/removeUnnecessaryAwait.ts +++ b/src/services/codefixes/removeUnnecessaryAwait.ts @@ -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; diff --git a/src/testRunner/unittests/tsserver/session.ts b/src/testRunner/unittests/tsserver/session.ts index bf983da0ceb..1bdb12a0f41 100644 --- a/src/testRunner/unittests/tsserver/session.ts +++ b/src/testRunner/unittests/tsserver/session.ts @@ -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); } } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index c77d0094000..244310506d7 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -3846,9 +3846,6 @@ declare namespace ts { send(msg: protocol.Message): void; protected writeMessage(msg: protocol.Message): void; event(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; type AwaitKeyword = KeywordToken; type CaseKeyword = KeywordToken; - /** @deprecated Use `AwaitKeyword` instead. */ - type AwaitKeywordToken = AwaitKeyword; - /** @deprecated Use `AssertsKeyword` instead. */ - type AssertsToken = AssertsKeyword; interface ModifierToken extends KeywordToken { } type AbstractKeyword = ModifierToken; @@ -4589,8 +4582,6 @@ declare namespace ts { type OutKeyword = ModifierToken; type OverrideKeyword = ModifierToken; type StaticKeyword = ModifierToken; - /** @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; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index b8ab733723c..d397d606370 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -586,10 +586,6 @@ declare namespace ts { type AssertKeyword = KeywordToken; type AwaitKeyword = KeywordToken; type CaseKeyword = KeywordToken; - /** @deprecated Use `AwaitKeyword` instead. */ - type AwaitKeywordToken = AwaitKeyword; - /** @deprecated Use `AssertsKeyword` instead. */ - type AssertsToken = AssertsKeyword; interface ModifierToken extends KeywordToken { } type AbstractKeyword = ModifierToken; @@ -607,8 +603,6 @@ declare namespace ts { type OutKeyword = ModifierToken; type OverrideKeyword = ModifierToken; type StaticKeyword = ModifierToken; - /** @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;