mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
Make NoContentResponse an constant instead of a class
This commit is contained in:
@@ -301,7 +301,7 @@ export class TypeScriptServer extends Disposable {
|
||||
callback.onSuccess(response);
|
||||
} else if (response.message === 'No content available.') {
|
||||
// Special case where response itself is successful but there is not any data to return.
|
||||
callback.onSuccess(new NoContentResponse());
|
||||
callback.onSuccess(NoContentResponse);
|
||||
} else {
|
||||
callback.onError(new TypeScriptServerError(this._version, response));
|
||||
}
|
||||
|
||||
@@ -19,11 +19,9 @@ export class CancelledResponse {
|
||||
) { }
|
||||
}
|
||||
|
||||
export class NoContentResponse {
|
||||
public readonly type: 'noContent' = 'noContent';
|
||||
}
|
||||
export const NoContentResponse = new class { readonly type = 'noContent'; };
|
||||
|
||||
export type ServerResponse<T extends Proto.Response> = T | CancelledResponse | NoContentResponse;
|
||||
export type ServerResponse<T extends Proto.Response> = T | CancelledResponse | typeof NoContentResponse;
|
||||
|
||||
interface TypeScriptRequestTypes {
|
||||
'applyCodeActionCommand': [Proto.ApplyCodeActionCommandRequestArgs, Proto.ApplyCodeActionCommandResponse];
|
||||
|
||||
Reference in New Issue
Block a user