"use strict" ; import * as vscode from "vscode" ; import { AppInsightsClient } from "./common/appInsightsClient" ; import { Utility } from "./common/utility" ; import { ConnectionNode } from "./model/connectionNode" ; import { DatabaseNode } from "./model/databaseNode" ; import { INode } from "./model/INode" ; import { TableNode } from "./model/tableNode" ; import { MySQLTreeDataProvider } from "./mysqlTreeDataProvider" ; export function activate ( context ) { AppInsightsClient . sendEvent ( "loadExtension" ) ; const mysqlTreeDataProvider = new MySQLTreeDataProvider ( context ) ; context . subscriptions . push ( vscode . window . registerTreeDataProvider ( "mysql" , mysqlTreeDataProvider ) ) ; context . subscriptions . push ( vscode . commands . registerCommand ( "mysql.refresh" , ( node ) => { AppInsightsClient . sendEvent ( "refresh" ) ; mysqlTreeDataProvider . refresh ( node ) ; } ) ) ; context . subscriptions . push ( vscode . commands . registerCommand ( "mysql.addConnection" , ( ) => { mysqlTreeDataProvider . addConnection ( ) ; } ) ) ; context . subscriptions . push ( vscode . commands . registerCommand ( "mysql.deleteConnection" , ( connectionNode ) => { connectionNode . deleteConnection ( context , mysqlTreeDataProvider ) ; } ) ) ; context . subscriptions . push ( vscode . commands . registerCommand ( "mysql.runQuery" , ( ) => { Utility . runQuery ( ) ; } ) ) ; context . subscriptions . push ( vscode . commands . registerCommand ( "mysql.newQuery" , ( databaseOrConnectionNode ) => { databaseOrConnectionNode . newQuery ( ) ; } ) ) ; context . subscriptions . push ( vscode . commands . registerCommand ( "mysql.selectTop1000" , ( tableNode ) => { tableNode . selectTop1000 ( ) ; } ) ) ; } export function deactivate ( ) { }