提交 7e473e3e 编写于 作者: B Benjamin Pasero

debt - register hash service as singleton

上级 0bcaf897
......@@ -99,7 +99,6 @@ import { ILogService } from 'vs/platform/log/common/log';
import { toErrorMessage } from 'vs/base/common/errorMessage';
import { ILabelService } from 'vs/platform/label/common/label';
import { LabelService } from 'vs/workbench/services/label/common/labelService';
import { IHashService } from 'vs/workbench/services/hash/common/hashService';
import { ITelemetryServiceConfig, TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
import { combinedAppender, LogAppender, NullTelemetryService, configurationTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
import ErrorTelemetry from 'vs/platform/telemetry/browser/errorTelemetry';
......@@ -143,7 +142,6 @@ import { WorkspaceService } from 'vs/workbench/services/configuration/node/confi
import { JSONEditingService } from 'vs/workbench/services/configuration/node/jsonEditingService';
import { WorkspaceEditingService } from 'vs/workbench/services/workspace/node/workspaceEditingService';
import { getDelayedChannel } from 'vs/base/parts/ipc/node/ipc';
import { HashService } from 'vs/workbench/services/hash/node/hashService';
import { connect as connectNet } from 'vs/base/parts/ipc/node/ipc.net';
import { DialogChannel } from 'vs/platform/dialogs/node/dialogIpc';
import { TelemetryAppenderClient } from 'vs/platform/telemetry/node/telemetryIpc';
......@@ -612,7 +610,7 @@ export class Workbench extends Disposable implements IPartService {
serviceCollection.set(ILocalizationsService, new SyncDescriptor(LocalizationsChannelClient, [localizationsChannel]));
// Hash
serviceCollection.set(IHashService, new SyncDescriptor(HashService, undefined, true));
// serviceCollection.set(IHashService, new SyncDescriptor(HashService, undefined, true));
// Status bar
this.statusbarPart = this.instantiationService.createInstance(StatusbarPart, Identifiers.STATUSBAR_PART);
......
......@@ -5,12 +5,15 @@
import { createHash } from 'crypto';
import { IHashService } from 'vs/workbench/services/hash/common/hashService';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
export class HashService implements IHashService {
_serviceBrand: any;
public createSHA1(content: string): string {
createSHA1(content: string): string {
return createHash('sha1').update(content).digest('hex');
}
}
\ No newline at end of file
}
registerSingleton(IHashService, HashService, true);
\ No newline at end of file
......@@ -42,6 +42,7 @@ import 'vs/workbench/api/browser/viewsExtensionPoint';
import 'vs/workbench/services/bulkEdit/browser/bulkEditService';
import 'vs/workbench/services/integrity/node/integrityService';
import 'vs/workbench/services/keybinding/common/keybindingEditing';
import 'vs/workbench/services/hash/node/hashService';
//#endregion
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册