Task context + schema (#849)

* commting .d.ts changes

* added serverinfo to .d.ts

* maybe its working?

* works

* updated contrib

* remove unnecessary code

* fix compile errors

* update task schema and add the ability to specifiy a when clause

* update defaults for tasks widget

* add when to restore and back up tasks to not show up for cloud servers

* formatting

* fixing engine

* add restore to server page
This commit is contained in:
Anthony Dresser
2018-03-12 11:41:49 -07:00
committed by GitHub
parent 66f39fd3eb
commit 5c0002404a
7 changed files with 55 additions and 21 deletions

View File

@@ -11,7 +11,7 @@ import { Action } from 'vs/base/common/actions';
import { IConstructorSignature3, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import * as nls from 'vs/nls';
import { ILocalizedString, IMenuItem, MenuRegistry, ICommandAction } from 'vs/platform/actions/common/actions';
import Event from 'vs/base/common/event';
import Event, { Emitter } from 'vs/base/common/event';
import { IDisposable } from 'vs/base/common/lifecycle';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
@@ -96,11 +96,14 @@ export interface ITaskRegistry {
registerTask(id: string, command: ITaskHandler): IDisposable;
registerTask(command: ITask): IDisposable;
getTasks(): string[];
onTaskRegistered: Event<string>;
}
export const TaskRegistry: ITaskRegistry = new class implements ITaskRegistry {
private _tasks = new Array<string>();
private _onTaskRegistered = new Emitter<string>();
public readonly onTaskRegistered: Event<string> = this._onTaskRegistered.event;
registerTask(idOrTask: string | ITask, handler?: ITaskHandler): IDisposable {
let disposable: IDisposable;
@@ -114,6 +117,7 @@ export const TaskRegistry: ITaskRegistry = new class implements ITaskRegistry {
}
this._tasks.push(id);
this._onTaskRegistered.fire(id);
return {
dispose: () => {