mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-03 09:35:40 -05:00
Refresh master with initial release/0.24 snapshot (#332)
* Initial port of release/0.24 source code * Fix additional headers * Fix a typo in launch.json
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
|
||||
import { ContributedTask, ExtensionTaskSourceTransfer } from 'vs/workbench/parts/tasks/common/tasks';
|
||||
import { ITaskService } from 'vs/workbench/parts/tasks/common/taskService';
|
||||
|
||||
import { ExtHostContext, MainThreadTaskShape, ExtHostTaskShape, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
||||
@@ -19,7 +22,8 @@ export class MainThreadTask implements MainThreadTaskShape {
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@ITaskService private _taskService: ITaskService
|
||||
@ITaskService private _taskService: ITaskService,
|
||||
@IWorkspaceContextService private _workspaceContextServer: IWorkspaceContextService
|
||||
) {
|
||||
this._proxy = extHostContext.get(ExtHostContext.ExtHostTask);
|
||||
this._activeHandles = Object.create(null);
|
||||
@@ -35,7 +39,18 @@ export class MainThreadTask implements MainThreadTaskShape {
|
||||
public $registerTaskProvider(handle: number): TPromise<void> {
|
||||
this._taskService.registerTaskProvider(handle, {
|
||||
provideTasks: () => {
|
||||
return this._proxy.$provideTasks(handle);
|
||||
return this._proxy.$provideTasks(handle).then((value) => {
|
||||
for (let task of value.tasks) {
|
||||
if (ContributedTask.is(task)) {
|
||||
let uri = (task._source as any as ExtensionTaskSourceTransfer).__workspaceFolder;
|
||||
if (uri) {
|
||||
delete (task._source as any as ExtensionTaskSourceTransfer).__workspaceFolder;
|
||||
(task._source as any).workspaceFolder = this._workspaceContextServer.getWorkspaceFolder(uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
});
|
||||
}
|
||||
});
|
||||
this._activeHandles[handle] = true;
|
||||
|
||||
Reference in New Issue
Block a user