mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-23 15:24:20 +01:00
More adoption of @extHostNamedCustomer
This commit is contained in:
@@ -9,28 +9,10 @@ import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IInstantiationService, IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IThreadService, ProxyIdentifier } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { MainContext, InstanceCollection, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { InstanceCollection, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { IExtensionService } from 'vs/platform/extensions/common/extensions';
|
||||
import { ExtHostCustomersRegistry } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
// --- addressable
|
||||
import { MainThreadDiagnostics } from './mainThreadDiagnostics';
|
||||
import { MainThreadDocumentContentProviders } from './mainThreadDocumentContentProviders';
|
||||
import { MainThreadErrors } from './mainThreadErrors';
|
||||
import { MainThreadTreeViews } from './mainThreadTreeViews';
|
||||
import { MainThreadLanguages } from './mainThreadLanguages';
|
||||
import { MainThreadMessageService } from './mainThreadMessageService';
|
||||
import { MainThreadOutputService } from './mainThreadOutputService';
|
||||
import { MainThreadProgress } from './mainThreadProgress';
|
||||
import { MainThreadStatusBar } from './mainThreadStatusBar';
|
||||
import { MainThreadStorage } from './mainThreadStorage';
|
||||
import { MainThreadTelemetry } from './mainThreadTelemetry';
|
||||
import { MainThreadTerminalService } from './mainThreadTerminalService';
|
||||
import { MainThreadWorkspace } from './mainThreadWorkspace';
|
||||
import { MainProcessExtensionServiceAPI } from './mainThreadExtensionService';
|
||||
import { MainThreadTask } from './mainThreadTask';
|
||||
import { MainThreadSCM } from './mainThreadSCM';
|
||||
|
||||
// --- other interested parties
|
||||
import { JSONValidationExtensionPoint } from 'vs/platform/jsonschemas/common/jsonValidationExtensionPoint';
|
||||
import { ColorExtensionPoint } from 'vs/platform/theme/common/colorExtensionPoint';
|
||||
@@ -45,30 +27,31 @@ import './mainThreadCommands';
|
||||
import './mainThreadConfiguration';
|
||||
import './mainThreadCredentials';
|
||||
import './mainThreadDebugService';
|
||||
// import './mainThreadDiagnostics';
|
||||
import './mainThreadDiagnostics';
|
||||
import './mainThreadDocumentContentProviders';
|
||||
import './mainThreadDocuments';
|
||||
import './mainThreadDocumentsAndEditors';
|
||||
import './mainThreadEditor';
|
||||
import './mainThreadEditors';
|
||||
// import './mainThreadErrors';
|
||||
// import './mainThreadExtensionService';
|
||||
import './mainThreadErrors';
|
||||
import './mainThreadExtensionService';
|
||||
import './mainThreadFileSystemEventService';
|
||||
// import './mainThreadHeapService';
|
||||
import './mainThreadLanguageFeatures';
|
||||
// import './mainThreadLanguages';
|
||||
// import './mainThreadMessageService';
|
||||
// import './mainThreadOutputService';
|
||||
// import './mainThreadProgress';
|
||||
import './mainThreadLanguages';
|
||||
import './mainThreadMessageService';
|
||||
import './mainThreadOutputService';
|
||||
import './mainThreadProgress';
|
||||
import './mainThreadQuickOpen';
|
||||
// import './mainThreadSCM';
|
||||
import './mainThreadSCM';
|
||||
// import './mainThreadSaveParticipant';
|
||||
// import './mainThreadStatusBar';
|
||||
// import './mainThreadStorage';
|
||||
// import './mainThreadTask';
|
||||
// import './mainThreadTelemetry';
|
||||
// import './mainThreadTerminalService';
|
||||
// import './mainThreadTreeViews';
|
||||
// import './mainThreadWorkspace';
|
||||
import './mainThreadStatusBar';
|
||||
import './mainThreadStorage';
|
||||
import './mainThreadTask';
|
||||
import './mainThreadTelemetry';
|
||||
import './mainThreadTerminalService';
|
||||
import './mainThreadTreeViews';
|
||||
import './mainThreadWorkspace';
|
||||
|
||||
export class ExtHostContribution implements IWorkbenchContribution {
|
||||
|
||||
@@ -105,24 +88,6 @@ export class ExtHostContribution implements IWorkbenchContribution {
|
||||
}
|
||||
}(this.threadService);
|
||||
|
||||
// Addressable instances
|
||||
col.define(MainContext.MainThreadDiagnostics).set(create(MainThreadDiagnostics));
|
||||
col.define(MainContext.MainThreadDocumentContentProviders).set(create(MainThreadDocumentContentProviders));
|
||||
col.define(MainContext.MainThreadErrors).set(create(MainThreadErrors));
|
||||
col.define(MainContext.MainThreadTreeViews).set(create(MainThreadTreeViews));
|
||||
col.define(MainContext.MainThreadLanguages).set(create(MainThreadLanguages));
|
||||
col.define(MainContext.MainThreadMessageService).set(create(MainThreadMessageService));
|
||||
col.define(MainContext.MainThreadOutputService).set(create(MainThreadOutputService));
|
||||
col.define(MainContext.MainThreadProgress).set(create(MainThreadProgress));
|
||||
col.define(MainContext.MainThreadStatusBar).set(create(MainThreadStatusBar));
|
||||
col.define(MainContext.MainThreadStorage).set(create(MainThreadStorage));
|
||||
col.define(MainContext.MainThreadTelemetry).set(create(MainThreadTelemetry));
|
||||
col.define(MainContext.MainThreadTerminalService).set(create(MainThreadTerminalService));
|
||||
col.define(MainContext.MainThreadWorkspace).set(create(MainThreadWorkspace));
|
||||
col.define(MainContext.MainThreadSCM).set(create(MainThreadSCM));
|
||||
col.define(MainContext.MainThreadTask).set(create(MainThreadTask));
|
||||
col.define(MainContext.MainProcessExtensionService).set(create(MainProcessExtensionServiceAPI));
|
||||
|
||||
// Registered named customers
|
||||
const namedCustomers = ExtHostCustomersRegistry.getNamedCustomers();
|
||||
for (let i = 0, len = namedCustomers.length; i < len; i++) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/
|
||||
import { MainThreadConfigurationShape, MainContext, ExtHostContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer<MainThreadConfigurationShape>(MainContext.MainThreadConfiguration)
|
||||
@extHostNamedCustomer(MainContext.MainThreadConfiguration)
|
||||
export class MainThreadConfiguration implements MainThreadConfigurationShape {
|
||||
|
||||
private readonly _configurationEditingService: IConfigurationEditingService;
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ExtHostContext, MainThreadCredentialsShape, ExtHostCredentialsShape, Ma
|
||||
import { ICredentialsService } from 'vs/platform/credentials/common/credentials';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer<MainThreadCredentialsShape>(MainContext.MainThreadCredentials)
|
||||
@extHostNamedCustomer(MainContext.MainThreadCredentials)
|
||||
export class MainThreadCredentials implements MainThreadCredentialsShape {
|
||||
|
||||
private _proxy: ExtHostCredentialsShape;
|
||||
|
||||
@@ -11,7 +11,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { ExtHostContext, ExtHostDebugServiceShape, MainThreadDebugServiceShape, DebugSessionUUID, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer<MainThreadDebugServiceShape>(MainContext.MainThreadDebugService)
|
||||
@extHostNamedCustomer(MainContext.MainThreadDebugService)
|
||||
export class MainThreadDebugService implements MainThreadDebugServiceShape {
|
||||
|
||||
private _proxy: ExtHostDebugServiceShape;
|
||||
|
||||
@@ -7,14 +7,19 @@
|
||||
import { IMarkerService, IMarkerData } from 'vs/platform/markers/common/markers';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { MainThreadDiagnosticsShape } from '../node/extHost.protocol';
|
||||
import { MainThreadDiagnosticsShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadDiagnostics)
|
||||
export class MainThreadDiagnostics implements MainThreadDiagnosticsShape {
|
||||
|
||||
private readonly _activeOwners = new Set<string>();
|
||||
private readonly _markerService: IMarkerService;
|
||||
|
||||
constructor( @IMarkerService markerService: IMarkerService) {
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@IMarkerService markerService: IMarkerService
|
||||
) {
|
||||
this._markerService = markerService;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,30 +7,37 @@
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { IModel } from 'vs/editor/common/editorCommon';
|
||||
import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService';
|
||||
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
|
||||
import { MainThreadDocumentContentProvidersShape, ExtHostContext, ExtHostDocumentContentProvidersShape } from '../node/extHost.protocol';
|
||||
import { MainThreadDocumentContentProvidersShape, ExtHostContext, ExtHostDocumentContentProvidersShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { ITextSource } from 'vs/editor/common/model/textSource';
|
||||
import { ITextModelService } from 'vs/editor/common/services/resolverService';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadDocumentContentProviders)
|
||||
export class MainThreadDocumentContentProviders implements MainThreadDocumentContentProvidersShape {
|
||||
|
||||
private _resourceContentProvider: { [handle: number]: IDisposable } = Object.create(null);
|
||||
private readonly _proxy: ExtHostDocumentContentProvidersShape;
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@ITextModelService private readonly _textModelResolverService: ITextModelService,
|
||||
@IModeService private readonly _modeService: IModeService,
|
||||
@IModelService private readonly _modelService: IModelService,
|
||||
@IThreadService threadService: IThreadService,
|
||||
@ICodeEditorService codeEditorService: ICodeEditorService,
|
||||
@IEditorGroupService editorGroupService: IEditorGroupService
|
||||
) {
|
||||
this._proxy = threadService.get(ExtHostContext.ExtHostDocumentContentProviders);
|
||||
this._proxy = extHostContext.get(ExtHostContext.ExtHostDocumentContentProviders);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
for (let handle in this._resourceContentProvider) {
|
||||
this._resourceContentProvider[handle].dispose();
|
||||
}
|
||||
}
|
||||
|
||||
$registerTextContentProvider(handle: number, scheme: string): void {
|
||||
|
||||
@@ -5,12 +5,16 @@
|
||||
'use strict';
|
||||
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import { MainThreadErrorsShape } from '../node/extHost.protocol';
|
||||
import { MainThreadErrorsShape, MainContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadErrors)
|
||||
export class MainThreadErrors implements MainThreadErrorsShape {
|
||||
|
||||
public onUnexpectedExtHostError(err: any): void {
|
||||
errors.onUnexpectedError(err);
|
||||
public dispose(): void {
|
||||
}
|
||||
|
||||
public $onUnexpectedExtHostError(err: any): void {
|
||||
errors.onUnexpectedError(err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,19 +6,27 @@
|
||||
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { IExtensionService } from 'vs/platform/extensions/common/extensions';
|
||||
import { MainProcessExtensionServiceShape } from '../node/extHost.protocol';
|
||||
import { MainThreadExtensionServiceShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { ExtensionService } from "vs/workbench/services/extensions/electron-browser/extensionService";
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
export class MainProcessExtensionServiceAPI implements MainProcessExtensionServiceShape {
|
||||
@extHostNamedCustomer(MainContext.MainThreadExtensionService)
|
||||
export class MainThreadExtensionService implements MainThreadExtensionServiceShape {
|
||||
|
||||
private readonly _extensionService: ExtensionService;
|
||||
|
||||
constructor( @IExtensionService extensionService: IExtensionService) {
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@IExtensionService extensionService: IExtensionService
|
||||
) {
|
||||
if (extensionService instanceof ExtensionService) {
|
||||
this._extensionService = extensionService;
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
}
|
||||
|
||||
$localShowMessage(severity: Severity, msg: string): void {
|
||||
this._extensionService._logOrShowMessage(severity, msg);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { ColorFormatter, CombinedColorFormatter } from 'vs/editor/contrib/colorPicker/common/colorFormatter';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer<MainThreadLanguageFeaturesShape>(MainContext.MainThreadLanguageFeatures)
|
||||
@extHostNamedCustomer(MainContext.MainThreadLanguageFeatures)
|
||||
export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesShape {
|
||||
|
||||
private _proxy: ExtHostLanguageFeaturesShape;
|
||||
|
||||
@@ -6,18 +6,24 @@
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { MainThreadLanguagesShape } from '../node/extHost.protocol';
|
||||
import { MainThreadLanguagesShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadLanguages)
|
||||
export class MainThreadLanguages implements MainThreadLanguagesShape {
|
||||
|
||||
private _modeService: IModeService;
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@IModeService modeService: IModeService
|
||||
) {
|
||||
this._modeService = modeService;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
}
|
||||
|
||||
$getLanguages(): TPromise<string[]> {
|
||||
return TPromise.as(this._modeService.getRegisteredModes());
|
||||
}
|
||||
|
||||
@@ -9,17 +9,23 @@ import { IMessageService, IChoiceService } from 'vs/platform/message/common/mess
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { TPromise as Promise } from 'vs/base/common/winjs.base';
|
||||
import { MainThreadMessageServiceShape } from '../node/extHost.protocol';
|
||||
import { MainThreadMessageServiceShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import * as vscode from 'vscode';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadMessageService)
|
||||
export class MainThreadMessageService implements MainThreadMessageServiceShape {
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@IMessageService private _messageService: IMessageService,
|
||||
@IChoiceService private _choiceService: IChoiceService
|
||||
) {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
}
|
||||
|
||||
$showMessage(severity: Severity, message: string, options: vscode.MessageOptions, commands: { title: string; isCloseAffordance: boolean; handle: number; }[]): Thenable<number> {
|
||||
if (options.modal) {
|
||||
return this.showModalMessage(severity, message, commands);
|
||||
|
||||
@@ -9,8 +9,10 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IOutputService, IOutputChannel, OUTPUT_PANEL_ID, Extensions, IOutputChannelRegistry } from 'vs/workbench/parts/output/common/output';
|
||||
import { IPartService } from 'vs/workbench/services/part/common/partService';
|
||||
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
import { MainThreadOutputServiceShape } from '../node/extHost.protocol';
|
||||
import { MainThreadOutputServiceShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadOutputService)
|
||||
export class MainThreadOutputService implements MainThreadOutputServiceShape {
|
||||
|
||||
private readonly _outputService: IOutputService;
|
||||
@@ -18,6 +20,7 @@ export class MainThreadOutputService implements MainThreadOutputServiceShape {
|
||||
private readonly _panelService: IPanelService;
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@IOutputService outputService: IOutputService,
|
||||
@IPartService partService: IPartService,
|
||||
@IPanelService panelService: IPanelService
|
||||
@@ -27,6 +30,10 @@ export class MainThreadOutputService implements MainThreadOutputServiceShape {
|
||||
this._panelService = panelService;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
// Leave all the existing channels intact (e.g. might help with troubleshooting)
|
||||
}
|
||||
|
||||
public $append(channelId: string, label: string, value: string): TPromise<void> {
|
||||
this._getChannel(channelId, label).append(value);
|
||||
return undefined;
|
||||
|
||||
@@ -6,14 +6,17 @@
|
||||
|
||||
import { IProgressService2, IProgress, IProgressOptions, IProgressStep } from 'vs/platform/progress/common/progress';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { MainThreadProgressShape } from '../node/extHost.protocol';
|
||||
import { MainThreadProgressShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadProgress)
|
||||
export class MainThreadProgress implements MainThreadProgressShape {
|
||||
|
||||
private _progressService: IProgressService2;
|
||||
private _progress = new Map<number, { resolve: Function, progress: IProgress<IProgressStep> }>();
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@IProgressService2 progressService: IProgressService2
|
||||
) {
|
||||
this._progressService = progressService;
|
||||
|
||||
@@ -11,7 +11,7 @@ import { InputBoxOptions } from 'vscode';
|
||||
import { ExtHostContext, MainThreadQuickOpenShape, ExtHostQuickOpenShape, MyQuickPickItems, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer<MainThreadQuickOpenShape>(MainContext.MainThreadQuickOpen)
|
||||
@extHostNamedCustomer(MainContext.MainThreadQuickOpen)
|
||||
export class MainThreadQuickOpen implements MainThreadQuickOpenShape {
|
||||
|
||||
private _proxy: ExtHostQuickOpenShape;
|
||||
|
||||
@@ -10,12 +10,12 @@ import URI from 'vs/base/common/uri';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { ISCMService, ISCMProvider, ISCMResource, ISCMResourceGroup, ISCMResourceDecorations } from 'vs/workbench/services/scm/common/scm';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { ExtHostContext, MainThreadSCMShape, ExtHostSCMShape, SCMProviderFeatures, SCMRawResource, SCMGroupFeatures } from '../node/extHost.protocol';
|
||||
import { ExtHostContext, MainThreadSCMShape, ExtHostSCMShape, SCMProviderFeatures, SCMRawResource, SCMGroupFeatures, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { Command } from 'vs/editor/common/modes';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
class MainThreadSCMResourceGroup implements ISCMResourceGroup {
|
||||
|
||||
@@ -205,6 +205,7 @@ class MainThreadSCMProvider implements ISCMProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadSCM)
|
||||
export class MainThreadSCM implements MainThreadSCMShape {
|
||||
|
||||
private _proxy: ExtHostSCMShape;
|
||||
@@ -213,17 +214,29 @@ export class MainThreadSCM implements MainThreadSCMShape {
|
||||
private _disposables: IDisposable[] = [];
|
||||
|
||||
constructor(
|
||||
@IThreadService threadService: IThreadService,
|
||||
extHostContext: IExtHostContext,
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@ISCMService private scmService: ISCMService,
|
||||
@ICommandService private commandService: ICommandService
|
||||
) {
|
||||
this._proxy = threadService.get(ExtHostContext.ExtHostSCM);
|
||||
this._proxy = extHostContext.get(ExtHostContext.ExtHostSCM);
|
||||
|
||||
this.scmService.onDidChangeProvider(this.onDidChangeProvider, this, this._disposables);
|
||||
this.scmService.input.onDidChange(this._proxy.$onInputBoxValueChange, this._proxy, this._disposables);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
Object.keys(this._sourceControls)
|
||||
.forEach(id => this._sourceControls[id].dispose());
|
||||
this._sourceControls = Object.create(null);
|
||||
|
||||
Object.keys(this._sourceControlDisposables)
|
||||
.forEach(id => this._sourceControlDisposables[id].dispose());
|
||||
this._sourceControlDisposables = Object.create(null);
|
||||
|
||||
this._disposables = dispose(this._disposables);
|
||||
}
|
||||
|
||||
$registerSourceControl(handle: number, id: string, label: string): void {
|
||||
const provider = new MainThreadSCMProvider(this._proxy, handle, id, label, this.scmService, this.commandService);
|
||||
this._sourceControls[handle] = provider;
|
||||
@@ -312,12 +325,4 @@ export class MainThreadSCM implements MainThreadSCMShape {
|
||||
const handle = Object.keys(this._sourceControls).filter(handle => this._sourceControls[handle] === provider)[0];
|
||||
this._proxy.$onActiveSourceControlChange(handle && parseInt(handle));
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
Object.keys(this._sourceControls)
|
||||
.forEach(id => this._sourceControls[id].dispose());
|
||||
|
||||
this._sourceControls = Object.create(null);
|
||||
this._disposables = dispose(this._disposables);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,9 +225,9 @@ export class SaveParticipant implements ISaveParticipant {
|
||||
private _saveParticipants: INamedSaveParticpant[];
|
||||
|
||||
constructor(
|
||||
@IThreadService threadService: IThreadService,
|
||||
@ITelemetryService private _telemetryService: ITelemetryService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IThreadService threadService: IThreadService
|
||||
@IInstantiationService instantiationService: IInstantiationService
|
||||
) {
|
||||
|
||||
this._saveParticipants = [
|
||||
|
||||
@@ -6,14 +6,17 @@
|
||||
|
||||
import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { MainThreadStatusBarShape } from '../node/extHost.protocol';
|
||||
import { MainThreadStatusBarShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { ThemeColor } from 'vs/platform/theme/common/themeService';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadStatusBar)
|
||||
export class MainThreadStatusBar implements MainThreadStatusBarShape {
|
||||
|
||||
private readonly _entries: { [id: number]: IDisposable };
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@IStatusbarService private readonly _statusbarService: IStatusbarService
|
||||
) {
|
||||
this._entries = Object.create(null);
|
||||
|
||||
@@ -6,16 +6,24 @@
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { MainThreadStorageShape } from '../node/extHost.protocol';
|
||||
import { MainThreadStorageShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadStorage)
|
||||
export class MainThreadStorage implements MainThreadStorageShape {
|
||||
|
||||
private _storageService: IStorageService;
|
||||
|
||||
constructor( @IStorageService storageService: IStorageService) {
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@IStorageService storageService: IStorageService
|
||||
) {
|
||||
this._storageService = storageService;
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
}
|
||||
|
||||
$getValue<T>(shared: boolean, key: string): TPromise<T> {
|
||||
let jsonValue = this._storageService.get(key, shared ? StorageScope.GLOBAL : StorageScope.WORKSPACE);
|
||||
if (!jsonValue) {
|
||||
|
||||
@@ -7,16 +7,29 @@
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
|
||||
import { ITaskService } from 'vs/workbench/parts/tasks/common/taskService';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
|
||||
import { ExtHostContext, MainThreadTaskShape, ExtHostTaskShape } from '../node/extHost.protocol';
|
||||
import { ExtHostContext, MainThreadTaskShape, ExtHostTaskShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadTask)
|
||||
export class MainThreadTask implements MainThreadTaskShape {
|
||||
|
||||
private _proxy: ExtHostTaskShape;
|
||||
private _activeHandles: { [handle: number]: boolean; };
|
||||
|
||||
constructor( @IThreadService threadService: IThreadService, @ITaskService private _taskService: ITaskService) {
|
||||
this._proxy = threadService.get(ExtHostContext.ExtHostTask);
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@ITaskService private _taskService: ITaskService
|
||||
) {
|
||||
this._proxy = extHostContext.get(ExtHostContext.ExtHostTask);
|
||||
this._activeHandles = Object.create(null);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
Object.keys(this._activeHandles).forEach((handle) => {
|
||||
this._taskService.unregisterTaskProvider(parseInt(handle, 10));
|
||||
});
|
||||
this._activeHandles = Object.create(null);
|
||||
}
|
||||
|
||||
public $registerTaskProvider(handle: number): TPromise<void> {
|
||||
@@ -25,11 +38,13 @@ export class MainThreadTask implements MainThreadTaskShape {
|
||||
return this._proxy.$provideTasks(handle);
|
||||
}
|
||||
});
|
||||
this._activeHandles[handle] = true;
|
||||
return TPromise.as<void>(undefined);
|
||||
}
|
||||
|
||||
public $unregisterTaskProvider(handle: number): TPromise<any> {
|
||||
this._taskService.unregisterTaskProvider(handle);
|
||||
delete this._activeHandles[handle];
|
||||
return TPromise.as<void>(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,19 +6,24 @@
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { ITelemetryService, ITelemetryInfo } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { MainThreadTelemetryShape } from '../node/extHost.protocol';
|
||||
import { MainThreadTelemetryShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
/**
|
||||
* Helper always instantiated in the main process to receive telemetry events from remote telemetry services
|
||||
*/
|
||||
@extHostNamedCustomer(MainContext.MainThreadTelemetry)
|
||||
export class MainThreadTelemetry implements MainThreadTelemetryShape {
|
||||
|
||||
private _telemetryService: ITelemetryService;
|
||||
|
||||
constructor( @ITelemetryService telemetryService: ITelemetryService) {
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@ITelemetryService telemetryService: ITelemetryService
|
||||
) {
|
||||
this._telemetryService = telemetryService;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
}
|
||||
|
||||
public $publicLog(eventName: string, data?: any): void {
|
||||
this._telemetryService.publicLog(eventName, data);
|
||||
}
|
||||
|
||||
@@ -6,20 +6,21 @@
|
||||
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { ITerminalService, ITerminalInstance, IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { ExtHostContext, ExtHostTerminalServiceShape, MainThreadTerminalServiceShape } from '../node/extHost.protocol';
|
||||
import { ExtHostContext, ExtHostTerminalServiceShape, MainThreadTerminalServiceShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadTerminalService)
|
||||
export class MainThreadTerminalService implements MainThreadTerminalServiceShape {
|
||||
|
||||
private _proxy: ExtHostTerminalServiceShape;
|
||||
private _toDispose: IDisposable[];
|
||||
|
||||
constructor(
|
||||
@IThreadService threadService: IThreadService,
|
||||
extHostContext: IExtHostContext,
|
||||
@ITerminalService private terminalService: ITerminalService
|
||||
) {
|
||||
this._proxy = threadService.get(ExtHostContext.ExtHostTerminalService);
|
||||
this._proxy = extHostContext.get(ExtHostContext.ExtHostTerminalService);
|
||||
this._toDispose = [];
|
||||
this._toDispose.push(terminalService.onInstanceDisposed((terminalInstance) => this._onTerminalDisposed(terminalInstance)));
|
||||
this._toDispose.push(terminalService.onInstanceProcessIdReady((terminalInstance) => this._onTerminalProcessIdReady(terminalInstance)));
|
||||
@@ -27,6 +28,9 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
|
||||
|
||||
public dispose(): void {
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
|
||||
// TODO@Daniel: Should all the previously created terminals be disposed
|
||||
// when the extension host process goes down ?
|
||||
}
|
||||
|
||||
public $createTerminal(name?: string, shellPath?: string, shellArgs?: string[], waitOnExit?: boolean): TPromise<number> {
|
||||
|
||||
@@ -6,21 +6,27 @@
|
||||
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { ExtHostContext, MainThreadTreeViewsShape, ExtHostTreeViewsShape } from '../node/extHost.protocol';
|
||||
import { ExtHostContext, MainThreadTreeViewsShape, ExtHostTreeViewsShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { IMessageService, Severity } from 'vs/platform/message/common/message';
|
||||
import { ViewsRegistry } from 'vs/workbench/parts/views/browser/viewsRegistry';
|
||||
import { ITreeViewDataProvider, ITreeItem, TreeItemCollapsibleState } from 'vs/workbench/parts/views/common/views';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadTreeViews)
|
||||
export class MainThreadTreeViews implements MainThreadTreeViewsShape {
|
||||
|
||||
private _proxy: ExtHostTreeViewsShape;
|
||||
|
||||
constructor(
|
||||
@IThreadService threadService: IThreadService,
|
||||
extHostContext: IExtHostContext,
|
||||
@IMessageService private messageService: IMessageService
|
||||
) {
|
||||
this._proxy = threadService.get(ExtHostContext.ExtHostTreeViews);
|
||||
this._proxy = extHostContext.get(ExtHostContext.ExtHostTreeViews);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
// TODO@Sandeep: please implement this
|
||||
// will be called when the extension host process is gone.
|
||||
}
|
||||
|
||||
$registerView(treeViewId: string): void {
|
||||
|
||||
@@ -13,15 +13,15 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile
|
||||
import { ICommonCodeEditor, isCommonCodeEditor } from 'vs/editor/common/editorCommon';
|
||||
import { bulkEdit, IResourceEdit } from 'vs/editor/common/services/bulkEdit';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { MainThreadWorkspaceShape, ExtHostWorkspaceShape, ExtHostContext } from '../node/extHost.protocol';
|
||||
import { MainThreadWorkspaceShape, ExtHostWorkspaceShape, ExtHostContext, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
import { ITextModelService } from 'vs/editor/common/services/resolverService';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { RemoteFileService, IRemoteFileSystemProvider } from 'vs/workbench/services/files/electron-browser/remoteFileService';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadWorkspace)
|
||||
export class MainThreadWorkspace implements MainThreadWorkspaceShape {
|
||||
|
||||
private readonly _toDispose: IDisposable[] = [];
|
||||
@@ -29,20 +29,25 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape {
|
||||
private readonly _proxy: ExtHostWorkspaceShape;
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@ISearchService private readonly _searchService: ISearchService,
|
||||
@IWorkspaceContextService private readonly _contextService: IWorkspaceContextService,
|
||||
@ITextFileService private readonly _textFileService: ITextFileService,
|
||||
@IWorkbenchEditorService private readonly _editorService: IWorkbenchEditorService,
|
||||
@ITextModelService private readonly _textModelResolverService: ITextModelService,
|
||||
@IFileService private readonly _fileService: IFileService,
|
||||
@IThreadService threadService: IThreadService
|
||||
@IFileService private readonly _fileService: IFileService
|
||||
) {
|
||||
this._proxy = threadService.get(ExtHostContext.ExtHostWorkspace);
|
||||
this._proxy = extHostContext.get(ExtHostContext.ExtHostWorkspace);
|
||||
this._contextService.onDidChangeWorkspaceRoots(this._onDidChangeWorkspace, this, this._toDispose);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
dispose(this._toDispose);
|
||||
|
||||
for (let requestId in this._activeSearches) {
|
||||
const search = this._activeSearches[requestId];
|
||||
search.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
// --- workspace ---
|
||||
|
||||
@@ -8,7 +8,6 @@ import { Emitter } from 'vs/base/common/event';
|
||||
import { TrieMap } from 'vs/base/common/map';
|
||||
import { score } from 'vs/editor/common/modes/languageSelector';
|
||||
import * as Platform from 'vs/base/common/platform';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import product from 'vs/platform/node/product';
|
||||
import pkg from 'vs/platform/node/package';
|
||||
@@ -52,6 +51,7 @@ import { realpath } from 'fs';
|
||||
import { MainContext, ExtHostContext, InstanceCollection, IInitData } from './extHost.protocol';
|
||||
import * as languageConfiguration from 'vs/editor/common/modes/languageConfiguration';
|
||||
import { TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions';
|
||||
import { ExtHostThreadService } from "vs/workbench/services/thread/node/extHostThreadService";
|
||||
|
||||
export interface IExtensionApiFactory {
|
||||
(extension: IExtensionDescription): typeof vscode;
|
||||
@@ -72,7 +72,7 @@ function proposedApiFunction<T>(extension: IExtensionDescription, fn: T): T {
|
||||
*/
|
||||
export function createApiFactory(
|
||||
initData: IInitData,
|
||||
threadService: IThreadService,
|
||||
threadService: ExtHostThreadService,
|
||||
extensionService: ExtHostExtensionService,
|
||||
telemetryService: ITelemetryService
|
||||
): IExtensionApiFactory {
|
||||
|
||||
@@ -226,7 +226,7 @@ export interface MainThreadTreeViewsShape {
|
||||
}
|
||||
|
||||
export interface MainThreadErrorsShape {
|
||||
onUnexpectedExtHostError(err: any): void;
|
||||
$onUnexpectedExtHostError(err: any): void;
|
||||
}
|
||||
|
||||
export interface MainThreadLanguageFeaturesShape {
|
||||
@@ -326,7 +326,7 @@ export interface MainThreadTaskShape {
|
||||
$unregisterTaskProvider(handle: number): TPromise<any>;
|
||||
}
|
||||
|
||||
export interface MainProcessExtensionServiceShape {
|
||||
export interface MainThreadExtensionServiceShape {
|
||||
$localShowMessage(severity: Severity, msg: string): void;
|
||||
$onExtensionActivated(extensionId: string): void;
|
||||
$onExtensionActivationFailed(extensionId: string): void;
|
||||
@@ -579,7 +579,7 @@ export const MainContext = {
|
||||
MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry'),
|
||||
MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService'),
|
||||
MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace'),
|
||||
MainProcessExtensionService: createMainId<MainProcessExtensionServiceShape>('MainProcessExtensionService'),
|
||||
MainThreadExtensionService: createMainId<MainThreadExtensionServiceShape>('MainThreadExtensionService'),
|
||||
MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM'),
|
||||
MainThreadTask: createMainId<MainThreadTaskShape>('MainThreadTask'),
|
||||
MainThreadCredentials: createMainId<MainThreadCredentialsShape>('MainThreadCredentials'),
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { Disposable } from 'vs/workbench/api/node/extHostTypes';
|
||||
@@ -14,7 +13,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import * as vscode from 'vscode';
|
||||
import { asWinJsPromise } from 'vs/base/common/async';
|
||||
import { TextSource } from 'vs/editor/common/model/textSource';
|
||||
import { MainContext, ExtHostDocumentContentProvidersShape, MainThreadDocumentContentProvidersShape } from './extHost.protocol';
|
||||
import { MainContext, ExtHostDocumentContentProvidersShape, MainThreadDocumentContentProvidersShape, IMainContext } from './extHost.protocol';
|
||||
import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors';
|
||||
|
||||
export class ExtHostDocumentContentProvider implements ExtHostDocumentContentProvidersShape {
|
||||
@@ -25,8 +24,8 @@ export class ExtHostDocumentContentProvider implements ExtHostDocumentContentPro
|
||||
private readonly _proxy: MainThreadDocumentContentProvidersShape;
|
||||
private readonly _documentsAndEditors: ExtHostDocumentsAndEditors;
|
||||
|
||||
constructor(threadService: IThreadService, documentsAndEditors: ExtHostDocumentsAndEditors) {
|
||||
this._proxy = threadService.get(MainContext.MainThreadDocumentContentProviders);
|
||||
constructor(mainContext: IMainContext, documentsAndEditors: ExtHostDocumentsAndEditors) {
|
||||
this._proxy = mainContext.get(MainContext.MainThreadDocumentContentProviders);
|
||||
this._documentsAndEditors = documentsAndEditors;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'
|
||||
import { ExtHostStorage } from 'vs/workbench/api/node/extHostStorage';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { createApiFactory, initializeExtensionApi } from 'vs/workbench/api/node/extHost.api.impl';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { MainContext, MainProcessExtensionServiceShape, IWorkspaceData, IEnvironment, IInitData } from './extHost.protocol';
|
||||
import { MainContext, MainThreadExtensionServiceShape, IWorkspaceData, IEnvironment, IInitData } from './extHost.protocol';
|
||||
import { IExtensionMemento, ExtensionsActivator, ActivatedExtension, IExtensionAPI, IExtensionContext, EmptyExtension, IExtensionModule } from "vs/workbench/api/node/extHostExtensionActivator";
|
||||
import { Barrier } from "vs/workbench/services/extensions/node/barrier";
|
||||
import { ExtHostThreadService } from "vs/workbench/services/thread/node/extHostThreadService";
|
||||
|
||||
class ExtensionMemento implements IExtensionMemento {
|
||||
|
||||
@@ -109,24 +109,24 @@ export class ExtHostExtensionService {
|
||||
|
||||
private readonly _barrier: Barrier;
|
||||
private readonly _registry: ExtensionDescriptionRegistry;
|
||||
private readonly _threadService: IThreadService;
|
||||
private readonly _threadService: ExtHostThreadService;
|
||||
private readonly _telemetryService: ITelemetryService;
|
||||
private readonly _storage: ExtHostStorage;
|
||||
private readonly _storagePath: ExtensionStoragePath;
|
||||
private readonly _proxy: MainProcessExtensionServiceShape;
|
||||
private readonly _proxy: MainThreadExtensionServiceShape;
|
||||
private _activator: ExtensionsActivator;
|
||||
|
||||
/**
|
||||
* This class is constructed manually because it is a service, so it doesn't use any ctor injection
|
||||
*/
|
||||
constructor(initData: IInitData, threadService: IThreadService, telemetryService: ITelemetryService) {
|
||||
constructor(initData: IInitData, threadService: ExtHostThreadService, telemetryService: ITelemetryService) {
|
||||
this._barrier = new Barrier();
|
||||
this._registry = new ExtensionDescriptionRegistry(initData.extensions);
|
||||
this._threadService = threadService;
|
||||
this._telemetryService = telemetryService;
|
||||
this._storage = new ExtHostStorage(threadService);
|
||||
this._storagePath = new ExtensionStoragePath(initData.workspace, initData.environment);
|
||||
this._proxy = this._threadService.get(MainContext.MainProcessExtensionService);
|
||||
this._proxy = this._threadService.get(MainContext.MainThreadExtensionService);
|
||||
this._activator = null;
|
||||
|
||||
// initialize API first (i.e. do not release barrier until the API is initialized)
|
||||
|
||||
@@ -51,7 +51,7 @@ export class ExtensionHostMain {
|
||||
|
||||
// Error forwarding
|
||||
const mainThreadErrors = threadService.get(MainContext.MainThreadErrors);
|
||||
errors.setUnexpectedErrorHandler(err => mainThreadErrors.onUnexpectedExtHostError(errors.transformErrorForSerialization(err)));
|
||||
errors.setUnexpectedErrorHandler(err => mainThreadErrors.$onUnexpectedExtHostError(errors.transformErrorForSerialization(err)));
|
||||
|
||||
// Configure the watchdog to kill our process if the JS event loop is unresponsive for more than 10s
|
||||
if (!initData.environment.isExtensionDevelopmentDebug) {
|
||||
|
||||
@@ -14,7 +14,7 @@ suite('ExtHostMessageService', function () {
|
||||
|
||||
test('propagte handle on select', function () {
|
||||
|
||||
let service = new MainThreadMessageService(<any>{
|
||||
let service = new MainThreadMessageService(null, <any>{
|
||||
show(sev: number, m: { message; actions: Action[] }) {
|
||||
assert.equal(m.actions.length, 1);
|
||||
setImmediate(() => m.actions[0].run());
|
||||
@@ -34,7 +34,7 @@ suite('ExtHostMessageService', function () {
|
||||
test('isCloseAffordance', function () {
|
||||
|
||||
let actions: Action[];
|
||||
let service = new MainThreadMessageService(<any>{
|
||||
let service = new MainThreadMessageService(null, <any>{
|
||||
show(sev: number, m: { message; actions: Action[] }) {
|
||||
actions = m.actions;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ suite('ExtHostMessageService', function () {
|
||||
|
||||
let actions: Action[];
|
||||
let c: number;
|
||||
let service = new MainThreadMessageService(<any>{
|
||||
let service = new MainThreadMessageService(null, <any>{
|
||||
show(sev: number, m: { message; actions: Action[] }) {
|
||||
c = 0;
|
||||
actions = m.actions;
|
||||
@@ -85,7 +85,7 @@ suite('ExtHostMessageService', function () {
|
||||
|
||||
suite('modal', () => {
|
||||
test('calls choice service', () => {
|
||||
const service = new MainThreadMessageService(<any>{
|
||||
const service = new MainThreadMessageService(null, <any>{
|
||||
show(sev: number, m: { message; actions: Action[] }) {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
@@ -105,7 +105,7 @@ suite('ExtHostMessageService', function () {
|
||||
});
|
||||
|
||||
test('returns undefined when cancelled', () => {
|
||||
const service = new MainThreadMessageService(<any>{
|
||||
const service = new MainThreadMessageService(null, <any>{
|
||||
show(sev: number, m: { message; actions: Action[] }) {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
@@ -121,7 +121,7 @@ suite('ExtHostMessageService', function () {
|
||||
});
|
||||
|
||||
test('hides Cancel button when not needed', () => {
|
||||
const service = new MainThreadMessageService(<any>{
|
||||
const service = new MainThreadMessageService(null, <any>{
|
||||
show(sev: number, m: { message; actions: Action[] }) {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ suite('MainThreadDiagnostics', function () {
|
||||
|
||||
test('clear markers on dispose', function () {
|
||||
|
||||
let diag = new MainThreadDiagnostics(markerService);
|
||||
let diag = new MainThreadDiagnostics(null, markerService);
|
||||
|
||||
diag.$changeMany('foo', [[URI.file('a'), [{
|
||||
code: '666',
|
||||
|
||||
Reference in New Issue
Block a user