mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Update whoIsActive extension to use azdata (#7287)
* Update whoIsActive extension to use azdata * Change path * Update package-lock
This commit is contained in:
@@ -67,6 +67,7 @@ const indentationFilter = [
|
||||
|
||||
// except multiple specific files
|
||||
'!**/package.json',
|
||||
'!**/package-lock.json', // {{SQL CARBON EDIT}}
|
||||
'!**/yarn.lock',
|
||||
'!**/yarn-error.log',
|
||||
|
||||
|
||||
2
samples/sp_whoIsActive/.gitignore
vendored
2
samples/sp_whoIsActive/.gitignore
vendored
@@ -6,4 +6,4 @@ node_modules
|
||||
.DS_Store
|
||||
.idea
|
||||
test-reports/**
|
||||
typings/sqlops.proposed.d.ts
|
||||
typings/azdata.d.ts
|
||||
|
||||
4
samples/sp_whoIsActive/.vscode/launch.json
vendored
4
samples/sp_whoIsActive/.vscode/launch.json
vendored
@@ -24,7 +24,7 @@
|
||||
{
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"name": "Attach to Ops Studio",
|
||||
"name": "Attach to Azure Data Studio",
|
||||
"protocol": "inspector",
|
||||
"port": 5870,
|
||||
"restart": true,
|
||||
@@ -37,7 +37,7 @@
|
||||
},
|
||||
{
|
||||
"name": "Debug in enlistment",
|
||||
"type": "sqlopsExtensionHost",
|
||||
"type": "azuredatastudioExtensionHost",
|
||||
"request": "launch",
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/../../scripts/sql.bat"
|
||||
|
||||
773
samples/sp_whoIsActive/package-lock.json
generated
773
samples/sp_whoIsActive/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -2,12 +2,12 @@
|
||||
"name": "whoisactive",
|
||||
"displayName": "whoisactive",
|
||||
"description": "sp_whoisactive for Azure Data Studio",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"publisher": "Microsoft",
|
||||
"preview": true,
|
||||
"engines": {
|
||||
"vscode": "^1.26.0",
|
||||
"azdata": "*"
|
||||
"azdata": "^1.11.0"
|
||||
},
|
||||
"icon": "images/sqlserver.png",
|
||||
"license": "SEE LICENSE IN LICENSE.txt",
|
||||
@@ -241,17 +241,17 @@
|
||||
"compile": "gulp compile",
|
||||
"watch": "gulp watch",
|
||||
"typings": "gulp copytypings",
|
||||
"postinstall": "node ./node_modules/vscode/bin/install && node ./node_modules/sqlops/bin/install && gulp copytypings"
|
||||
"postinstall": "node ./node_modules/vscode/bin/install && node ./node_modules/azdata/bin/install && gulp copytypings"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs-extra": "^5.0.0",
|
||||
"handlebars": "^4.0.11",
|
||||
"openurl": "^1.1.1",
|
||||
"sqlops": "github:anthonydresser/sqlops-extension-sqlops"
|
||||
"openurl": "^1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^2.2.42",
|
||||
"@types/node": "^7.0.43",
|
||||
"azdata": "github:microsoft/azdata-extension-azdata",
|
||||
"child-process-promise": "^2.2.1",
|
||||
"del": "^3.0.0",
|
||||
"gulp": "^4.0.0",
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as Utils from '../utils';
|
||||
import ControllerBase from './controllerBase';
|
||||
import * as fs from 'fs';
|
||||
@@ -29,10 +29,10 @@ export default class MainController extends ControllerBase {
|
||||
}
|
||||
|
||||
public activate(): Promise<boolean> {
|
||||
sqlops.tasks.registerTask('sp_whoisactive.install', e => this.openurl('http://whoisactive.com/downloads/'));
|
||||
sqlops.tasks.registerTask('sp_whoisactive.documentation', e => this.openurl('http://whoisactive.com/docs/'));
|
||||
sqlops.tasks.registerTask('sp_whoisactive.findBlockLeaders', e => this.onExecute(e, 'findBlockLeaders.sql'));
|
||||
sqlops.tasks.registerTask('sp_whoisactive.getPlans', e => this.onExecute(e, 'getPlans.sql'));
|
||||
azdata.tasks.registerTask('sp_whoisactive.install', e => this.openurl('http://whoisactive.com/downloads/'));
|
||||
azdata.tasks.registerTask('sp_whoisactive.documentation', e => this.openurl('http://whoisactive.com/docs/'));
|
||||
azdata.tasks.registerTask('sp_whoisactive.findBlockLeaders', e => this.onExecute(e, 'findBlockLeaders.sql'));
|
||||
azdata.tasks.registerTask('sp_whoisactive.getPlans', e => this.onExecute(e, 'getPlans.sql'));
|
||||
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
@@ -41,12 +41,12 @@ export default class MainController extends ControllerBase {
|
||||
openurl.open(link);
|
||||
}
|
||||
|
||||
private onExecute(connection: sqlops.IConnectionProfile, fileName: string): void {
|
||||
private onExecute(connection: azdata.IConnectionProfile, fileName: string): void {
|
||||
let sqlContent = fs.readFileSync(path.join(__dirname, '..', 'sql', fileName)).toString();
|
||||
vscode.workspace.openTextDocument({language: 'sql', content: sqlContent}).then(doc => {
|
||||
vscode.window.showTextDocument(doc, vscode.ViewColumn.Active, false).then(() => {
|
||||
let filePath = doc.uri.toString();
|
||||
sqlops.queryeditor.connect(filePath, connection.id).then(() => sqlops.queryeditor.runQuery(filePath));
|
||||
azdata.queryeditor.connect(filePath, connection.id).then(() => azdata.queryeditor.runQuery(filePath));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ let tslint = require('gulp-tslint');
|
||||
let ts = require('gulp-typescript');
|
||||
let cproc = require('child_process');
|
||||
let os = require('os');
|
||||
let path = require('path');
|
||||
|
||||
let config = require('./config');
|
||||
let tsProject = ts.createProject('tsconfig.json');
|
||||
@@ -89,7 +90,7 @@ gulp.task("build", gulp.series("clean", "lint", "compile"));
|
||||
gulp.task("watch", function() {
|
||||
gulp.watch([config.paths.project.root + '/src/**/*',
|
||||
config.paths.project.root + '/test/**/*.ts'],
|
||||
gulp.series('build'))
|
||||
gulp.series('build'));
|
||||
});
|
||||
|
||||
gulp.task('test', (done) => {
|
||||
@@ -100,11 +101,11 @@ gulp.task('test', (done) => {
|
||||
process.env.JUNIT_REPORT_PATH = workspace + '/test-reports/ext_xunit.xml';
|
||||
|
||||
let azuredatastudioPath = 'azuredatastudio';
|
||||
if (process.env['SQLOPS_DEV']) {
|
||||
if (process.env['VSCODE_DEV']) {
|
||||
let suffix = os.platform === 'win32' ? 'bat' : 'sh';
|
||||
azuredatastudioPath = `${process.env['SQLOPS_DEV']}/scripts/sql-cli.${suffix}`;
|
||||
azuredatastudioPath = `${process.env['VSCODE_DEV']}/scripts/sql-cli.${suffix}`;
|
||||
}
|
||||
console.log(`Using SQLOPS Path of ${azuredatastudioPath}`);
|
||||
console.log(`Using ADS Path of ${azuredatastudioPath}`);
|
||||
|
||||
cproc.exec(`${azuredatastudioPath} --extensionDevelopmentPath="${workspace}" --extensionTestsPath="${workspace}/out/test" --verbose`, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
@@ -118,6 +119,6 @@ gulp.task('test', (done) => {
|
||||
});
|
||||
|
||||
gulp.task('copytypings', function() {
|
||||
return gulp.src(config.paths.project.root + '/../../src/sql/sqlops.proposed.d.ts')
|
||||
return gulp.src(config.paths.project.root + '/../../src/sql/azdata.d.ts')
|
||||
.pipe(gulp.dest('typings/'));
|
||||
});
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"forin": true,
|
||||
"indent": [
|
||||
true,
|
||||
"spaces"
|
||||
"tabs"
|
||||
],
|
||||
"interface-name": true,
|
||||
"jsdoc-format": true,
|
||||
|
||||
Reference in New Issue
Block a user