Skip to content

Commit fbba666

Browse files
committed
removed testing command
1 parent ac7d637 commit fbba666

2 files changed

Lines changed: 11 additions & 51 deletions

File tree

package.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"onCommand:extension.run_sp_blitzcache",
2626
"onCommand:extension.sp_blitzfirst",
2727
"onCommand:extension.run_sp_blitzfirst",
28-
"onCommand:extension.testmenus",
2928
"*"
3029
],
3130
"main": "./out/extension",
@@ -66,10 +65,6 @@
6665
{
6766
"command": "extension.run_sp_blitzcache",
6867
"title": "First Responder Kit: Run sp_blitzcache"
69-
},
70-
{
71-
"command": "extension.testmenus",
72-
"title": "First Responder Kit: Test Menus"
7368
}
7469
],
7570
"snippets": [
@@ -80,11 +75,6 @@
8075
],
8176
"menus": {
8277
"objectExplorer/item/context": [
83-
{
84-
"command": "extension.testmenus",
85-
"when": "connectionProvider == MSSQL && nodeType",
86-
"group": "FRK"
87-
},
8878
{
8979
"command": "extension.run_sp_blitzindex",
9080
"when": "connectionProvider == MSSQL && nodeType && nodeType == Database",

src/extension.ts

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ export function activate(context: vscode.ExtensionContext) {
7777
@CheckProcedureCacheFilter = NULL,
7878
@CheckServerInfo = 1
7979
-- uncomment the following line to write results to an output table
80-
--, @OutputDatabaseName = 'DBAtools', @OutputSchemaName = 'dbo', @OutputTableName = 'BlitzResults'`;
80+
--, @OutputDatabaseName = 'DBAtools', @OutputSchemaName = 'dbo', @OutputTableName = 'BlitzResults'
81+
82+
-- for more info: https://www.brentozar.com/blitz/
83+
`;
8184
var setting: vscode.Uri = vscode.Uri.parse("untitled:" + fileName);
8285
//await placeScript.placescript(fileName, scriptText);
8386
new placeScript().placescript(fileName,scriptText);
@@ -143,14 +146,15 @@ export function activate(context: vscode.ExtensionContext) {
143146
@Mode = 4
144147
--0=Diagnose, 1=Summarize, 2=Index Usage Detail, 3=Missing Index Detail, 4=Diagnose Details`;
145148
}
149+
scriptText += `
150+
-- for more info: https://www.brentozar.com/blitzindex/
151+
`;
146152
new placeScript().placescript(fileName,scriptText);
147153

148154
};
149155
var disposable_runspblitzindex = vscode.commands.registerCommand('extension.run_sp_blitzindex', runspblitzindex);
150156
context.subscriptions.push(disposable_runspblitzindex);
151157

152-
//sqlops.tasks.registerTask('extension.run_sp_blitzindex', (profile: sqlops.IConnectionProfile, context?: sqlops.ObjectExplorerContext) => new BlitzIndex().spBlitzIndexTable(profile, context));
153-
154158
//creating the quickrun script for blitzcache
155159
var runspblitzcache = async () => {
156160
let fileName = "exec_sp_blitzcache.sql";
@@ -159,6 +163,8 @@ export function activate(context: vscode.ExtensionContext) {
159163
@SortOrder = 'reads',
160164
-- CPU, executions, xpm, recent compilations, memory grant, writes, all
161165
@Top = 10
166+
167+
-- for more info: https://www.brentozar.com/blitzcache/
162168
`;
163169
//await placeScript.placescript(fileName, scriptText);
164170
new placeScript().placescript(fileName,scriptText);
@@ -174,53 +180,17 @@ export function activate(context: vscode.ExtensionContext) {
174180
@Seconds = 5,
175181
@ShowSleepingSPIDs = 0,
176182
@ExpertMode = 0 --1 will also run sp_BlitzWho
183+
184+
-- for more info: https://www.brentozar.com/askbrent/
177185
`;
178186
//await placeScript.placescript(fileName, scriptText);
179187
new placeScript().placescript(fileName,scriptText);
180188
};
181189
var disposable_runspblitzfirst = vscode.commands.registerCommand('extension.run_sp_blitzfirst',runspblitzfirst);
182190
context.subscriptions.push(disposable_runspblitzfirst);
183191

184-
185-
let disposable = vscode.commands.registerCommand('extension.testmenus', async (context?: sqlops.ObjectExplorerContext) => {
186-
await getDB(context);
187-
// let connection = await getConnection(context);
188-
189-
// // Format the message
190-
// let message = `Hello Connected World! Please connect in Object Explorer or a Query window`;
191-
// if (connection) {
192-
// message = `Hello Connected World! Your server name is ${connection.options['server']}`;
193-
// }
194-
// // Display a message box to the user
195-
// vscode.window.showInformationMessage(message);
196-
});
197-
198-
context.subscriptions.push(disposable);
199-
200192
}
201193

202-
async function getDB(context?: sqlops.ObjectExplorerContext) {
203-
if (context) {
204-
vscode.window.showInformationMessage(context.nodeInfo.nodeType);
205-
}
206-
}
207-
208-
async function getConnection(context?: sqlops.ObjectExplorerContext): Promise<sqlops.ConnectionInfo> {
209-
// If we are called from a context menu use the predefined connection.
210-
// This even has correct database if the node clicked on is under a specific DB
211-
if (context) {
212-
return context.connectionProfile;
213-
}
214-
// Otherwise use APIs to find the global current connection / active connection
215-
let connection = await sqlops.connection.getCurrentConnection();
216-
if (!connection) {
217-
let allConnections = await sqlops.connection.getActiveConnections();
218-
if (allConnections && allConnections.length > 0) {
219-
connection = allConnections[0];
220-
}
221-
}
222-
return connection;
223-
}
224194

225195
// this method is called when your extension is deactivated
226196
export function deactivate() {

0 commit comments

Comments
 (0)