@@ -5,12 +5,10 @@ import * as sqlops from 'sqlops';
55import { error } from 'util' ;
66import { placeScript } from './placescript' ;
77import { updatecheck } from './updateCheck' ;
8- // import {BlitzIndex} from './blitzindex';
98
109export function activate ( context : vscode . ExtensionContext ) {
1110 const baseUrl = "https://raw.githubusercontent.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/master/" ;
1211
13-
1412 // checking spblitz versioning
1513 var oediag = async ( context : sqlops . ObjectExplorerContext ) => {
1614 vscode . window . showInformationMessage ( context . isConnectionNode . toString ( ) ) ;
@@ -25,15 +23,13 @@ export function activate(context: vscode.ExtensionContext) {
2523 var amIUPD = new updatecheck ( ) ;
2624 let updateReturn = await amIUPD . checkForUpdates ( context ) ;
2725
28- //vscode.window.showInformationMessage(updateReturn);
2926 if ( updateReturn == 'update' ) {
3027 getblitzall ( ) ;
3128 } else if ( updateReturn != '' ) {
3229 let versionURL = 'https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/releases/tag/' + updateReturn ;
3330 vscode . commands . executeCommand ( 'vscode.open' , vscode . Uri . parse ( versionURL ) ) ;
3431 } else {
3532 // do nothing
36- vscode . window . showErrorMessage ( "Sorry about this. Please report the issue on Github." ) ;
3733 }
3834 } ;
3935 var disposable_spblitzversion = vscode . commands . registerCommand ( 'extension.sp_blitzversion' , getblitzversion ) ;
@@ -48,63 +44,58 @@ export function activate(context: vscode.ExtensionContext) {
4844 } ;
4945 console . log ( 'Bringing in the first responder kit from the mothership.' ) ;
5046 const scriptText = await request . get ( options ) ;
51- //await placeScript.placescript(fileName, scriptText);
5247 new placeScript ( ) . placescript ( fileName , scriptText ) ;
5348 } ;
5449 var disposable_spblitzall = vscode . commands . registerCommand ( 'extension.sp_blitzall' , getblitzall ) ;
5550 context . subscriptions . push ( disposable_spblitzall ) ;
5651
57- //importing the original spblitz script
52+ //importing spblitz script
5853 var getblitz = async ( ) => {
5954 let fileName = "sp_Blitz.sql" ;
6055 var options = {
6156 uri : baseUrl + fileName ,
6257 } ;
6358 console . log ( 'Bringing in the first responder kit from the mothership.' ) ;
6459 const scriptText = await request . get ( options ) ;
65- //await placeScript.placescript(fileName, scriptText);
6660 new placeScript ( ) . placescript ( fileName , scriptText ) ;
6761 } ;
6862 var disposable_spblitz = vscode . commands . registerCommand ( 'extension.sp_blitz' , getblitz ) ;
6963 context . subscriptions . push ( disposable_spblitz ) ;
7064
71- //importing the full spblitzcache script
65+ //importing spblitzcache script
7266 var getblitzcache = async ( ) => {
7367 let fileName = "sp_BlitzCache.sql" ;
7468 var options = {
7569 uri : baseUrl + fileName ,
7670 } ;
7771 console . log ( 'Bringing in the first responder kit from the mothership.' ) ;
7872 const scriptText = await request . get ( options ) ;
79- //await placeScript.placescript(fileName, scriptText);
8073 new placeScript ( ) . placescript ( fileName , scriptText ) ;
8174 } ;
8275 var disposable_spblitzcache = vscode . commands . registerCommand ( 'extension.sp_blitzcache' , getblitzcache ) ;
8376 context . subscriptions . push ( disposable_spblitzcache ) ;
8477
85- //importing the full spblitzfirst script
78+ //importing spblitzfirst script
8679 var getblitzfirst = async ( ) => {
8780 let fileName = "sp_BlitzFirst.sql" ;
8881 var options = {
8982 uri : baseUrl + fileName ,
9083 } ;
9184 console . log ( 'Bringing in the first responder kit from the mothership.' ) ;
9285 const scriptText = await request . get ( options ) ;
93- //await placeScript.placescript(fileName, scriptText);
9486 new placeScript ( ) . placescript ( fileName , scriptText ) ;
9587 } ;
9688 var disposable_spblitzfirst = vscode . commands . registerCommand ( 'extension.sp_blitzfirst' , getblitzfirst ) ;
9789 context . subscriptions . push ( disposable_spblitzfirst ) ;
9890
99- //importing the spblitzwho script
91+ //importing spblitzwho script
10092 var getblitzwho = async ( ) => {
10193 let fileName = "sp_BlitzWho.sql" ;
10294 var options = {
10395 uri : baseUrl + fileName ,
10496 } ;
10597 console . log ( 'Bringing in the first responder kit from the mothership.' ) ;
10698 const scriptText = await request . get ( options ) ;
107- //await placeScript.placescript(fileName, scriptText);
10899 new placeScript ( ) . placescript ( fileName , scriptText ) ;
109100 } ;
110101 var disposable_spblitzwho = vscode . commands . registerCommand ( 'extension.sp_blitzwho' , getblitzwho ) ;
@@ -127,27 +118,25 @@ export function activate(context: vscode.ExtensionContext) {
127118 -- for more info: https://www.brentozar.com/blitz/
128119 ` ;
129120 var setting : vscode . Uri = vscode . Uri . parse ( "untitled:" + fileName ) ;
130- //await placeScript.placescript(fileName, scriptText);
131121 new placeScript ( ) . placescript ( fileName , scriptText ) ;
132122 } ;
133123 var disposable_runspblitz = vscode . commands . registerCommand ( 'extension.run_sp_blitz' , runspblitz ) ;
134124 context . subscriptions . push ( disposable_runspblitz ) ;
135125
136- //importing the full spblitz script
126+ //importing spblitzindex script
137127 var getblitzindex = async ( ) => {
138128 let fileName = "sp_BlitzIndex.sql" ;
139129 var options = {
140130 uri : baseUrl + fileName ,
141131 } ;
142132 console . log ( 'Bringing in the first responder kit from the mothership.' ) ;
143133 const scriptText = await request . get ( options ) ;
144- //await placeScript.placescript(fileName, scriptText);
145134 new placeScript ( ) . placescript ( fileName , scriptText ) ;
146135 } ;
147136 var disposable_spblitzindex = vscode . commands . registerCommand ( 'extension.sp_blitzindex' , getblitzindex ) ;
148137 context . subscriptions . push ( disposable_spblitzindex ) ;
149138
150- //creating the quickrun script
139+ //creating the quickrun script for blitzindex
151140 var runspblitzindex = async ( context ?: sqlops . ObjectExplorerContext ) => {
152141 console . log ( 'Preparing sample run script.' ) ;
153142 let fileName = "exec_sp_blitzindex.sql" ;
@@ -212,13 +201,12 @@ export function activate(context: vscode.ExtensionContext) {
212201
213202 -- for more info: https://www.brentozar.com/blitzcache/
214203 ` ;
215- //await placeScript.placescript(fileName, scriptText);
216204 new placeScript ( ) . placescript ( fileName , scriptText ) ;
217205 } ;
218206 var disposable_runspblitzcache = vscode . commands . registerCommand ( 'extension.run_sp_blitzcache' , runspblitzcache )
219207 context . subscriptions . push ( disposable_runspblitzcache ) ;
220208
221- //creating the quickrun script
209+ //creating the quickrun script for blitzfirst
222210 var runspblitzfirst = async ( ) => {
223211 let fileName = "exec_sp_blitzfirst.sql" ;
224212 console . log ( 'Preparing sample run script.' ) ;
@@ -229,16 +217,13 @@ export function activate(context: vscode.ExtensionContext) {
229217
230218 -- for more info: https://www.brentozar.com/askbrent/
231219 ` ;
232- //await placeScript.placescript(fileName, scriptText);
233220 new placeScript ( ) . placescript ( fileName , scriptText ) ;
234221 } ;
235222 var disposable_runspblitzfirst = vscode . commands . registerCommand ( 'extension.run_sp_blitzfirst' , runspblitzfirst ) ;
236223 context . subscriptions . push ( disposable_runspblitzfirst ) ;
237224
238225}
239226
240-
241- // this method is called when your extension is deactivated
242227export function deactivate ( ) {
243228}
244229
0 commit comments