diff --git a/extensions/typescript-language-features/src/typescriptService.ts b/extensions/typescript-language-features/src/typescriptService.ts index cd2d50e93ea..3b5a139cd0a 100644 --- a/extensions/typescript-language-features/src/typescriptService.ts +++ b/extensions/typescript-language-features/src/typescriptService.ts @@ -21,7 +21,7 @@ export namespace ServerResponse { ) { } } - export const NoContent = new class { readonly type = 'noContent'; }; + export const NoContent = { type: 'noContent' } as const; export type Response = T | Cancelled | typeof NoContent; } diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index bb640ad80d3..3ff0d709091 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -47,7 +47,7 @@ namespace ServerState { Errored } - export const None = new class { readonly type = Type.None; }; + export const None = { type: Type.None } as const; export class Running { readonly type = Type.Running; diff --git a/src/vs/editor/contrib/codeAction/codeActionModel.ts b/src/vs/editor/contrib/codeAction/codeActionModel.ts index 54a1946ca0d..39faf3722d1 100644 --- a/src/vs/editor/contrib/codeAction/codeActionModel.ts +++ b/src/vs/editor/contrib/codeAction/codeActionModel.ts @@ -141,7 +141,7 @@ export namespace CodeActionsState { Triggered, } - export const Empty = new class { readonly type = Type.Empty; }; + export const Empty = { type: Type.Empty } as const; export class Triggered { readonly type = Type.Triggered; diff --git a/src/vs/editor/contrib/codeAction/lightBulbWidget.ts b/src/vs/editor/contrib/codeAction/lightBulbWidget.ts index 505f13244f9..0fc03b3a8ba 100644 --- a/src/vs/editor/contrib/codeAction/lightBulbWidget.ts +++ b/src/vs/editor/contrib/codeAction/lightBulbWidget.ts @@ -25,7 +25,7 @@ namespace LightBulbState { Showing, } - export const Hidden = new class { readonly type = Type.Hidden; }; + export const Hidden = { type: Type.Hidden } as const; export class Showing { readonly type = Type.Showing; diff --git a/src/vs/editor/contrib/parameterHints/parameterHintsModel.ts b/src/vs/editor/contrib/parameterHints/parameterHintsModel.ts index 7ff13c6182c..b285d1f7665 100644 --- a/src/vs/editor/contrib/parameterHints/parameterHintsModel.ts +++ b/src/vs/editor/contrib/parameterHints/parameterHintsModel.ts @@ -26,7 +26,7 @@ namespace ParameterHintState { Pending, } - export const Default = new class { readonly type = Type.Default; }; + export const Default = { type: Type.Default } as const; export class Pending { readonly type = Type.Pending; diff --git a/src/vs/workbench/services/progress/browser/progressIndicator.ts b/src/vs/workbench/services/progress/browser/progressIndicator.ts index 5d605ce2c08..ff1da4bab76 100644 --- a/src/vs/workbench/services/progress/browser/progressIndicator.ts +++ b/src/vs/workbench/services/progress/browser/progressIndicator.ts @@ -117,9 +117,9 @@ namespace ProgressIndicatorState { Work } - export const None = new class { readonly type = Type.None; }; - export const Done = new class { readonly type = Type.Done; }; - export const Infinite = new class { readonly type = Type.Infinite; }; + export const None = { type: Type.None } as const; + export const Done = { type: Type.Done } as const; + export const Infinite = { type: Type.Infinite } as const; export class While { readonly type = Type.While;