mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
Do not use native Proxy as it breaks debugging vscode
This commit is contained in:
@@ -94,14 +94,14 @@ export class ExtHostAPIImplementation {
|
||||
// Addressable instances
|
||||
const col = new InstanceCollection();
|
||||
|
||||
const extHostDocuments = col.define(ExtHostContext.ExtHostDocuments).set(new ExtHostDocuments(threadService));
|
||||
const extHostEditors = col.define(ExtHostContext.ExtHostEditors).set(new ExtHostEditors(threadService, extHostDocuments));
|
||||
const extHostCommands = col.define(ExtHostContext.ExtHostCommands).set(new ExtHostCommands(threadService, extHostEditors));
|
||||
const extHostConfiguration = col.define(ExtHostContext.ExtHostConfiguration).set(new ExtHostConfiguration());
|
||||
const extHostDiagnostics = col.define(ExtHostContext.ExtHostDiagnostics).set(new ExtHostDiagnostics(threadService));
|
||||
const languageFeatures = col.define(ExtHostContext.ExtHostLanguageFeatures).set(new ExtHostLanguageFeatures(threadService, extHostDocuments, extHostCommands, extHostDiagnostics));
|
||||
const extHostFileSystemEvent = col.define(ExtHostContext.ExtHostFileSystemEventService).set(new ExtHostFileSystemEventService());
|
||||
const extHostQuickOpen = col.define(ExtHostContext.ExtHostQuickOpen).set(new ExtHostQuickOpen(threadService));
|
||||
const extHostDocuments = col.define(ExtHostContext.ExtHostDocuments).set<ExtHostDocuments>(new ExtHostDocuments(threadService));
|
||||
const extHostEditors = col.define(ExtHostContext.ExtHostEditors).set<ExtHostEditors>(new ExtHostEditors(threadService, extHostDocuments));
|
||||
const extHostCommands = col.define(ExtHostContext.ExtHostCommands).set<ExtHostCommands>(new ExtHostCommands(threadService, extHostEditors));
|
||||
const extHostConfiguration = col.define(ExtHostContext.ExtHostConfiguration).set<ExtHostConfiguration>(new ExtHostConfiguration());
|
||||
const extHostDiagnostics = col.define(ExtHostContext.ExtHostDiagnostics).set<ExtHostDiagnostics>(new ExtHostDiagnostics(threadService));
|
||||
const languageFeatures = col.define(ExtHostContext.ExtHostLanguageFeatures).set<ExtHostLanguageFeatures>(new ExtHostLanguageFeatures(threadService, extHostDocuments, extHostCommands, extHostDiagnostics));
|
||||
const extHostFileSystemEvent = col.define(ExtHostContext.ExtHostFileSystemEventService).set<ExtHostFileSystemEventService>(new ExtHostFileSystemEventService());
|
||||
const extHostQuickOpen = col.define(ExtHostContext.ExtHostQuickOpen).set<ExtHostQuickOpen>(new ExtHostQuickOpen(threadService));
|
||||
col.define(ExtHostContext.ExtHostExtensionService).set(extensionService);
|
||||
|
||||
col.finish(false, threadService);
|
||||
|
||||
@@ -12,8 +12,7 @@ import {ExtHostEditors} from 'vs/workbench/api/node/extHostEditors';
|
||||
import * as extHostTypes from 'vs/workbench/api/node/extHostTypes';
|
||||
import * as extHostTypeConverter from 'vs/workbench/api/node/extHostTypeConverters';
|
||||
import {cloneAndChange} from 'vs/base/common/objects';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadCommands} from './mainThreadCommands';
|
||||
import {MainContext, MainThreadCommandsShape} from './extHostProtocol';
|
||||
|
||||
interface CommandHandler {
|
||||
callback: Function;
|
||||
@@ -24,7 +23,7 @@ interface CommandHandler {
|
||||
export class ExtHostCommands {
|
||||
|
||||
private _commands: { [n: string]: CommandHandler } = Object.create(null);
|
||||
private _proxy: MainThreadCommands;
|
||||
private _proxy: MainThreadCommandsShape;
|
||||
private _extHostEditors: ExtHostEditors;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -9,20 +9,19 @@ import {IMarkerData} from 'vs/platform/markers/common/markers';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import * as vscode from 'vscode';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadDiagnostics} from './mainThreadDiagnostics';
|
||||
import {MainContext, MainThreadDiagnosticsShape} from './extHostProtocol';
|
||||
|
||||
export class DiagnosticCollection implements vscode.DiagnosticCollection {
|
||||
|
||||
private static _maxDiagnosticsPerFile: number = 250;
|
||||
|
||||
private _name: string;
|
||||
private _proxy: MainThreadDiagnostics;
|
||||
private _proxy: MainThreadDiagnosticsShape;
|
||||
|
||||
private _isDisposed = false;
|
||||
private _data: {[uri:string]: vscode.Diagnostic[]} = Object.create(null);
|
||||
|
||||
constructor(name: string, proxy: MainThreadDiagnostics) {
|
||||
constructor(name: string, proxy: MainThreadDiagnosticsShape) {
|
||||
this._name = name;
|
||||
this._proxy = proxy;
|
||||
}
|
||||
@@ -180,7 +179,7 @@ export class ExtHostDiagnostics {
|
||||
|
||||
private static _idPool: number = 0;
|
||||
|
||||
private _proxy: MainThreadDiagnostics;
|
||||
private _proxy: MainThreadDiagnosticsShape;
|
||||
private _collections: DiagnosticCollection[];
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
|
||||
@@ -17,16 +17,7 @@ import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import * as vscode from 'vscode';
|
||||
import {asWinJsPromise} from 'vs/base/common/async';
|
||||
import {getWordAtText, ensureValidWordDefinition} from 'vs/editor/common/model/wordHelper';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadDocuments} from './mainThreadDocuments';
|
||||
|
||||
export interface IModelAddedData {
|
||||
url: URI;
|
||||
versionId: number;
|
||||
value: editorCommon.IRawText;
|
||||
modeId: string;
|
||||
isDirty: boolean;
|
||||
}
|
||||
import {MainContext, MainThreadDocumentsShape, IModelAddedData} from './extHostProtocol';
|
||||
|
||||
const _modeId2WordDefinition: {
|
||||
[modeId: string]: RegExp;
|
||||
@@ -60,7 +51,7 @@ export class ExtHostDocuments {
|
||||
private _documentLoader: { [modelUri: string]: TPromise<ExtHostDocumentData> };
|
||||
private _documentContentProviders: { [handle: number]: vscode.TextDocumentContentProvider; };
|
||||
|
||||
private _proxy: MainThreadDocuments;
|
||||
private _proxy: MainThreadDocumentsShape;
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
this._proxy = threadService.get(MainContext.MainThreadDocuments);
|
||||
@@ -229,13 +220,13 @@ export class ExtHostDocuments {
|
||||
|
||||
export class ExtHostDocumentData extends MirrorModel2 {
|
||||
|
||||
private _proxy: MainThreadDocuments;
|
||||
private _proxy: MainThreadDocumentsShape;
|
||||
private _languageId: string;
|
||||
private _isDirty: boolean;
|
||||
private _textLines: vscode.TextLine[];
|
||||
private _document: vscode.TextDocument;
|
||||
|
||||
constructor(proxy: MainThreadDocuments, uri: URI, lines: string[], eol: string,
|
||||
constructor(proxy: MainThreadDocumentsShape, uri: URI, lines: string[], eol: string,
|
||||
languageId: string, versionId: number, isDirty: boolean) {
|
||||
|
||||
super(uri, lines, eol, versionId);
|
||||
|
||||
@@ -13,24 +13,10 @@ import {IThreadService} from 'vs/workbench/services/thread/common/threadService'
|
||||
import {ExtHostDocuments, ExtHostDocumentData} from 'vs/workbench/api/node/extHostDocuments';
|
||||
import {Selection, Range, Position, EditorOptions, EndOfLine, TextEditorRevealType} from './extHostTypes';
|
||||
import {ISingleEditOperation, ISelection} from 'vs/editor/common/editorCommon';
|
||||
import {Position as EditorPosition} from 'vs/platform/editor/common/editor';
|
||||
import {IResolvedTextEditorConfiguration} from 'vs/workbench/api/node/mainThreadEditorsTracker';
|
||||
import * as TypeConverters from './extHostTypeConverters';
|
||||
import {TextDocument, TextEditorSelectionChangeEvent, TextEditorOptionsChangeEvent, TextEditorOptions, TextEditorViewColumnChangeEvent, ViewColumn} from 'vscode';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadEditors} from './mainThreadEditors';
|
||||
|
||||
export interface ITextEditorAddData {
|
||||
id: string;
|
||||
document: URI;
|
||||
options: IResolvedTextEditorConfiguration;
|
||||
selections: ISelection[];
|
||||
editorPosition: EditorPosition;
|
||||
}
|
||||
|
||||
export interface ITextEditorPositionData {
|
||||
[id: string]: EditorPosition;
|
||||
}
|
||||
import {MainContext, MainThreadEditorsShape, ITextEditorAddData, ITextEditorPositionData} from './extHostProtocol';
|
||||
|
||||
export class ExtHostEditors {
|
||||
|
||||
@@ -44,7 +30,7 @@ export class ExtHostEditors {
|
||||
private _onDidChangeTextEditorViewColumn: Emitter<TextEditorViewColumnChangeEvent>;
|
||||
|
||||
private _editors: { [id: string]: ExtHostTextEditor };
|
||||
private _proxy: MainThreadEditors;
|
||||
private _proxy: MainThreadEditorsShape;
|
||||
private _onDidChangeActiveTextEditor: Emitter<vscode.TextEditor>;
|
||||
private _extHostDocuments: ExtHostDocuments;
|
||||
private _activeEditorId: string;
|
||||
@@ -168,10 +154,10 @@ class TextEditorDecorationType implements vscode.TextEditorDecorationType {
|
||||
|
||||
private static _Keys = new IdGenerator('TextEditorDecorationType');
|
||||
|
||||
private _proxy: MainThreadEditors;
|
||||
private _proxy: MainThreadEditorsShape;
|
||||
public key: string;
|
||||
|
||||
constructor(proxy: MainThreadEditors, options: vscode.DecorationRenderOptions) {
|
||||
constructor(proxy: MainThreadEditorsShape, options: vscode.DecorationRenderOptions) {
|
||||
this.key = TextEditorDecorationType._Keys.nextId();
|
||||
this._proxy = proxy;
|
||||
this._proxy._registerTextEditorDecorationType(this.key, <any>options);
|
||||
@@ -284,7 +270,7 @@ function deprecated(name: string, message: string = 'Refer to the documentation
|
||||
|
||||
class ExtHostTextEditor implements vscode.TextEditor {
|
||||
|
||||
private _proxy: MainThreadEditors;
|
||||
private _proxy: MainThreadEditorsShape;
|
||||
private _id: string;
|
||||
|
||||
private _documentData: ExtHostDocumentData;
|
||||
@@ -292,7 +278,7 @@ class ExtHostTextEditor implements vscode.TextEditor {
|
||||
private _options: TextEditorOptions;
|
||||
private _viewColumn: vscode.ViewColumn;
|
||||
|
||||
constructor(proxy: MainThreadEditors, id: string, document: ExtHostDocumentData, selections: Selection[], options: EditorOptions, viewColumn: vscode.ViewColumn) {
|
||||
constructor(proxy: MainThreadEditorsShape, id: string, document: ExtHostDocumentData, selections: Selection[], options: EditorOptions, viewColumn: vscode.ViewColumn) {
|
||||
this._proxy = proxy;
|
||||
this._id = id;
|
||||
this._documentData = document;
|
||||
|
||||
@@ -15,8 +15,7 @@ import {ExtensionsRegistry} from 'vs/platform/extensions/common/extensionsRegist
|
||||
import {ExtHostStorage} from 'vs/workbench/api/node/extHostStorage';
|
||||
import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainProcessExtensionService} from './mainThreadExtensionService';
|
||||
import {MainContext, MainProcessExtensionServiceShape} from './extHostProtocol';
|
||||
|
||||
const hasOwnProperty = Object.hasOwnProperty;
|
||||
|
||||
@@ -113,7 +112,7 @@ export class ExtHostExtensionService extends AbstractExtensionService<ExtHostExt
|
||||
|
||||
private _threadService: IThreadService;
|
||||
private _storage: ExtHostStorage;
|
||||
private _proxy: MainProcessExtensionService;
|
||||
private _proxy: MainProcessExtensionServiceShape;
|
||||
private _telemetryService: ITelemetryService;
|
||||
private _workspaceStoragePath: string;
|
||||
|
||||
|
||||
@@ -6,15 +6,9 @@
|
||||
|
||||
import Event, {Emitter} from 'vs/base/common/event';
|
||||
import {Disposable} from './extHostTypes';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import {match} from 'vs/base/common/glob';
|
||||
import {Uri, FileSystemWatcher as _FileSystemWatcher} from 'vscode';
|
||||
|
||||
export interface FileSystemEvents {
|
||||
created: URI[];
|
||||
changed: URI[];
|
||||
deleted: URI[];
|
||||
}
|
||||
import {FileSystemEvents} from './extHostProtocol';
|
||||
|
||||
export class FileSystemWatcher implements _FileSystemWatcher {
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@ import {ExtHostCommands} from 'vs/workbench/api/node/extHostCommands';
|
||||
import {ExtHostDiagnostics} from 'vs/workbench/api/node/extHostDiagnostics';
|
||||
import {INavigateTypesSupport, ITypeBearing} from 'vs/workbench/parts/search/common/search';
|
||||
import {asWinJsPromise, ShallowCancelThenPromise} from 'vs/base/common/async';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadLanguageFeatures} from './mainThreadLanguageFeatures';
|
||||
import {MainContext, MainThreadLanguageFeaturesShape} from './extHostProtocol';
|
||||
import {regExpLeadsToEndlessLoop} from 'vs/base/common/strings';
|
||||
|
||||
// --- adapter
|
||||
@@ -598,7 +597,7 @@ export class ExtHostLanguageFeatures {
|
||||
|
||||
private static _handlePool: number = 0;
|
||||
|
||||
private _proxy: MainThreadLanguageFeatures;
|
||||
private _proxy: MainThreadLanguageFeaturesShape;
|
||||
private _documents: ExtHostDocuments;
|
||||
private _commands: ExtHostCommands;
|
||||
private _diagnostics: ExtHostDiagnostics;
|
||||
|
||||
@@ -6,12 +6,11 @@
|
||||
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadLanguages} from './mainThreadLanguages';
|
||||
import {MainContext, MainThreadLanguagesShape} from './extHostProtocol';
|
||||
|
||||
export class ExtHostLanguages {
|
||||
|
||||
private _proxy: MainThreadLanguages;
|
||||
private _proxy: MainThreadLanguagesShape;
|
||||
|
||||
constructor(
|
||||
threadService: IThreadService
|
||||
|
||||
@@ -7,12 +7,11 @@
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import vscode = require('vscode');
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadMessageService} from './mainThreadMessageService';
|
||||
import {MainContext, MainThreadMessageServiceShape} from './extHostProtocol';
|
||||
|
||||
export class ExtHostMessageService {
|
||||
|
||||
private _proxy: MainThreadMessageService;
|
||||
private _proxy: MainThreadMessageServiceShape;
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
this._proxy = threadService.get(MainContext.MainThreadMessageService);
|
||||
|
||||
@@ -5,19 +5,18 @@
|
||||
'use strict';
|
||||
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadOutputService} from './mainThreadOutputService';
|
||||
import {MainContext, MainThreadOutputServiceShape} from './extHostProtocol';
|
||||
|
||||
export class ExtHostOutputChannel implements vscode.OutputChannel {
|
||||
|
||||
private static _idPool = 1;
|
||||
|
||||
private _proxy: MainThreadOutputService;
|
||||
private _proxy: MainThreadOutputServiceShape;
|
||||
private _name: string;
|
||||
private _id: string;
|
||||
private _disposed: boolean;
|
||||
|
||||
constructor(name: string, proxy: MainThreadOutputService) {
|
||||
constructor(name: string, proxy: MainThreadOutputServiceShape) {
|
||||
this._name = name;
|
||||
this._id = 'extension-output-#' + (ExtHostOutputChannel._idPool++);
|
||||
this._proxy = proxy;
|
||||
@@ -62,7 +61,7 @@ export class ExtHostOutputChannel implements vscode.OutputChannel {
|
||||
|
||||
export class ExtHostOutputService {
|
||||
|
||||
private _proxy: MainThreadOutputService;
|
||||
private _proxy: MainThreadOutputServiceShape;
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
this._proxy = threadService.get(MainContext.MainThreadOutputService);
|
||||
|
||||
@@ -7,72 +7,33 @@
|
||||
import {
|
||||
createMainContextProxyIdentifier as createMainId,
|
||||
createExtHostContextProxyIdentifier as createExtId,
|
||||
ProxyIdentifier, IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
ProxyIdentifier, IThreadService
|
||||
} from 'vs/workbench/services/thread/common/threadService';
|
||||
|
||||
// --- main thread addressable
|
||||
import {MainThreadCommands} from './mainThreadCommands';
|
||||
import {MainThreadConfiguration} from './mainThreadConfiguration';
|
||||
import {MainThreadDiagnostics} from './mainThreadDiagnostics';
|
||||
import {MainThreadDocuments} from './mainThreadDocuments';
|
||||
import {MainThreadEditors} from './mainThreadEditors';
|
||||
import {MainThreadErrors} from './mainThreadErrors';
|
||||
import {MainThreadLanguageFeatures} from './mainThreadLanguageFeatures';
|
||||
import {MainThreadLanguages} from './mainThreadLanguages';
|
||||
import {MainThreadMessageService} from './mainThreadMessageService';
|
||||
import {MainThreadOutputService} from './mainThreadOutputService';
|
||||
import {MainThreadQuickOpen} from './mainThreadQuickOpen';
|
||||
import {MainThreadStatusBar} from './mainThreadStatusBar';
|
||||
import {MainThreadStorage} from './mainThreadStorage';
|
||||
import {MainThreadTelemetry} from './mainThreadTelemetry';
|
||||
import {MainThreadWorkspace} from './mainThreadWorkspace';
|
||||
import {MainProcessExtensionService} from './mainThreadExtensionService';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
// --- ext host addressable
|
||||
import {ExtHostCommands} from './extHostCommands';
|
||||
import {ExtHostConfiguration} from './extHostConfiguration';
|
||||
import {ExtHostDiagnostics} from './extHostDiagnostics';
|
||||
import {ExtHostDocuments} from './extHostDocuments';
|
||||
import {ExtHostEditors} from './extHostEditors';
|
||||
import {ExtHostFileSystemEventService} from './extHostFileSystemEventService';
|
||||
import {ExtHostLanguageFeatures} from './extHostLanguageFeatures';
|
||||
import {ExtHostQuickOpen} from './extHostQuickOpen';
|
||||
import {ExtHostExtensionService} from './extHostExtensionService';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
|
||||
let mainCounter = 0;
|
||||
export const MainContext = {
|
||||
MainThreadCommands: createMainId<MainThreadCommands>(++mainCounter),
|
||||
MainThreadConfiguration: createMainId<MainThreadConfiguration>(++mainCounter),
|
||||
MainThreadDiagnostics: createMainId<MainThreadDiagnostics>(++mainCounter),
|
||||
MainThreadDocuments: createMainId<MainThreadDocuments>(++mainCounter),
|
||||
MainThreadEditors: createMainId<MainThreadEditors>(++mainCounter),
|
||||
MainThreadErrors: createMainId<MainThreadErrors>(++mainCounter),
|
||||
MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeatures>(++mainCounter),
|
||||
MainThreadLanguages: createMainId<MainThreadLanguages>(++mainCounter),
|
||||
MainThreadMessageService: createMainId<MainThreadMessageService>(++mainCounter),
|
||||
MainThreadOutputService: createMainId<MainThreadOutputService>(++mainCounter),
|
||||
MainThreadQuickOpen: createMainId<MainThreadQuickOpen>(++mainCounter),
|
||||
MainThreadStatusBar: createMainId<MainThreadStatusBar>(++mainCounter),
|
||||
MainThreadStorage: createMainId<MainThreadStorage>(++mainCounter),
|
||||
MainThreadTelemetry: createMainId<MainThreadTelemetry>(++mainCounter),
|
||||
MainThreadWorkspace: createMainId<MainThreadWorkspace>(++mainCounter),
|
||||
MainProcessExtensionService: createMainId<MainProcessExtensionService>(++mainCounter),
|
||||
};
|
||||
import {IMarkerData} from 'vs/platform/markers/common/markers';
|
||||
import {Position as EditorPosition} from 'vs/platform/editor/common/editor';
|
||||
import {IMessage, IExtensionDescription} from 'vs/platform/extensions/common/extensions';
|
||||
import {StatusbarAlignment as MainThreadStatusBarAlignment} from 'vs/platform/statusbar/common/statusbar';
|
||||
import {ITelemetryInfo} from 'vs/platform/telemetry/common/telemetry';
|
||||
import {ICommandHandlerDescription} from 'vs/platform/keybinding/common/keybindingService';
|
||||
|
||||
let extCounter = 0;
|
||||
export const ExtHostContext = {
|
||||
ExtHostCommands: createExtId<ExtHostCommands>(++extCounter),
|
||||
ExtHostConfiguration: createExtId<ExtHostConfiguration>(++extCounter),
|
||||
ExtHostDiagnostics: createExtId<ExtHostDiagnostics>(++extCounter),
|
||||
ExtHostDocuments: createExtId<ExtHostDocuments>(++extCounter),
|
||||
ExtHostEditors: createExtId<ExtHostEditors>(++extCounter),
|
||||
ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventService>(++extCounter),
|
||||
ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeatures>(++extCounter),
|
||||
ExtHostQuickOpen: createExtId<ExtHostQuickOpen>(++extCounter),
|
||||
ExtHostExtensionService: createExtId<ExtHostExtensionService>(++extCounter),
|
||||
};
|
||||
import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
import * as modes from 'vs/editor/common/modes';
|
||||
import {IResourceEdit} from 'vs/editor/common/services/bulkEdit';
|
||||
|
||||
import {IPickOpenEntry, IPickOptions} from 'vs/workbench/services/quickopen/common/quickOpenService';
|
||||
import {ITypeBearing} from 'vs/workbench/parts/search/common/search';
|
||||
import {TextEditorRevealType, ITextEditorConfigurationUpdate, IResolvedTextEditorConfiguration} from './mainThreadEditorsTracker';
|
||||
import {EndOfLine} from './extHostTypes';
|
||||
|
||||
export interface InstanceSetter<T> {
|
||||
set(instance:T): T;
|
||||
set<R extends T>(instance:T): R;
|
||||
}
|
||||
|
||||
export class InstanceCollection {
|
||||
@@ -109,3 +70,242 @@ export class InstanceCollection {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function ni() { return new Error('Not implemented'); }
|
||||
|
||||
// --- main thread
|
||||
|
||||
export abstract class MainThreadCommandsShape {
|
||||
$registerCommand(id: string): TPromise<any> { throw ni(); }
|
||||
$executeCommand<T>(id: string, args: any[]): Thenable<T> { throw ni(); }
|
||||
$getCommands(): Thenable<string[]> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadConfigurationShape {
|
||||
}
|
||||
|
||||
export abstract class MainThreadDiagnosticsShape {
|
||||
$changeMany(owner: string, entries: [URI, IMarkerData[]][]): TPromise<any> { throw ni(); }
|
||||
$clear(owner: string): TPromise<any> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadDocumentsShape {
|
||||
_tryOpenDocument(uri: URI): TPromise<any> { throw ni(); }
|
||||
$registerTextContentProvider(handle:number, scheme: string): void { throw ni(); }
|
||||
$onVirtualDocumentChange(uri: URI, value: string): void { throw ni(); }
|
||||
$unregisterTextContentProvider(handle: number): void { throw ni(); }
|
||||
_trySaveDocument(uri: URI): TPromise<boolean> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadEditorsShape {
|
||||
_tryShowTextDocument(resource: URI, position: EditorPosition, preserveFocus: boolean): TPromise<string> { throw ni(); }
|
||||
_registerTextEditorDecorationType(key: string, options: editorCommon.IDecorationRenderOptions): void { throw ni(); }
|
||||
_removeTextEditorDecorationType(key: string): void { throw ni(); }
|
||||
_tryShowEditor(id: string, position: EditorPosition): TPromise<void> { throw ni(); }
|
||||
_tryHideEditor(id: string): TPromise<void> { throw ni(); }
|
||||
_trySetOptions(id: string, options: ITextEditorConfigurationUpdate): TPromise<any> { throw ni(); }
|
||||
_trySetDecorations(id: string, key: string, ranges: editorCommon.IDecorationOptions[]): TPromise<any> { throw ni(); }
|
||||
_tryRevealRange(id: string, range: editorCommon.IRange, revealType: TextEditorRevealType): TPromise<any> { throw ni(); }
|
||||
_trySetSelections(id: string, selections: editorCommon.ISelection[]): TPromise<any> { throw ni(); }
|
||||
_tryApplyEdits(id: string, modelVersionId: number, edits: editorCommon.ISingleEditOperation[], setEndOfLine:EndOfLine): TPromise<boolean> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadErrorsShape {
|
||||
onUnexpectedExtHostError(err: any): void { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadLanguageFeaturesShape {
|
||||
$unregister(handle: number): TPromise<any> { throw ni(); }
|
||||
$registerOutlineSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
|
||||
$registerCodeLensSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
|
||||
$registerDeclaractionSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
|
||||
$registerHoverProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
|
||||
$registerDocumentHighlightProvider(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
|
||||
$registerReferenceSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
|
||||
$registerQuickFixSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
|
||||
$registerDocumentFormattingSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
|
||||
$registerRangeFormattingSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
|
||||
$registerOnTypeFormattingSupport(handle: number, selector: vscode.DocumentSelector, autoFormatTriggerCharacters: string[]): TPromise<any> { throw ni(); }
|
||||
$registerNavigateTypeSupport(handle: number): TPromise<any> { throw ni(); }
|
||||
$registerRenameSupport(handle: number, selector: vscode.DocumentSelector): TPromise<any> { throw ni(); }
|
||||
$registerSuggestSupport(handle: number, selector: vscode.DocumentSelector, triggerCharacters: string[]): TPromise<any> { throw ni(); }
|
||||
$registerSignatureHelpProvider(handle: number, selector: vscode.DocumentSelector, triggerCharacter: string[]): TPromise<any> { throw ni(); }
|
||||
$setLanguageConfiguration(handle: number, languageId:string, configuration: vscode.LanguageConfiguration): TPromise<any> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadLanguagesShape {
|
||||
_getLanguages(): TPromise<string[]> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadMessageServiceShape {
|
||||
$showMessage(severity: Severity, message: string, commands: { title: string; isCloseAffordance: boolean; handle: number; }[]): Thenable<number> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadOutputServiceShape {
|
||||
append(channelId: string, label: string, value: string): TPromise<void> { throw ni(); }
|
||||
clear(channelId: string, label: string): TPromise<void> { throw ni(); }
|
||||
reveal(channelId: string, label: string, preserveFocus: boolean): TPromise<void> { throw ni(); }
|
||||
close(channelId: string): TPromise<void> { throw ni(); }
|
||||
}
|
||||
|
||||
export interface MyQuickPickItems extends IPickOpenEntry {
|
||||
handle: number;
|
||||
}
|
||||
export abstract class MainThreadQuickOpenShape {
|
||||
$show(options: IPickOptions): Thenable<number> { throw ni(); }
|
||||
$setItems(items: MyQuickPickItems[]): Thenable<any> { throw ni(); }
|
||||
$setError(error: Error): Thenable<any> { throw ni(); }
|
||||
$input(options: vscode.InputBoxOptions, validateInput: boolean): Thenable<string> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadStatusBarShape {
|
||||
setEntry(id: number, text: string, tooltip: string, command: string, color: string, alignment: MainThreadStatusBarAlignment, priority: number): void { throw ni(); }
|
||||
dispose(id: number) { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadStorageShape {
|
||||
getValue<T>(shared: boolean, key: string): TPromise<T> { throw ni(); }
|
||||
setValue(shared: boolean, key: string, value: any): TPromise<any> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadTelemetryShape {
|
||||
$publicLog(eventName: string, data?: any): void { throw ni(); }
|
||||
$getTelemetryInfo(): TPromise<ITelemetryInfo> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadWorkspaceShape {
|
||||
$startSearch(include: string, exclude: string, maxResults: number, requestId: number): Thenable<URI[]> { throw ni(); }
|
||||
$cancelSearch(requestId: number): Thenable<boolean> { throw ni(); }
|
||||
$saveAll(includeUntitled?: boolean): Thenable<boolean> { throw ni(); }
|
||||
$applyWorkspaceEdit(edits: IResourceEdit[]): TPromise<boolean> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainProcessExtensionServiceShape {
|
||||
public $onExtensionHostReady(extensionDescriptions: IExtensionDescription[], messages: IMessage[]): TPromise<void> { throw ni(); }
|
||||
public $localShowMessage(severity: Severity, msg: string): void { throw ni(); }
|
||||
public $onExtensionActivated(extensionId: string): void { throw ni(); }
|
||||
public $onExtensionActivationFailed(extensionId: string): void { throw ni(); }
|
||||
}
|
||||
|
||||
// -- extension host
|
||||
|
||||
export abstract class ExtHostCommandsShape {
|
||||
$executeContributedCommand<T>(id: string, ...args: any[]): Thenable<T> { throw ni(); }
|
||||
$getContributedCommandHandlerDescriptions(): TPromise<{ [id: string]: string | ICommandHandlerDescription }> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class ExtHostConfigurationShape {
|
||||
$acceptConfigurationChanged(config: any) { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class ExtHostDiagnosticsShape {
|
||||
|
||||
}
|
||||
|
||||
export interface IModelAddedData {
|
||||
url: URI;
|
||||
versionId: number;
|
||||
value: editorCommon.IRawText;
|
||||
modeId: string;
|
||||
isDirty: boolean;
|
||||
}
|
||||
export abstract class ExtHostDocumentsShape {
|
||||
$provideTextDocumentContent(handle: number, uri: URI): TPromise<string> { throw ni(); }
|
||||
_acceptModelAdd(initData: IModelAddedData): void { throw ni(); }
|
||||
_acceptModelModeChanged(strURL: string, oldModeId: string, newModeId: string): void { throw ni(); }
|
||||
_acceptModelSaved(strURL: string): void { throw ni(); }
|
||||
_acceptModelDirty(strURL: string): void { throw ni(); }
|
||||
_acceptModelReverted(strURL: string): void { throw ni(); }
|
||||
_acceptModelRemoved(strURL: string): void { throw ni(); }
|
||||
_acceptModelChanged(strURL: string, events: editorCommon.IModelContentChangedEvent2[]): void { throw ni(); }
|
||||
}
|
||||
|
||||
export interface ITextEditorAddData {
|
||||
id: string;
|
||||
document: URI;
|
||||
options: IResolvedTextEditorConfiguration;
|
||||
selections: editorCommon.ISelection[];
|
||||
editorPosition: EditorPosition;
|
||||
}
|
||||
export interface ITextEditorPositionData {
|
||||
[id: string]: EditorPosition;
|
||||
}
|
||||
export abstract class ExtHostEditorsShape {
|
||||
_acceptTextEditorAdd(data: ITextEditorAddData): void { throw ni(); }
|
||||
_acceptOptionsChanged(id: string, opts: IResolvedTextEditorConfiguration): void { throw ni(); }
|
||||
_acceptSelectionsChanged(id: string, _selections: editorCommon.ISelection[]): void { throw ni(); }
|
||||
_acceptActiveEditorAndVisibleEditors(id: string, visibleIds: string[]): void { throw ni(); }
|
||||
_acceptEditorPositionData(data: ITextEditorPositionData): void { throw ni(); }
|
||||
_acceptTextEditorRemove(id: string): void { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class ExtHostExtensionServiceShape {
|
||||
$localShowMessage(severity: Severity, msg: string): void { throw ni(); }
|
||||
$activateExtension(extensionDescription: IExtensionDescription): TPromise<void> { throw ni(); }
|
||||
}
|
||||
|
||||
export interface FileSystemEvents {
|
||||
created: URI[];
|
||||
changed: URI[];
|
||||
deleted: URI[];
|
||||
}
|
||||
export abstract class ExtHostFileSystemEventServiceShape {
|
||||
_onFileEvent(events: FileSystemEvents) { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class ExtHostLanguageFeaturesShape {
|
||||
$provideDocumentSymbols(handle: number, resource: URI): TPromise<modes.SymbolInformation[]> { throw ni(); }
|
||||
$provideCodeLenses(handle: number, resource: URI): TPromise<modes.ICodeLensSymbol[]> { throw ni(); }
|
||||
$resolveCodeLens(handle: number, resource: URI, symbol: modes.ICodeLensSymbol): TPromise<modes.ICodeLensSymbol> { throw ni(); }
|
||||
$provideDefinition(handle: number, resource: URI, position: editorCommon.IPosition): TPromise<modes.Definition> { throw ni(); }
|
||||
$provideHover(handle: number, resource: URI, position: editorCommon.IPosition): TPromise<modes.Hover> { throw ni(); }
|
||||
$provideDocumentHighlights(handle: number, resource: URI, position: editorCommon.IPosition): TPromise<modes.DocumentHighlight[]> { throw ni(); }
|
||||
$provideReferences(handle: number, resource: URI, position: editorCommon.IPosition, context: modes.ReferenceContext): TPromise<modes.Location[]> { throw ni(); }
|
||||
$provideCodeActions(handle: number, resource: URI, range: editorCommon.IRange): TPromise<modes.CodeAction[]> { throw ni(); }
|
||||
$provideDocumentFormattingEdits(handle: number, resource: URI, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
|
||||
$provideDocumentRangeFormattingEdits(handle: number, resource: URI, range: editorCommon.IRange, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
|
||||
$provideOnTypeFormattingEdits(handle: number, resource: URI, position: editorCommon.IPosition, ch: string, options: modes.FormattingOptions): TPromise<editorCommon.ISingleEditOperation[]> { throw ni(); }
|
||||
$getNavigateToItems(handle: number, search: string): TPromise<ITypeBearing[]> { throw ni(); }
|
||||
$provideRenameEdits(handle: number, resource: URI, position: editorCommon.IPosition, newName: string): TPromise<modes.WorkspaceEdit> { throw ni(); }
|
||||
$provideCompletionItems(handle: number, resource: URI, position: editorCommon.IPosition): TPromise<modes.ISuggestResult[]> { throw ni(); }
|
||||
$resolveCompletionItem(handle: number, resource: URI, position: editorCommon.IPosition, suggestion: modes.ISuggestion): TPromise<modes.ISuggestion> { throw ni(); }
|
||||
$provideSignatureHelp(handle: number, resource: URI, position: editorCommon.IPosition): TPromise<modes.SignatureHelp> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class ExtHostQuickOpenShape {
|
||||
$onItemSelected(handle: number): void { throw ni(); }
|
||||
$validateInput(input: string): TPromise<string> { throw ni(); }
|
||||
}
|
||||
|
||||
// --- proxy identifiers
|
||||
|
||||
export const MainContext = {
|
||||
MainThreadCommands: createMainId<MainThreadCommandsShape>('MainThreadCommands', MainThreadCommandsShape),
|
||||
MainThreadConfiguration: createMainId<MainThreadConfigurationShape>('MainThreadConfiguration', MainThreadConfigurationShape),
|
||||
MainThreadDiagnostics: createMainId<MainThreadDiagnosticsShape>('MainThreadDiagnostics', MainThreadDiagnosticsShape),
|
||||
MainThreadDocuments: createMainId<MainThreadDocumentsShape>('MainThreadDocuments', MainThreadDocumentsShape),
|
||||
MainThreadEditors: createMainId<MainThreadEditorsShape>('MainThreadEditors', MainThreadEditorsShape),
|
||||
MainThreadErrors: createMainId<MainThreadErrorsShape>('MainThreadErrors', MainThreadErrorsShape),
|
||||
MainThreadLanguageFeatures: createMainId<MainThreadLanguageFeaturesShape>('MainThreadLanguageFeatures', MainThreadLanguageFeaturesShape),
|
||||
MainThreadLanguages: createMainId<MainThreadLanguagesShape>('MainThreadLanguages', MainThreadLanguagesShape),
|
||||
MainThreadMessageService: createMainId<MainThreadMessageServiceShape>('MainThreadMessageService', MainThreadMessageServiceShape),
|
||||
MainThreadOutputService: createMainId<MainThreadOutputServiceShape>('MainThreadOutputService', MainThreadOutputServiceShape),
|
||||
MainThreadQuickOpen: createMainId<MainThreadQuickOpenShape>('MainThreadQuickOpen', MainThreadQuickOpenShape),
|
||||
MainThreadStatusBar: createMainId<MainThreadStatusBarShape>('MainThreadStatusBar', MainThreadStatusBarShape),
|
||||
MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage', MainThreadStorageShape),
|
||||
MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry', MainThreadTelemetryShape),
|
||||
MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace', MainThreadWorkspaceShape),
|
||||
MainProcessExtensionService: createMainId<MainProcessExtensionServiceShape>('MainProcessExtensionService', MainProcessExtensionServiceShape),
|
||||
};
|
||||
|
||||
export const ExtHostContext = {
|
||||
ExtHostCommands: createExtId<ExtHostCommandsShape>('ExtHostCommands', ExtHostCommandsShape),
|
||||
ExtHostConfiguration: createExtId<ExtHostConfigurationShape>('ExtHostConfiguration', ExtHostConfigurationShape),
|
||||
ExtHostDiagnostics: createExtId<ExtHostDiagnosticsShape>('ExtHostDiagnostics', ExtHostDiagnosticsShape),
|
||||
ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments', ExtHostDocumentsShape),
|
||||
ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors', ExtHostEditorsShape),
|
||||
ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService', ExtHostFileSystemEventServiceShape),
|
||||
ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures', ExtHostLanguageFeaturesShape),
|
||||
ExtHostQuickOpen: createExtId<ExtHostQuickOpenShape>('ExtHostQuickOpen', ExtHostQuickOpenShape),
|
||||
ExtHostExtensionService: createExtId<ExtHostExtensionServiceShape>('ExtHostExtensionService', ExtHostExtensionServiceShape),
|
||||
};
|
||||
|
||||
@@ -6,20 +6,14 @@
|
||||
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {IPickOpenEntry} from 'vs/workbench/services/quickopen/common/quickOpenService';
|
||||
import {QuickPickOptions, QuickPickItem, InputBoxOptions} from 'vscode';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadQuickOpen} from './mainThreadQuickOpen';
|
||||
|
||||
export interface MyQuickPickItems extends IPickOpenEntry {
|
||||
handle: number;
|
||||
}
|
||||
import {MainContext, MainThreadQuickOpenShape, MyQuickPickItems} from './extHostProtocol';
|
||||
|
||||
export type Item = string | QuickPickItem;
|
||||
|
||||
export class ExtHostQuickOpen {
|
||||
|
||||
private _proxy: MainThreadQuickOpen;
|
||||
private _proxy: MainThreadQuickOpenShape;
|
||||
private _onDidSelectItem: (handle: number) => void;
|
||||
private _validateInput: (input: string) => string;
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@ import {IThreadService} from 'vs/workbench/services/thread/common/threadService'
|
||||
import {StatusbarAlignment as MainThreadStatusBarAlignment} from 'vs/platform/statusbar/common/statusbar';
|
||||
import {StatusBarAlignment as ExtHostStatusBarAlignment, Disposable} from './extHostTypes';
|
||||
import {StatusBarItem, StatusBarAlignment} from 'vscode';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadStatusBar} from './mainThreadStatusBar';
|
||||
import {MainContext, MainThreadStatusBarShape} from './extHostProtocol';
|
||||
|
||||
export class ExtHostStatusBarEntry implements StatusBarItem {
|
||||
private static ID_GEN = 0;
|
||||
@@ -26,9 +25,9 @@ export class ExtHostStatusBarEntry implements StatusBarItem {
|
||||
private _command: string;
|
||||
|
||||
private _timeoutHandle: number;
|
||||
private _proxy: MainThreadStatusBar;
|
||||
private _proxy: MainThreadStatusBarShape;
|
||||
|
||||
constructor(proxy: MainThreadStatusBar, alignment: ExtHostStatusBarAlignment = ExtHostStatusBarAlignment.Left, priority?: number) {
|
||||
constructor(proxy: MainThreadStatusBarShape, alignment: ExtHostStatusBarAlignment = ExtHostStatusBarAlignment.Left, priority?: number) {
|
||||
this._id = ExtHostStatusBarEntry.ID_GEN++;
|
||||
this._proxy = proxy;
|
||||
this._alignment = alignment;
|
||||
@@ -159,7 +158,7 @@ class StatusBarMessage {
|
||||
|
||||
export class ExtHostStatusBar {
|
||||
|
||||
private _proxy: MainThreadStatusBar;
|
||||
private _proxy: MainThreadStatusBarShape;
|
||||
private _statusMessage: StatusBarMessage;
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
|
||||
@@ -6,12 +6,11 @@
|
||||
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadStorage} from './mainThreadStorage';
|
||||
import {MainContext, MainThreadStorageShape} from './extHostProtocol';
|
||||
|
||||
export class ExtHostStorage {
|
||||
|
||||
private _proxy: MainThreadStorage;
|
||||
private _proxy: MainThreadStorageShape;
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
this._proxy = threadService.get(MainContext.MainThreadStorage);
|
||||
|
||||
@@ -8,15 +8,14 @@ import {notImplemented} from 'vs/base/common/errors';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {ITelemetryService, ITelemetryInfo} from 'vs/platform/telemetry/common/telemetry';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadTelemetry} from './mainThreadTelemetry';
|
||||
import {MainContext, MainThreadTelemetryShape} from './extHostProtocol';
|
||||
|
||||
export class RemoteTelemetryService implements ITelemetryService {
|
||||
|
||||
serviceId: any;
|
||||
|
||||
private _name: string;
|
||||
private _proxy: MainThreadTelemetry;
|
||||
private _proxy: MainThreadTelemetryShape;
|
||||
|
||||
constructor(name: string, threadService: IThreadService) {
|
||||
this._name = name;
|
||||
|
||||
@@ -10,14 +10,13 @@ import {IResourceEdit} from 'vs/editor/common/services/bulkEdit';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {fromRange} from 'vs/workbench/api/node/extHostTypeConverters';
|
||||
import {Uri, CancellationToken} from 'vscode';
|
||||
import {MainContext} from './extHostProtocol';
|
||||
import {MainThreadWorkspace} from './mainThreadWorkspace';
|
||||
import {MainContext, MainThreadWorkspaceShape} from './extHostProtocol';
|
||||
|
||||
export class ExtHostWorkspace {
|
||||
|
||||
private static _requestIdPool = 0;
|
||||
|
||||
private _proxy: MainThreadWorkspace;
|
||||
private _proxy: MainThreadWorkspaceShape;
|
||||
private _workspacePath: string;
|
||||
|
||||
constructor(threadService: IThreadService, workspacePath:string) {
|
||||
|
||||
@@ -8,14 +8,13 @@ import {IThreadService} from 'vs/workbench/services/thread/common/threadService'
|
||||
import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import {IKeybindingService, ICommandHandlerDescription} from 'vs/platform/keybinding/common/keybindingService';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {ExtHostContext} from './extHostProtocol';
|
||||
import {ExtHostCommands} from './extHostCommands';
|
||||
import {ExtHostContext, ExtHostCommandsShape} from './extHostProtocol';
|
||||
|
||||
export class MainThreadCommands {
|
||||
|
||||
private _threadService: IThreadService;
|
||||
private _keybindingService: IKeybindingService;
|
||||
private _proxy: ExtHostCommands;
|
||||
private _proxy: ExtHostCommandsShape;
|
||||
|
||||
constructor(
|
||||
@IThreadService threadService: IThreadService,
|
||||
|
||||
@@ -7,17 +7,18 @@
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {IConfigurationService} from 'vs/platform/configuration/common/configuration';
|
||||
import {ExtHostContext} from './extHostProtocol';
|
||||
import {ExtHostConfiguration} from './extHostConfiguration';
|
||||
import {ExtHostContext, ExtHostConfigurationShape} from './extHostProtocol';
|
||||
|
||||
export class MainThreadConfiguration {
|
||||
|
||||
private _configurationService: IConfigurationService;
|
||||
private _toDispose: IDisposable;
|
||||
private _proxy: ExtHostConfiguration;
|
||||
private _proxy: ExtHostConfigurationShape;
|
||||
|
||||
constructor(@IConfigurationService configurationService: IConfigurationService,
|
||||
@IThreadService threadService: IThreadService) {
|
||||
constructor(
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IThreadService threadService: IThreadService
|
||||
) {
|
||||
|
||||
this._configurationService = configurationService;
|
||||
this._proxy = threadService.get(ExtHostContext.ExtHostConfiguration);
|
||||
|
||||
@@ -19,8 +19,7 @@ import {IFileService} from 'vs/platform/files/common/files';
|
||||
import {IModeService} from 'vs/editor/common/services/modeService';
|
||||
import {IUntitledEditorService} from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import {ResourceEditorInput} from 'vs/workbench/common/editor/resourceEditorInput';
|
||||
import {ExtHostContext} from './extHostProtocol';
|
||||
import {ExtHostDocuments} from './extHostDocuments';
|
||||
import {ExtHostContext, ExtHostDocumentsShape} from './extHostProtocol';
|
||||
|
||||
export class MainThreadDocuments {
|
||||
private _modelService: IModelService;
|
||||
@@ -31,7 +30,7 @@ export class MainThreadDocuments {
|
||||
private _untitledEditorService: IUntitledEditorService;
|
||||
private _toDispose: IDisposable[];
|
||||
private _modelToDisposeMap: { [modelUrl: string]: IDisposable; };
|
||||
private _proxy: ExtHostDocuments;
|
||||
private _proxy: ExtHostDocumentsShape;
|
||||
private _modelIsSynced: { [modelId: string]: boolean; };
|
||||
private _resourceContentProvider: { [handle: number]: IDisposable };
|
||||
private _virtualDocumentSet: { [resource: string]: boolean };
|
||||
|
||||
@@ -20,12 +20,11 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
|
||||
import {IEventService} from 'vs/platform/event/common/event';
|
||||
import {equals as arrayEquals} from 'vs/base/common/arrays';
|
||||
import {equals as objectEquals} from 'vs/base/common/objects';
|
||||
import {ExtHostContext} from './extHostProtocol';
|
||||
import {ExtHostEditors, ITextEditorPositionData} from './extHostEditors';
|
||||
import {ExtHostContext, ExtHostEditorsShape, ITextEditorPositionData} from './extHostProtocol';
|
||||
|
||||
export class MainThreadEditors {
|
||||
|
||||
private _proxy: ExtHostEditors;
|
||||
private _proxy: ExtHostEditorsShape;
|
||||
private _workbenchEditorService: IWorkbenchEditorService;
|
||||
private _telemetryService: ITelemetryService;
|
||||
private _editorTracker: MainThreadEditorsTracker;
|
||||
|
||||
@@ -12,8 +12,7 @@ import {ExtensionsRegistry} from 'vs/platform/extensions/common/extensionsRegist
|
||||
import {IMessageService} from 'vs/platform/message/common/message';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
|
||||
import {ExtHostContext} from './extHostProtocol';
|
||||
import {ExtHostExtensionService} from './extHostExtensionService';
|
||||
import {ExtHostContext, ExtHostExtensionServiceShape} from './extHostProtocol';
|
||||
|
||||
/**
|
||||
* Represents a failed extension in the ext host.
|
||||
@@ -42,7 +41,7 @@ export class MainProcessExtensionService extends AbstractExtensionService<Activa
|
||||
|
||||
private _threadService: IThreadService;
|
||||
private _messageService: IMessageService;
|
||||
private _proxy: ExtHostExtensionService;
|
||||
private _proxy: ExtHostExtensionServiceShape;
|
||||
private _isDev: boolean;
|
||||
private _extensionsStatus: { [id: string]: IExtensionsStatus };
|
||||
|
||||
|
||||
@@ -8,14 +8,13 @@ import {FileChangesEvent, FileChangeType} from 'vs/platform/files/common/files';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {IEventService} from 'vs/platform/event/common/event';
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import {ExtHostContext} from './extHostProtocol';
|
||||
import {FileSystemEvents} from './extHostFileSystemEventService';
|
||||
import {ExtHostContext, ExtHostFileSystemEventServiceShape, FileSystemEvents} from './extHostProtocol';
|
||||
|
||||
export class MainThreadFileSystemEventService {
|
||||
|
||||
constructor( @IEventService eventService: IEventService, @IThreadService threadService: IThreadService) {
|
||||
|
||||
const proxy = threadService.get(ExtHostContext.ExtHostFileSystemEventService);
|
||||
const proxy: ExtHostFileSystemEventServiceShape = threadService.get(ExtHostContext.ExtHostFileSystemEventService);
|
||||
const events: FileSystemEvents = {
|
||||
created: [],
|
||||
changed: [],
|
||||
|
||||
@@ -15,13 +15,12 @@ import {wireCancellationToken} from 'vs/base/common/async';
|
||||
import {CancellationToken} from 'vs/base/common/cancellation';
|
||||
import {Position as EditorPosition} from 'vs/editor/common/core/position';
|
||||
import {Range as EditorRange} from 'vs/editor/common/core/range';
|
||||
import {ExtHostContext} from './extHostProtocol';
|
||||
import {ExtHostLanguageFeatures} from './extHostLanguageFeatures';
|
||||
import {ExtHostContext, ExtHostLanguageFeaturesShape} from './extHostProtocol';
|
||||
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
|
||||
|
||||
export class MainThreadLanguageFeatures {
|
||||
|
||||
private _proxy: ExtHostLanguageFeatures;
|
||||
private _proxy: ExtHostLanguageFeaturesShape;
|
||||
private _registrations: { [handle: number]: IDisposable; } = Object.create(null);
|
||||
|
||||
constructor( @IThreadService threadService: IThreadService) {
|
||||
|
||||
@@ -8,12 +8,11 @@ import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {IQuickOpenService, IPickOptions, IInputOptions} from 'vs/workbench/services/quickopen/common/quickOpenService';
|
||||
import {InputBoxOptions} from 'vscode';
|
||||
import {ExtHostContext} from './extHostProtocol';
|
||||
import {ExtHostQuickOpen, MyQuickPickItems} from './extHostQuickOpen';
|
||||
import {ExtHostContext, ExtHostQuickOpenShape, MyQuickPickItems} from './extHostProtocol';
|
||||
|
||||
export class MainThreadQuickOpen {
|
||||
|
||||
private _proxy: ExtHostQuickOpen;
|
||||
private _proxy: ExtHostQuickOpenShape;
|
||||
private _quickOpenService: IQuickOpenService;
|
||||
private _doSetItems: (items: MyQuickPickItems[]) => any;
|
||||
private _doSetError: (error: Error) => any;
|
||||
|
||||
Reference in New Issue
Block a user