Initial commit of Database Projects extension (#8540)

* Initial commit of Database Projects extension

* Removing unused references, correcting license, tabs -> spaces in package.json

* cleaning up linter errors
This commit is contained in:
Benjin Dubishar
2019-12-04 15:02:55 -08:00
committed by GitHub
parent 9691fab917
commit a8818ab0df
13 changed files with 440 additions and 4 deletions

View File

@@ -0,0 +1,38 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
/**
* The main controller class that initializes the extension
*/
export default class MainController implements vscode.Disposable {
protected _context: vscode.ExtensionContext;
public constructor(context: vscode.ExtensionContext) {
this._context = context;
}
public get extensionContext(): vscode.ExtensionContext {
return this._context;
}
public deactivate(): void {
}
public activate(): Promise<boolean> {
this.initializeDatabaseProjects();
return Promise.resolve(true);
}
private initializeDatabaseProjects(): void {
vscode.commands.registerCommand('sqlDatabaseProjects.new', () => { console.log('new database project called'); });
vscode.commands.registerCommand('sqlDatabaseProjects.open', () => { console.log('open database project called'); });
}
public dispose(): void {
this.deactivate();
}
}

View File

@@ -0,0 +1,24 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import MainController from './controllers/mainController';
let controllers: MainController[] = [];
export async function activate(context: vscode.ExtensionContext): Promise<void> {
// Start the main controller
let mainController = new MainController(context);
controllers.push(mainController);
context.subscriptions.push(mainController);
await mainController.activate();
}
export function deactivate(): void {
for (let controller of controllers) {
controller.deactivate();
}
}

View File

@@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference path='../../../../src/sql/azdata.d.ts'/>
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
/// <reference types='@types/node'/>