mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
Merge remote-tracking branch 'origin/master' into treeExplorerAPI
This commit is contained in:
@@ -88,10 +88,10 @@ export class ExtHostContribution implements IWorkbenchContribution {
|
||||
col.finish(true, this.threadService);
|
||||
|
||||
// Other interested parties
|
||||
create(MainProcessTextMateSyntax);
|
||||
let tmSyntax = create(MainProcessTextMateSyntax);
|
||||
create(MainProcessTextMateSnippet);
|
||||
create(JSONValidationExtensionPoint);
|
||||
create(LanguageConfigurationFileHandler);
|
||||
this.instantiationService.createInstance(LanguageConfigurationFileHandler, tmSyntax);
|
||||
create(MainThreadFileSystemEventService);
|
||||
create(SaveParticipant);
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ export abstract class ExtHostDocumentsShape {
|
||||
$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(); }
|
||||
$acceptModelChanged(strURL: string, events: editorCommon.IModelContentChangedEvent2[], isDirty: boolean): void { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class ExtHostDocumentSaveParticipantShape {
|
||||
|
||||
@@ -207,8 +207,8 @@ export class CommandsConverter {
|
||||
}
|
||||
}
|
||||
|
||||
private _executeConvertedCommand([id]: number[]) {
|
||||
const actualCmd = this._heap.get<vscode.Command>(id);
|
||||
private _executeConvertedCommand(...args: any[]) {
|
||||
const actualCmd = this._heap.get<vscode.Command>(args[0]);
|
||||
return this._commands.executeCommand(actualCmd.command, ...actualCmd.arguments);
|
||||
}
|
||||
|
||||
|
||||
@@ -199,8 +199,9 @@ export class ExtHostDocuments extends ExtHostDocumentsShape {
|
||||
data.dispose();
|
||||
}
|
||||
|
||||
public $acceptModelChanged(strURL: string, events: editorCommon.IModelContentChangedEvent2[]): void {
|
||||
public $acceptModelChanged(strURL: string, events: editorCommon.IModelContentChangedEvent2[], isDirty: boolean): void {
|
||||
let data = this._documentData[strURL];
|
||||
data._acceptIsDirty(isDirty);
|
||||
data.onEvents(events);
|
||||
this._onDidChangeDocumentEventEmitter.fire({
|
||||
document: data.document,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import vscode = require('vscode');
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { TPromise, TValueCallback } from 'vs/base/common/winjs.base';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { ExtHostTerminalServiceShape, MainContext, MainThreadTerminalServiceShape } from './extHost.protocol';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
@@ -14,20 +14,25 @@ export class ExtHostTerminal implements vscode.Terminal {
|
||||
|
||||
private _name: string;
|
||||
private _id: number;
|
||||
private _processId: number;
|
||||
private _proxy: MainThreadTerminalServiceShape;
|
||||
private _disposed: boolean;
|
||||
private _queuedRequests: ApiRequest[];
|
||||
private _pidPromise: TPromise<number>;
|
||||
private _pidPromiseComplete: TValueCallback<number>;
|
||||
|
||||
constructor(proxy: MainThreadTerminalServiceShape, name?: string, shellPath?: string, shellArgs?: string[]) {
|
||||
this._name = name;
|
||||
this._queuedRequests = [];
|
||||
this._proxy = proxy;
|
||||
this._pidPromise = new TPromise<number>(c => {
|
||||
this._pidPromiseComplete = c;
|
||||
});
|
||||
this._proxy.$createTerminal(name, shellPath, shellArgs).then((id) => {
|
||||
this._id = id;
|
||||
this._queuedRequests.forEach((r) => {
|
||||
r.run(this._proxy, this._id);
|
||||
});
|
||||
this._queuedRequests = [];
|
||||
});
|
||||
}
|
||||
|
||||
@@ -38,14 +43,7 @@ export class ExtHostTerminal implements vscode.Terminal {
|
||||
|
||||
public get processId(): Thenable<number> {
|
||||
this._checkDisposed();
|
||||
if (this._processId) {
|
||||
return TPromise.as<number>(this._processId);
|
||||
}
|
||||
return new TPromise<number>((resolve) => {
|
||||
setTimeout(() => {
|
||||
this.processId.then(resolve);
|
||||
}, 200);
|
||||
});
|
||||
return this._pidPromise;
|
||||
}
|
||||
|
||||
public sendText(text: string, addNewLine: boolean = true): void {
|
||||
@@ -71,7 +69,8 @@ export class ExtHostTerminal implements vscode.Terminal {
|
||||
}
|
||||
|
||||
public setProcessId(processId: number): void {
|
||||
this._processId = processId;
|
||||
this._pidPromiseComplete(processId);
|
||||
this._pidPromiseComplete = null;
|
||||
}
|
||||
|
||||
private _queueApiRequest(callback: (...args: any[]) => void, args: any[]) {
|
||||
|
||||
@@ -599,7 +599,7 @@ export class Hover {
|
||||
|
||||
constructor(contents: vscode.MarkedString | vscode.MarkedString[], range?: Range) {
|
||||
if (!contents) {
|
||||
throw new Error('Illegal argument');
|
||||
throw new Error('Illegal argument, contents must be defined');
|
||||
}
|
||||
|
||||
if (Array.isArray(contents)) {
|
||||
|
||||
@@ -147,7 +147,7 @@ export class MainThreadDocuments extends MainThreadDocumentsShape {
|
||||
}
|
||||
}
|
||||
if (changedEvents.length > 0) {
|
||||
this._proxy.$acceptModelChanged(modelUrl.toString(), changedEvents);
|
||||
this._proxy.$acceptModelChanged(modelUrl.toString(), changedEvents, this._textFileService.isDirty(modelUrl));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user