mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
Merge branch 'master' into joh/remote
This commit is contained in:
@@ -478,6 +478,9 @@ export function createApiFactory(
|
||||
},
|
||||
onDidChangeActiveDebugSession: proposedApiFunction(extension, (listener, thisArg?, disposables?) => {
|
||||
return extHostDebugService.onDidChangeActiveDebugSession(listener, thisArg, disposables);
|
||||
}),
|
||||
onDidReceiveDebugSessionCustomEvent: proposedApiFunction(extension, (listener, thisArg?, disposables?) => {
|
||||
return extHostDebugService.onDidReceiveDebugSessionCustomEvent(listener, thisArg, disposables);
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ export abstract class ExtHostTaskShape {
|
||||
export abstract class ExtHostDebugServiceShape {
|
||||
$acceptDebugSessionTerminated(id: DebugSessionUUID, type: string, name: string): void { throw ni(); }
|
||||
$acceptDebugSessionActiveChanged(id: DebugSessionUUID | undefined, type?: string, name?: string): void { throw ni(); }
|
||||
$acceptDebugSessionCustomEvent(id: DebugSessionUUID, event: any): void { throw ni(); }
|
||||
$acceptDebugSessionCustomEvent(id: DebugSessionUUID, type: string, name: string, event: any): void { throw ni(); }
|
||||
}
|
||||
|
||||
// --- proxy identifiers
|
||||
|
||||
@@ -27,11 +27,16 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
|
||||
private _activeDebugSession: ExtHostDebugSession | undefined;
|
||||
get activeDebugSession(): ExtHostDebugSession | undefined { return this._activeDebugSession; }
|
||||
|
||||
private _onDidReceiveDebugSessionCustomEvent: Emitter<vscode.DebugSessionCustomEvent>;
|
||||
get onDidReceiveDebugSessionCustomEvent(): Event<vscode.DebugSessionCustomEvent> { return this._onDidReceiveDebugSessionCustomEvent.event; }
|
||||
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
super();
|
||||
|
||||
this._onDidTerminateDebugSession = new Emitter<vscode.DebugSession>();
|
||||
this._onDidChangeActiveDebugSession = new Emitter<vscode.DebugSession>();
|
||||
this._onDidReceiveDebugSessionCustomEvent = new Emitter<vscode.DebugSessionCustomEvent>();
|
||||
|
||||
this._debugServiceProxy = threadService.get(MainContext.MainThreadDebugService);
|
||||
}
|
||||
@@ -70,12 +75,19 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
|
||||
this._onDidChangeActiveDebugSession.fire(this._activeDebugSession);
|
||||
}
|
||||
|
||||
public $acceptDebugSessionCustomEvent(id: DebugSessionUUID, event: any): void {
|
||||
public $acceptDebugSessionCustomEvent(id: DebugSessionUUID, type: string, name: string, event: any): void {
|
||||
|
||||
let debugSession = this._debugSessions.get(id);
|
||||
if (debugSession) {
|
||||
debugSession._onCustomEvent(event);
|
||||
if (!debugSession) {
|
||||
debugSession = new ExtHostDebugSession(this._debugServiceProxy, id, type, name);
|
||||
this._debugSessions.set(id, debugSession);
|
||||
}
|
||||
const ee: vscode.DebugSessionCustomEvent = {
|
||||
session: debugSession,
|
||||
event: event.event,
|
||||
body: event.body
|
||||
};
|
||||
this._onDidReceiveDebugSessionCustomEvent.fire(ee);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,8 +100,6 @@ export class ExtHostDebugSession implements vscode.DebugSession {
|
||||
private _type: string;
|
||||
private _name: string;
|
||||
|
||||
private _onCustomEventCallback: (event: any) => void;
|
||||
|
||||
constructor(proxy: MainThreadDebugServiceShape, id: DebugSessionUUID, type: string, name: string) {
|
||||
this._debugServiceProxy = proxy;
|
||||
this._id = id;
|
||||
@@ -112,12 +122,4 @@ export class ExtHostDebugSession implements vscode.DebugSession {
|
||||
public customRequest(command: string, args: any): Thenable<any> {
|
||||
return this._debugServiceProxy.$customDebugAdapterRequest(this._id, command, args);
|
||||
}
|
||||
|
||||
public onCustomEvent(callback: (event: any) => void): void {
|
||||
this._onCustomEventCallback = callback;
|
||||
}
|
||||
|
||||
public _onCustomEvent(event: any): void {
|
||||
this._onCustomEventCallback(event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,7 +352,8 @@ namespace Tasks {
|
||||
group: task.group ? (task.group as types.TaskGroup).id : undefined,
|
||||
command: command,
|
||||
isBackground: !!task.isBackground,
|
||||
problemMatchers: task.problemMatchers.slice()
|
||||
problemMatchers: task.problemMatchers.slice(),
|
||||
hasDefinedMatchers: (task as types.Task).hasDefinedMatchers
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1158,6 +1158,7 @@ export class Task implements vscode.Task {
|
||||
private _name: string;
|
||||
private _execution: ProcessExecution | ShellExecution;
|
||||
private _problemMatchers: string[];
|
||||
private _hasDefinedMatchers: boolean;
|
||||
private _isBackground: boolean;
|
||||
private _source: string;
|
||||
private _group: TaskGroup;
|
||||
@@ -1170,10 +1171,13 @@ export class Task implements vscode.Task {
|
||||
this.execution = execution;
|
||||
if (typeof problemMatchers === 'string') {
|
||||
this._problemMatchers = [problemMatchers];
|
||||
this._hasDefinedMatchers = true;
|
||||
} else if (Array.isArray(problemMatchers)) {
|
||||
this._problemMatchers = problemMatchers;
|
||||
this._hasDefinedMatchers = true;
|
||||
} else {
|
||||
this._problemMatchers = [];
|
||||
this._hasDefinedMatchers = false;
|
||||
}
|
||||
this._isBackground = false;
|
||||
}
|
||||
@@ -1227,9 +1231,16 @@ export class Task implements vscode.Task {
|
||||
|
||||
set problemMatchers(value: string[]) {
|
||||
if (!Array.isArray(value)) {
|
||||
value = [];
|
||||
this._problemMatchers = [];
|
||||
this._hasDefinedMatchers = false;
|
||||
return;
|
||||
}
|
||||
this._problemMatchers = value;
|
||||
this._hasDefinedMatchers = true;
|
||||
}
|
||||
|
||||
get hasDefinedMatchers(): boolean {
|
||||
return this._hasDefinedMatchers;
|
||||
}
|
||||
|
||||
get isBackground(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user