提交 9895df1c 编写于 作者: M Martin Aeschlimann

Change WorkbenchContentProvider to a IWorkbenchContribution

上级 6f9a797f
......@@ -94,7 +94,6 @@ import {IModeService} from 'vs/editor/common/services/modeService';
import {IUntitledEditorService, UntitledEditorService} from 'vs/workbench/services/untitled/common/untitledEditorService';
import {CrashReporter} from 'vs/workbench/electron-browser/crashReporter';
import {IThemeService, ThemeService} from 'vs/workbench/services/themes/node/themeService';
import {WorkbenchContentProvider} from 'vs/workbench/services/contentprovider/common/workbenchContentProvider';
import { IServiceCtor, isServiceEvent } from 'vs/base/common/service';
import { connect, Client } from 'vs/base/node/service.net';
import { IExtensionsService } from 'vs/workbench/parts/extensions/common/extensions';
......@@ -219,9 +218,6 @@ export class WorkbenchShell {
}
});
// content service
this.workbench.getInstantiationService().createInstance(WorkbenchContentProvider).start();
// Electron integration
this.workbench.getInstantiationService().createInstance(ElectronIntegration).integrate(this.container);
......
......@@ -12,10 +12,12 @@ import {TPromise} from 'vs/base/common/winjs.base';
import {IModel} from 'vs/editor/common/editorCommon';
import JSONContributionRegistry = require('vs/platform/jsonschemas/common/jsonContributionRegistry');
import {Registry} from 'vs/platform/platform';
import {IWorkbenchContribution} from 'vs/workbench/common/contributions';
import {IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions} from 'vs/workbench/common/contributions';
let schemaRegistry = <JSONContributionRegistry.IJSONContributionRegistry>Registry.as(JSONContributionRegistry.Extensions.JSONContribution);
export class WorkbenchContentProvider {
export class WorkbenchContentProvider implements IWorkbenchContribution {
private modelService: IModelService;
private modeService: IModeService;
......@@ -26,9 +28,15 @@ export class WorkbenchContentProvider {
) {
this.modelService = modelService;
this.modeService = modeService;
this.start();
}
public getId(): string {
return 'vs.contentprovider';
}
public start(): void {
private start(): void {
ResourceEditorInput.registerResourceContentProvider("vscode", {
provideTextContent: (uri: URI): TPromise<IModel> => {
if (uri.scheme !== 'vscode') {
......@@ -47,4 +55,6 @@ export class WorkbenchContentProvider {
}
});
}
}
\ No newline at end of file
}
(<IWorkbenchContributionsRegistry>Registry.as(WorkbenchExtensions.Workbench)).registerWorkbenchContribution(WorkbenchContentProvider);
\ No newline at end of file
......@@ -75,6 +75,8 @@ define([
'vs/workbench/parts/feedback/electron-browser/feedback.contribution',
'vs/workbench/parts/contentprovider/common/contentprovider.contribution',
'vs/workbench/electron-browser/main.contribution',
'vs/workbench/electron-browser/main'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册