Task contribution (#742)

* work in progress

* set up necessary code. need to work on getting it working

* formatting

* work in progress

* work in progress

* formatting

* work in progress

* work in progress

* work in progress

* formatting

* needs a lot of work regarding how we do actions vs how extensions do actions

* formatting

* use connection profile for actions

* change action to be
This commit is contained in:
Anthony Dresser
2018-02-27 11:40:13 -08:00
committed by GitHub
parent 5adab4fafb
commit 3432dac261
23 changed files with 518 additions and 323 deletions

View File

@@ -26,6 +26,7 @@ import * as sqlExtHostTypes from 'sql/workbench/api/common/sqlExtHostTypes';
import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace';
import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration';
import { ExtHostModalDialogs } from 'sql/workbench/api/node/extHostModalDialog';
import { ExtHostTasks } from 'sql/workbench/api/node/extHostTasks';
import { ILogService } from 'vs/platform/log/common/log';
import { IExtensionApiFactory } from 'vs/workbench/api/node/extHost.api.impl';
import { ExtHostDashboardWebviews } from 'sql/workbench/api/node/extHostDashboardWebview';
@@ -57,6 +58,7 @@ export function createApiFactory(
const extHostSerializationProvider = threadService.set(SqlExtHostContext.ExtHostSerializationProvider, new ExtHostSerializationProvider(threadService));
const extHostResourceProvider = threadService.set(SqlExtHostContext.ExtHostResourceProvider, new ExtHostResourceProvider(threadService));
const extHostModalDialogs = threadService.set(SqlExtHostContext.ExtHostModalDialogs, new ExtHostModalDialogs(threadService));
const extHostTasks = threadService.set(SqlExtHostContext.ExtHostTasks, new ExtHostTasks(threadService, logService));
const extHostWebviewWidgets = threadService.set(SqlExtHostContext.ExtHostDashboardWebviews, new ExtHostDashboardWebviews(threadService));
return {
@@ -255,12 +257,18 @@ export function createApiFactory(
}
};
const window = {
const window: typeof sqlops.window = {
createDialog(name: string) {
return extHostModalDialogs.createDialog(name);
}
};
const tasks: typeof sqlops.tasks = {
registerTask(id: string, task: (...args: any[]) => any, thisArgs?: any): vscode.Disposable {
return extHostTasks.registerTask(id, task, thisArgs);
}
};
const dashboard = {
registerWebviewProvider(widgetId: string, handler: (webview: sqlops.DashboardWebview) => void) {
extHostWebviewWidgets.$registerProvider(widgetId, handler);
@@ -282,6 +290,7 @@ export function createApiFactory(
TaskExecutionMode: sqlExtHostTypes.TaskExecutionMode,
ScriptOperation: sqlExtHostTypes.ScriptOperation,
window,
tasks,
dashboard
};
}