Archived
Renable Strict TSLint (#5018)
* removes more builder references * remove builder from profiler * formatting * fix profiler dailog * remove builder from oatuhdialog * remove the rest of builder references * formatting * add more strict null checks to base * enable strict tslint rules * fix formatting * fix compile error * fix the rest of the hygeny issues and add pipeline step * fix pipeline files
This commit is contained in:
@@ -27,9 +27,24 @@ steps:
|
||||
displayName: 'Install'
|
||||
|
||||
- script: |
|
||||
node_modules/.bin/gulp electron
|
||||
node_modules/.bin/gulp compile --max_old_space_size=4096
|
||||
displayName: 'Scripts'
|
||||
yarn gulp electron-x64
|
||||
displayName: Download Electron
|
||||
|
||||
- script: |
|
||||
yarn gulp hygiene
|
||||
displayName: Run Hygiene Checks
|
||||
|
||||
- script: |
|
||||
yarn tslint
|
||||
displayName: 'Run TSLint'
|
||||
|
||||
- script: |
|
||||
yarn strict-null-check
|
||||
displayName: 'Run Strict Null Check'
|
||||
|
||||
- script: |
|
||||
yarn compile
|
||||
displayName: 'Compile'
|
||||
|
||||
- script: |
|
||||
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter
|
||||
@@ -39,11 +54,3 @@ steps:
|
||||
inputs:
|
||||
testResultsFiles: '**/test-results.xml'
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- script: |
|
||||
yarn tslint
|
||||
displayName: 'Run TSLint'
|
||||
|
||||
- script: |
|
||||
yarn strict-null-check
|
||||
displayName: 'Run Strict Null Check'
|
||||
|
||||
+14
-10
@@ -9,11 +9,23 @@ steps:
|
||||
displayName: 'Yarn Install'
|
||||
|
||||
- script: |
|
||||
.\node_modules\.bin\gulp electron
|
||||
yarn gulp electron-x64
|
||||
displayName: 'Electron'
|
||||
|
||||
- script: |
|
||||
npm run compile
|
||||
yarn gulp hygiene
|
||||
displayName: Run Hygiene Checks
|
||||
|
||||
- script: |
|
||||
yarn tslint
|
||||
displayName: 'Run TSLint'
|
||||
|
||||
- script: |
|
||||
yarn strict-null-check
|
||||
displayName: 'Run Strict Null Check'
|
||||
|
||||
- script: |
|
||||
yarn compile
|
||||
displayName: 'Compile'
|
||||
|
||||
- script: |
|
||||
@@ -24,11 +36,3 @@ steps:
|
||||
inputs:
|
||||
testResultsFiles: 'test-results.xml'
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- script: |
|
||||
yarn tslint
|
||||
displayName: 'Run TSLint'
|
||||
|
||||
- script: |
|
||||
yarn strict-null-check
|
||||
displayName: 'Run Strict Null Check'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
+67
-11
@@ -90,7 +90,13 @@ const indentationFilter = [
|
||||
'!**/Dockerfile.*',
|
||||
'!**/*.Dockerfile',
|
||||
'!**/*.dockerfile',
|
||||
'!extensions/markdown-language-features/media/*.js'
|
||||
'!extensions/markdown-language-features/media/*.js',
|
||||
// {{SQL CARBON EDIT}}
|
||||
'!**/*.xlf',
|
||||
'!**/*.docx',
|
||||
'!**/*.sql',
|
||||
'!extensions/mssql/sqltoolsservice/**',
|
||||
'!extensions/import/flatfileimportservice/**',
|
||||
];
|
||||
|
||||
const copyrightFilter = [
|
||||
@@ -119,7 +125,36 @@ const copyrightFilter = [
|
||||
'!resources/completions/**',
|
||||
'!extensions/markdown-language-features/media/highlight.css',
|
||||
'!extensions/html-language-features/server/src/modes/typescript/*',
|
||||
'!extensions/*/server/bin/*'
|
||||
'!extensions/*/server/bin/*',
|
||||
// {{SQL CARBON EDIT}}
|
||||
'!extensions/notebook/src/intellisense/text.ts',
|
||||
'!extensions/mssql/src/objectExplorerNodeProvider/webhdfs.ts',
|
||||
'!src/sql/workbench/parts/notebook/outputs/tableRenderers.ts',
|
||||
'!src/sql/workbench/parts/notebook/outputs/common/url.ts',
|
||||
'!src/sql/workbench/parts/notebook/outputs/common/renderMimeInterfaces.ts',
|
||||
'!src/sql/workbench/parts/notebook/outputs/common/outputProcessor.ts',
|
||||
'!src/sql/workbench/parts/notebook/outputs/common/mimemodel.ts',
|
||||
'!src/sql/workbench/parts/notebook/cellViews/media/output.css',
|
||||
'!src/sql/base/browser/ui/table/plugins/rowSelectionModel.plugin.ts',
|
||||
'!src/sql/base/browser/ui/table/plugins/rowDetailView.ts',
|
||||
'!src/sql/base/browser/ui/table/plugins/headerFilter.plugin.ts',
|
||||
'!src/sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin.ts',
|
||||
'!src/sql/base/browser/ui/table/plugins/cellSelectionModel.plugin.ts',
|
||||
'!src/sql/base/browser/ui/table/plugins/autoSizeColumns.plugin.ts',
|
||||
'!src/sql/workbench/parts/notebook/outputs/sanitizer.ts',
|
||||
'!src/sql/workbench/parts/notebook/outputs/renderers.ts',
|
||||
'!src/sql/workbench/parts/notebook/outputs/registry.ts',
|
||||
'!src/sql/workbench/parts/notebook/outputs/factories.ts',
|
||||
'!src/sql/workbench/parts/notebook/models/nbformat.ts',
|
||||
'!extensions/markdown-language-features/media/tomorrow.css',
|
||||
'!src/sql/parts/modelComponents/highlight.css',
|
||||
'!extensions/mssql/sqltoolsservice/**',
|
||||
'!extensions/import/flatfileimportservice/**',
|
||||
'!extensions/notebook/src/prompts/**',
|
||||
'!extensions/mssql/src/prompts/**',
|
||||
'!extensions/notebook/resources/jupyter_config/**',
|
||||
'!**/*.gif',
|
||||
'!**/*.xlf'
|
||||
];
|
||||
|
||||
const eslintFilter = [
|
||||
@@ -165,8 +200,7 @@ gulp.task('eslint', () => {
|
||||
});
|
||||
|
||||
gulp.task('tslint', () => {
|
||||
// {{SQL CARBON EDIT}}
|
||||
const options = { emitError: false };
|
||||
const options = { emitError: true };
|
||||
|
||||
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
|
||||
.pipe(filter(tslintFilter))
|
||||
@@ -264,9 +298,8 @@ function hygiene(some) {
|
||||
.pipe(filter(f => !f.stat.isDirectory()))
|
||||
.pipe(filter(indentationFilter))
|
||||
.pipe(indentation)
|
||||
.pipe(filter(copyrightFilter));
|
||||
// {{SQL CARBON EDIT}}
|
||||
// .pipe(copyrights);
|
||||
.pipe(filter(copyrightFilter))
|
||||
.pipe(copyrights);
|
||||
|
||||
const typescript = result
|
||||
.pipe(filter(tslintFilter))
|
||||
@@ -276,15 +309,38 @@ function hygiene(some) {
|
||||
const javascript = result
|
||||
.pipe(filter(eslintFilter))
|
||||
.pipe(gulpeslint('src/.eslintrc'))
|
||||
.pipe(gulpeslint.formatEach('compact'));
|
||||
// {{SQL CARBON EDIT}}
|
||||
// .pipe(gulpeslint.failAfterError());
|
||||
.pipe(gulpeslint.formatEach('compact'))
|
||||
.pipe(gulpeslint.failAfterError());
|
||||
|
||||
let count = 0;
|
||||
return es.merge(typescript, javascript)
|
||||
.pipe(es.through(function (data) {
|
||||
// {{SQL CARBON EDIT}}
|
||||
count++;
|
||||
if (process.env['TRAVIS'] && count % 10 === 0) {
|
||||
process.stdout.write('.');
|
||||
}
|
||||
this.emit('data', data);
|
||||
}, function () {
|
||||
process.stdout.write('\n');
|
||||
|
||||
const tslintResult = tsLinter.getResult();
|
||||
if (tslintResult.failures.length > 0) {
|
||||
for (const failure of tslintResult.failures) {
|
||||
const name = failure.getFileName();
|
||||
const position = failure.getStartPosition();
|
||||
const line = position.getLineAndCharacter().line;
|
||||
const character = position.getLineAndCharacter().character;
|
||||
|
||||
console.error(`${name}:${line + 1}:${character + 1}:${failure.getFailure()}`);
|
||||
}
|
||||
errorCount += tslintResult.failures.length;
|
||||
}
|
||||
|
||||
if (errorCount > 0) {
|
||||
this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.');
|
||||
} else {
|
||||
this.emit('end');
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,15 +6,6 @@
|
||||
'use strict';
|
||||
|
||||
const gulp = require('gulp');
|
||||
const json = require('gulp-json-editor');
|
||||
const buffer = require('gulp-buffer');
|
||||
const filter = require('gulp-filter');
|
||||
const es = require('event-stream');
|
||||
const vfs = require('vinyl-fs');
|
||||
const pkg = require('../package.json');
|
||||
const cp = require('child_process');
|
||||
const fancyLog = require('fancy-log');
|
||||
const ansiColors = require('ansi-colors');
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
const jeditor = require('gulp-json-editor');
|
||||
|
||||
@@ -28,7 +28,6 @@ const formatFiles = (some) => {
|
||||
console.info('ran formatting on file ' + file.path + ' result: ' + result.message);
|
||||
if (result.error) {
|
||||
console.error(result.message);
|
||||
errorCount++;
|
||||
}
|
||||
cb(null, file);
|
||||
|
||||
@@ -40,7 +39,7 @@ const formatFiles = (some) => {
|
||||
.pipe(filter(f => !f.stat.isDirectory()))
|
||||
.pipe(formatting);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
const formatStagedFiles = () => {
|
||||
const cp = require('child_process');
|
||||
@@ -81,4 +80,4 @@ const formatStagedFiles = () => {
|
||||
process.exit(1);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -27,7 +27,7 @@ const zipPath = arch => path.join(zipDir(arch), `VSCode-win32-${arch}.zip`);
|
||||
const setupDir = (arch, target) => path.join(repoPath, '.build', `win32-${arch}`, `${target}-setup`);
|
||||
const issPath = path.join(__dirname, 'win32', 'code.iss');
|
||||
const innoSetupPath = path.join(path.dirname(path.dirname(require.resolve('innosetup-compiler'))), 'bin', 'ISCC.exe');
|
||||
const signPS1 = path.join(repoPath, 'build', 'azure-pipelines', 'win32', 'sign.ps1');
|
||||
// const signPS1 = path.join(repoPath, 'build', 'azure-pipelines', 'win32', 'sign.ps1');
|
||||
|
||||
function packageInnoSetup(iss, options, cb) {
|
||||
options = options || {};
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
///
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as path from 'path';
|
||||
@@ -12,8 +10,7 @@ import * as vscode from 'vscode';
|
||||
import { IConfig, ServerProvider } from 'service-downloader';
|
||||
import { Telemetry } from './telemetry';
|
||||
import * as utils from './utils';
|
||||
import { ChildProcess, exec, ExecException } from 'child_process';
|
||||
import { stringify } from 'querystring';
|
||||
import { ChildProcess, exec } from 'child_process';
|
||||
|
||||
const baseConfig = require('./config.json');
|
||||
const localize = nls.loadMessageBundle();
|
||||
@@ -116,7 +113,7 @@ function launchSsmsDialog(action: string, connectionProfile: azdata.IConnectionP
|
||||
let args = buildSsmsMinCommandArgs(params);
|
||||
|
||||
// This will be an async call since we pass in the callback
|
||||
var proc: ChildProcess = exec(
|
||||
let proc: ChildProcess = exec(
|
||||
/*command*/`"${exePath}" ${args}`,
|
||||
/*options*/undefined,
|
||||
(execException, stdout, stderr) => {
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as vscode from 'vscode';
|
||||
import * as data from 'azdata';
|
||||
|
||||
@@ -12,7 +11,6 @@ import * as data from 'azdata';
|
||||
* this API from our code
|
||||
*
|
||||
* @export
|
||||
* @class ApiWrapper
|
||||
*/
|
||||
export class ApiWrapper {
|
||||
// Data APIs
|
||||
|
||||
@@ -50,7 +50,7 @@ export class AlertData implements IAgentDialogData {
|
||||
private jobModel: JobData;
|
||||
|
||||
constructor(
|
||||
ownerUri:string,
|
||||
ownerUri: string,
|
||||
alertInfo: azdata.AgentAlertInfo,
|
||||
jobModel?: JobData,
|
||||
viaJobDialog: boolean = false
|
||||
|
||||
@@ -142,7 +142,7 @@ export class JobData implements IAgentDialogData {
|
||||
localize('jobData.saveSucessMessage', "Job '{0}' updated successfully", jobInfo.name));
|
||||
} else {
|
||||
vscode.window.showInformationMessage(
|
||||
localize('jobData.newJobSuccessMessage',"Job '{0}' created successfully", jobInfo.name));
|
||||
localize('jobData.newJobSuccessMessage', "Job '{0}' created successfully", jobInfo.name));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export class JobStepData implements IAgentDialogData {
|
||||
private jobModel: JobData;
|
||||
private viaJobDialog: boolean;
|
||||
|
||||
constructor(ownerUri:string, jobModel?: JobData, viaJobDialog: boolean = false) {
|
||||
constructor(ownerUri: string, jobModel?: JobData, viaJobDialog: boolean = false) {
|
||||
this.ownerUri = ownerUri;
|
||||
this.jobName = jobModel.name;
|
||||
this.jobModel = jobModel;
|
||||
|
||||
@@ -29,7 +29,7 @@ export class OperatorData implements IAgentDialogData {
|
||||
weekdayPagerStartTime: string;
|
||||
weekdayPagerEndTime: string;
|
||||
|
||||
constructor(ownerUri:string, operatorInfo: azdata.AgentOperatorInfo) {
|
||||
constructor(ownerUri: string, operatorInfo: azdata.AgentOperatorInfo) {
|
||||
this.ownerUri = ownerUri;
|
||||
if (operatorInfo) {
|
||||
this.dialogMode = AgentDialogMode.EDIT;
|
||||
|
||||
@@ -15,7 +15,7 @@ export class PickScheduleData implements IAgentDialogData {
|
||||
public selectedSchedule: azdata.AgentJobScheduleInfo;
|
||||
private jobName: string;
|
||||
|
||||
constructor(ownerUri:string, jobName: string) {
|
||||
constructor(ownerUri: string, jobName: string) {
|
||||
this.ownerUri = ownerUri;
|
||||
this.jobName = jobName;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export class ProxyData implements IAgentDialogData {
|
||||
credentialId: number;
|
||||
isEnabled: boolean;
|
||||
|
||||
constructor(ownerUri:string, proxyInfo: azdata.AgentProxyInfo) {
|
||||
constructor(ownerUri: string, proxyInfo: azdata.AgentProxyInfo) {
|
||||
this.ownerUri = ownerUri;
|
||||
|
||||
if (proxyInfo) {
|
||||
@@ -48,7 +48,7 @@ export class ProxyData implements IAgentDialogData {
|
||||
localize('proxyData.saveSucessMessage', "Proxy '{0}' updated successfully", proxyInfo.accountName));
|
||||
} else {
|
||||
vscode.window.showInformationMessage(
|
||||
localize('proxyData.newJobSuccessMessage',"Proxy '{0}' created successfully", proxyInfo.accountName));
|
||||
localize('proxyData.newJobSuccessMessage', "Proxy '{0}' created successfully", proxyInfo.accountName));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export class ScheduleData implements IAgentDialogData {
|
||||
public schedules: azdata.AgentJobScheduleInfo[];
|
||||
public selectedSchedule: azdata.AgentJobScheduleInfo;
|
||||
|
||||
constructor(ownerUri:string) {
|
||||
constructor(ownerUri: string) {
|
||||
this.ownerUri = ownerUri;
|
||||
}
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
||||
|
||||
if (this.model.severity > 0) {
|
||||
this.severityRadioButton.checked = true;
|
||||
this.severityDropDown.value = this.severityDropDown.values[this.model.severity-1];
|
||||
this.severityDropDown.value = this.severityDropDown.values[this.model.severity - 1];
|
||||
}
|
||||
|
||||
if (this.model.databaseName) {
|
||||
@@ -382,7 +382,7 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
||||
}, {
|
||||
component: this.newJobButton,
|
||||
title: AlertDialog.NewJobButtonLabel
|
||||
}], { componentWidth: '100%'}).component();
|
||||
}], { componentWidth: '100%' }).component();
|
||||
|
||||
let previewTag = view.modelBuilder.text()
|
||||
.withProperties({
|
||||
@@ -438,7 +438,7 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
||||
}, {
|
||||
component: this.newOperatorButton,
|
||||
title: ''
|
||||
}], { componentWidth: '100%'}).component();
|
||||
}], { componentWidth: '100%' }).component();
|
||||
|
||||
let formModel = view.modelBuilder.formContainer()
|
||||
.withFormItems([{
|
||||
|
||||
@@ -259,9 +259,9 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
width: 140
|
||||
}).component();
|
||||
|
||||
this.newStepButton.onDidClick((e)=>{
|
||||
this.newStepButton.onDidClick((e) => {
|
||||
if (this.nameTextBox.value && this.nameTextBox.value.length > 0) {
|
||||
let stepDialog = new JobStepDialog(this.model.ownerUri, '' , this.model, null, true);
|
||||
let stepDialog = new JobStepDialog(this.model.ownerUri, '', this.model, null, true);
|
||||
stepDialog.onSuccess((step) => {
|
||||
let stepInfo = JobStepData.convertToAgentJobStepInfo(step);
|
||||
this.steps.push(stepInfo);
|
||||
@@ -329,7 +329,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
if (this.stepsTable.selectedRows.length === 1) {
|
||||
let rowNumber = this.stepsTable.selectedRows[0];
|
||||
let stepData = this.model.jobSteps[rowNumber];
|
||||
let editStepDialog = new JobStepDialog(this.model.ownerUri, '' , this.model, stepData, true);
|
||||
let editStepDialog = new JobStepDialog(this.model.ownerUri, '', this.model, stepData, true);
|
||||
editStepDialog.onSuccess((step) => {
|
||||
let stepInfo = JobStepData.convertToAgentJobStepInfo(step);
|
||||
for (let i = 0; i < this.steps.length; i++) {
|
||||
@@ -349,7 +349,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
}
|
||||
});
|
||||
|
||||
this.deleteStepButton.onDidClick(async() => {
|
||||
this.deleteStepButton.onDidClick(async () => {
|
||||
if (this.stepsTable.selectedRows.length === 1) {
|
||||
let rowNumber = this.stepsTable.selectedRows[0];
|
||||
AgentUtils.getAgentService().then(async (agentService) => {
|
||||
@@ -448,7 +448,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
this.alerts.push(alertInfo);
|
||||
this.alertsTable.data = this.convertAlertsToData(this.alerts);
|
||||
});
|
||||
this.newAlertButton.onDidClick(()=>{
|
||||
this.newAlertButton.onDidClick(() => {
|
||||
if (this.nameTextBox.value && this.nameTextBox.value.length > 0) {
|
||||
alertDialog.jobId = this.model.jobId;
|
||||
alertDialog.jobName = this.model.name ? this.model.name : this.nameTextBox.value;
|
||||
@@ -491,7 +491,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
label: 'Remove schedule',
|
||||
width: 100
|
||||
}).component();
|
||||
this.pickScheduleButton.onDidClick(()=>{
|
||||
this.pickScheduleButton.onDidClick(() => {
|
||||
let pickScheduleDialog = new PickScheduleDialog(this.model.ownerUri, this.model.name);
|
||||
pickScheduleDialog.onSuccess((dialogModel) => {
|
||||
let selectedSchedule = dialogModel.selectedSchedule;
|
||||
@@ -610,7 +610,8 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
{
|
||||
component: deleteJobContainer,
|
||||
title: ''
|
||||
}], title: this.NotificationsTabTopLabelString}]).withLayout({ width: '100%' }).component();
|
||||
}], title: this.NotificationsTabTopLabelString
|
||||
}]).withLayout({ width: '100%' }).component();
|
||||
|
||||
await view.initializeModel(formModel);
|
||||
this.emailConditionDropdown.values = this.model.JobCompletionActionConditions;
|
||||
|
||||
@@ -28,7 +28,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
private readonly GeneralTabText: string = localize('jobStepDialog.general', 'General');
|
||||
private readonly AdvancedTabText: string = localize('jobStepDialog.advanced', 'Advanced');
|
||||
private readonly OpenCommandText: string = localize('jobStepDialog.open', 'Open...');
|
||||
private readonly ParseCommandText: string = localize('jobStepDialog.parse','Parse');
|
||||
private readonly ParseCommandText: string = localize('jobStepDialog.parse', 'Parse');
|
||||
private readonly SuccessfulParseText: string = localize('jobStepDialog.successParse', 'The command was successfully parsed.');
|
||||
private readonly FailureParseText: string = localize('jobStepDialog.failParse', 'The command failed.');
|
||||
private readonly BlankStepNameErrorText: string = localize('jobStepDialog.blankStepName', 'The step name cannot be left blank');
|
||||
@@ -164,7 +164,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
if (this.commandTextBox.value) {
|
||||
queryProvider.parseSyntax(this.ownerUri, this.commandTextBox.value).then(result => {
|
||||
if (result && result.parseable) {
|
||||
this.dialog.message = { text: this.SuccessfulParseText, level: 2};
|
||||
this.dialog.message = { text: this.SuccessfulParseText, level: 2 };
|
||||
} else if (result && !result.parseable) {
|
||||
this.dialog.message = { text: this.FailureParseText };
|
||||
}
|
||||
@@ -246,7 +246,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
}).component();
|
||||
this.typeDropdown.onValueChanged((type) => {
|
||||
switch (type.selected) {
|
||||
case(this.TSQLScript):
|
||||
case (this.TSQLScript):
|
||||
this.runAsDropdown.value = '';
|
||||
this.runAsDropdown.values = [''];
|
||||
this.runAsDropdown.enabled = false;
|
||||
@@ -256,7 +256,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
this.processExitCodeBox.value = '';
|
||||
this.processExitCodeBox.enabled = false;
|
||||
break;
|
||||
case(this.Powershell):
|
||||
case (this.Powershell):
|
||||
this.runAsDropdown.value = this.AgentServiceAccount;
|
||||
this.runAsDropdown.values = [this.runAsDropdown.value];
|
||||
this.runAsDropdown.enabled = true;
|
||||
@@ -266,7 +266,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
this.processExitCodeBox.value = '';
|
||||
this.processExitCodeBox.enabled = false;
|
||||
break;
|
||||
case(this.CmdExec):
|
||||
case (this.CmdExec):
|
||||
this.databaseDropdown.enabled = false;
|
||||
this.databaseDropdown.values = [''];
|
||||
this.databaseDropdown.value = '';
|
||||
@@ -433,7 +433,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
.withProperties({ ownerUri: this.ownerUri, width: 420, height: 700 })
|
||||
.component();
|
||||
this.selectedPathTextBox = view.modelBuilder.inputBox()
|
||||
.withProperties({ inputType: 'text'})
|
||||
.withProperties({ inputType: 'text' })
|
||||
.component();
|
||||
this.fileBrowserTree.onDidChange((args) => {
|
||||
this.selectedPathTextBox.value = args.fullPath;
|
||||
|
||||
@@ -135,7 +135,7 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
||||
|
||||
|
||||
this.pagerTuesdayCheckBox.onChanged(() => {
|
||||
if (this.pagerTuesdayCheckBox .checked) {
|
||||
if (this.pagerTuesdayCheckBox.checked) {
|
||||
this.weekdayPagerStartTimeInput.enabled = true;
|
||||
this.weekdayPagerEndTimeInput.enabled = true;
|
||||
} else {
|
||||
@@ -153,7 +153,7 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
||||
}).component();
|
||||
|
||||
this.pagerWednesdayCheckBox.onChanged(() => {
|
||||
if (this.pagerWednesdayCheckBox .checked) {
|
||||
if (this.pagerWednesdayCheckBox.checked) {
|
||||
this.weekdayPagerStartTimeInput.enabled = true;
|
||||
this.weekdayPagerEndTimeInput.enabled = true;
|
||||
} else {
|
||||
@@ -171,7 +171,7 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
||||
}).component();
|
||||
|
||||
this.pagerThursdayCheckBox.onChanged(() => {
|
||||
if (this.pagerThursdayCheckBox .checked) {
|
||||
if (this.pagerThursdayCheckBox.checked) {
|
||||
this.weekdayPagerStartTimeInput.enabled = true;
|
||||
this.weekdayPagerEndTimeInput.enabled = true;
|
||||
} else {
|
||||
@@ -362,7 +362,7 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
||||
}, {
|
||||
component: pagerSundayCheckboxContainer,
|
||||
title: ''
|
||||
}] ,
|
||||
}],
|
||||
title: OperatorDialog.PagerDutyScheduleLabel
|
||||
}]).withLayout({ width: '100%' }).component();
|
||||
await view.initializeModel(formModel);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
'use strict';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
@@ -20,8 +20,8 @@ export class PickScheduleDialog {
|
||||
private readonly CancelButtonText: string = localize('pickSchedule.cancel', 'Cancel');
|
||||
private readonly SchedulesLabelText: string = localize('pickSchedule.availableSchedules', 'Available Schedules:');
|
||||
public static readonly ScheduleNameLabelText: string = localize('pickSchedule.scheduleName', 'Name');
|
||||
public static readonly SchedulesIDText: string = localize('pickSchedule.scheduleID','ID');
|
||||
public static readonly ScheduleDescription: string = localize('pickSchedule.description','Description');
|
||||
public static readonly SchedulesIDText: string = localize('pickSchedule.scheduleID', 'ID');
|
||||
public static readonly ScheduleDescription: string = localize('pickSchedule.description', 'Description');
|
||||
|
||||
|
||||
// UI Components
|
||||
@@ -74,7 +74,7 @@ export class PickScheduleDialog {
|
||||
let data: any[][] = [];
|
||||
for (let i = 0; i < this.model.schedules.length; ++i) {
|
||||
let schedule = this.model.schedules[i];
|
||||
data[i] = [ schedule.id, schedule.name, schedule.description ];
|
||||
data[i] = [schedule.id, schedule.name, schedule.description];
|
||||
}
|
||||
this.schedulesTable.data = data;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ export class ProxyDialog extends AgentDialog<ProxyData> {
|
||||
this.generalTab.registerContent(async view => {
|
||||
|
||||
this.proxyNameTextBox = view.modelBuilder.inputBox()
|
||||
.withProperties({width: 420})
|
||||
.withProperties({ width: 420 })
|
||||
.component();
|
||||
|
||||
this.credentialNameDropDown = view.modelBuilder.dropDown()
|
||||
|
||||
@@ -69,7 +69,7 @@ export class ScheduleDialog {
|
||||
let data: any[][] = [];
|
||||
for (let i = 0; i < this.model.schedules.length; ++i) {
|
||||
let schedule = this.model.schedules[i];
|
||||
data[i] = [ schedule.name ];
|
||||
data[i] = [schedule.name];
|
||||
}
|
||||
this.schedulesTable.data = data;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export class MainController {
|
||||
dialog.dialogName ? await dialog.openDialog(dialog.dialogName) : await dialog.openDialog();
|
||||
});
|
||||
vscode.commands.registerCommand('agent.openNewStepDialog', (ownerUri: string, server: string, jobInfo: azdata.AgentJobInfo, jobStepInfo: azdata.AgentJobStepInfo) => {
|
||||
AgentUtils.getAgentService().then(async(agentService) => {
|
||||
AgentUtils.getAgentService().then(async (agentService) => {
|
||||
let jobData: JobData = new JobData(ownerUri, jobInfo, agentService);
|
||||
let dialog = new JobStepDialog(ownerUri, server, jobData, jobStepInfo, false);
|
||||
dialog.dialogName ? await dialog.openDialog(dialog.dialogName) : await dialog.openDialog();
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"moduleResolution": "node",
|
||||
"declaration": true
|
||||
"moduleResolution": "node"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as adal from 'adal-node';
|
||||
import * as azdata from 'azdata';
|
||||
import * as request from 'request';
|
||||
@@ -54,8 +52,8 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
||||
|
||||
/**
|
||||
* Clears all tokens that belong to the given account from the token cache
|
||||
* @param {"data".AccountKey} accountKey Key identifying the account to delete tokens for
|
||||
* @returns {Thenable<void>} Promise to clear requested tokens from the token cache
|
||||
* @param accountKey Key identifying the account to delete tokens for
|
||||
* @returns Promise to clear requested tokens from the token cache
|
||||
*/
|
||||
public clear(accountKey: azdata.AccountKey): Thenable<void> {
|
||||
return this.doIfInitialized(() => this.clearAccountTokens(accountKey));
|
||||
@@ -63,7 +61,7 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
||||
|
||||
/**
|
||||
* Clears the entire token cache. Invoked by command palette action.
|
||||
* @returns {Thenable<void>} Promise to clear the token cache
|
||||
* @returns Promise to clear the token cache
|
||||
*/
|
||||
public clearTokenCache(): Thenable<void> {
|
||||
return this._tokenCache.clear();
|
||||
@@ -321,10 +319,10 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
||||
* Retrieves a token for the given user ID for the specific tenant ID. If the token can, it
|
||||
* will be retrieved from the cache as per the ADAL API. AFAIK, the ADAL API will also utilize
|
||||
* the refresh token if there aren't any unexpired tokens to use.
|
||||
* @param {string} userId ID of the user to get a token for
|
||||
* @param {string} tenantId Tenant to get the token for
|
||||
* @param {string} resourceId ID of the resource the token will be good for
|
||||
* @returns {Thenable<TokenResponse>} Promise to return a token. Rejected if retrieving the token fails.
|
||||
* @param userId ID of the user to get a token for
|
||||
* @param tenantId Tenant to get the token for
|
||||
* @param resourceId ID of the resource the token will be good for
|
||||
* @returns Promise to return a token. Rejected if retrieving the token fails.
|
||||
*/
|
||||
private getToken(userId: string, tenantId: string, resourceId: string): Thenable<adal.TokenResponse> {
|
||||
let self = this;
|
||||
@@ -346,9 +344,9 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
||||
|
||||
/**
|
||||
* Performs a web request using the provided bearer token
|
||||
* @param {TokenResponse} accessToken Bearer token for accessing the provided URI
|
||||
* @param {string} uri URI to access
|
||||
* @returns {Thenable<any>} Promise to return the deserialized body of the request. Rejected if error occurred.
|
||||
* @param accessToken Bearer token for accessing the provided URI
|
||||
* @param uri URI to access
|
||||
* @returns Promise to return the deserialized body of the request. Rejected if error occurred.
|
||||
*/
|
||||
private makeWebRequest(accessToken: adal.TokenResponse, uri: string): Thenable<any> {
|
||||
return new Promise<any>((resolve, reject) => {
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as adal from 'adal-node';
|
||||
import * as azdata from 'azdata';
|
||||
import * as crypto from 'crypto';
|
||||
@@ -79,7 +77,7 @@ export default class TokenCache implements adal.TokenCache {
|
||||
/**
|
||||
* Wrapper to make callback-based find method into a thenable method
|
||||
* @param query Partial object to use to look up tokens. Ideally should be partial of adal.TokenResponse
|
||||
* @returns {Thenable<any[]>} Promise to return the matching adal.TokenResponse objects.
|
||||
* @returns Promise to return the matching adal.TokenResponse objects.
|
||||
* Rejected if an error was sent in the callback
|
||||
*/
|
||||
public findThenable(query: any): Thenable<any[]> {
|
||||
@@ -112,8 +110,8 @@ export default class TokenCache implements adal.TokenCache {
|
||||
|
||||
/**
|
||||
* Wrapper to make callback-based remove method into a thenable method
|
||||
* @param {TokenResponse[]} entries Array of entries to remove from the token cache
|
||||
* @returns {Thenable<void>} Promise to remove the given tokens from the token cache
|
||||
* @param entries Array of entries to remove from the token cache
|
||||
* @returns Promise to remove the given tokens from the token cache
|
||||
* Rejected if an error was sent in the callback
|
||||
*/
|
||||
public removeThenable(entries: adal.TokenResponse[]): Thenable<void> {
|
||||
@@ -186,8 +184,8 @@ export default class TokenCache implements adal.TokenCache {
|
||||
if (splitValues.length === 2 && splitValues[0] && splitValues[1]) {
|
||||
try {
|
||||
return <EncryptionParams>{
|
||||
key: new Buffer(splitValues[0], 'hex'),
|
||||
initializationVector: new Buffer(splitValues[1], 'hex')
|
||||
key: Buffer.from(splitValues[0], 'hex'),
|
||||
initializationVector: Buffer.from(splitValues[1], 'hex')
|
||||
};
|
||||
} catch (e) {
|
||||
// Swallow the error and fall through to generate new params
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
@@ -15,7 +13,6 @@ import * as constants from './constants';
|
||||
* this API from our code
|
||||
*
|
||||
* @export
|
||||
* @class ApiWrapper
|
||||
*/
|
||||
export class ApiWrapper {
|
||||
// Data APIs
|
||||
|
||||
@@ -16,8 +16,7 @@ import { AzureResourceResourceTreeNode } from '../../resourceTreeNode';
|
||||
|
||||
export function registerAzureResourceDatabaseCommands(appContext: AppContext): void {
|
||||
appContext.apiWrapper.registerCommand('azure.resource.connectsqldb', async (node?: TreeNode) => {
|
||||
if (!node)
|
||||
{
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@ import { AzureResourceResourceTreeNode } from '../../resourceTreeNode';
|
||||
|
||||
export function registerAzureResourceDatabaseServerCommands(appContext: AppContext): void {
|
||||
appContext.apiWrapper.registerCommand('azure.resource.connectsqlserver', async (node?: TreeNode) => {
|
||||
if (!node)
|
||||
{
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import { azureResource } from '../azure-resource';
|
||||
import { IAzureResourceSubscriptionFilterService, IAzureResourceCacheService } from '../interfaces';
|
||||
|
||||
interface AzureResourceSelectedSubscriptionsCache {
|
||||
selectedSubscriptions: { [accountId: string]: azureResource.AzureResourceSubscription[]};
|
||||
selectedSubscriptions: { [accountId: string]: azureResource.AzureResourceSubscription[] };
|
||||
}
|
||||
|
||||
export class AzureResourceSubscriptionFilterService implements IAzureResourceSubscriptionFilterService {
|
||||
@@ -36,7 +36,7 @@ export class AzureResourceSubscriptionFilterService implements IAzureResourceSub
|
||||
}
|
||||
|
||||
public async saveSelectedSubscriptions(account: Account, selectedSubscriptions: azureResource.AzureResourceSubscription[]): Promise<void> {
|
||||
let selectedSubscriptionsCache: { [accountId: string]: azureResource.AzureResourceSubscription[]} = {};
|
||||
let selectedSubscriptionsCache: { [accountId: string]: azureResource.AzureResourceSubscription[] } = {};
|
||||
|
||||
const cache = this._cacheService.get<AzureResourceSelectedSubscriptionsCache>(this._cacheKey);
|
||||
if (cache) {
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
@@ -13,7 +13,8 @@ import {
|
||||
IAzureResourceAccountService,
|
||||
IAzureResourceSubscriptionService,
|
||||
IAzureResourceSubscriptionFilterService,
|
||||
IAzureResourceTenantService } from '../azureResource/interfaces';
|
||||
IAzureResourceTenantService
|
||||
} from '../azureResource/interfaces';
|
||||
import { AzureResourceServiceNames } from '../azureResource/constants';
|
||||
import { AzureResourceTreeProvider } from '../azureResource/tree/treeProvider';
|
||||
import { registerAzureResourceCommands } from '../azureResource/commands';
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
'use strict';
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 * as fs from 'fs';
|
||||
@@ -23,7 +26,7 @@ let controllers: ControllerBase[] = [];
|
||||
// The function is a duplicate of \src\paths.js. IT would be better to import path.js but it doesn't
|
||||
// work for now because the extension is running in different process.
|
||||
export function getAppDataPath() {
|
||||
var platform = process.platform;
|
||||
let platform = process.platform;
|
||||
switch (platform) {
|
||||
case 'win32': return process.env['APPDATA'] || path.join(process.env['USERPROFILE'], 'AppData', 'Roaming');
|
||||
case 'darwin': return path.join(os.homedir(), 'Library', 'Application Support');
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { Shell } from '../utility/shell';
|
||||
@@ -56,8 +56,8 @@ export function execPath(shell: Shell, basePath: string): string {
|
||||
}
|
||||
|
||||
type CheckPresentFailureReason = 'inferFailed' | 'configuredFileMissing';
|
||||
const installDependenciesAction = localize('installDependenciesAction','Install dependencies');
|
||||
const learnMoreAction = localize('learnMoreAction','Learn more');
|
||||
const installDependenciesAction = localize('installDependenciesAction', 'Install dependencies');
|
||||
const learnMoreAction = localize('learnMoreAction', 'Learn more');
|
||||
function alertNoBin(host: Host, binName: string, failureReason: CheckPresentFailureReason, message: string, installDependencies: () => void): void {
|
||||
switch (failureReason) {
|
||||
case 'inferFailed':
|
||||
|
||||
@@ -14,11 +14,11 @@ export interface Host {
|
||||
}
|
||||
|
||||
export const host: Host = {
|
||||
showErrorMessage : showErrorMessage,
|
||||
showWarningMessage : showWarningMessage,
|
||||
showInformationMessage : showInformationMessage,
|
||||
getConfiguration : getConfiguration,
|
||||
onDidChangeConfiguration : onDidChangeConfiguration,
|
||||
showErrorMessage: showErrorMessage,
|
||||
showWarningMessage: showWarningMessage,
|
||||
showInformationMessage: showInformationMessage,
|
||||
getConfiguration: getConfiguration,
|
||||
onDidChangeConfiguration: onDidChangeConfiguration,
|
||||
};
|
||||
|
||||
function showErrorMessage(message: string, ...items: string[]): Thenable<string | undefined> {
|
||||
|
||||
@@ -32,7 +32,7 @@ interface Context {
|
||||
|
||||
class KubectlImpl implements Kubectl {
|
||||
constructor(host: Host, fs: FS, shell: Shell, installDependenciesCallback: () => void, kubectlFound: boolean) {
|
||||
this.context = { host : host, fs : fs, shell : shell, installDependenciesCallback : installDependenciesCallback, binFound : kubectlFound, binPath : 'kubectl' };
|
||||
this.context = { host: host, fs: fs, shell: shell, installDependenciesCallback: installDependenciesCallback, binFound: kubectlFound, binPath: 'kubectl' };
|
||||
}
|
||||
|
||||
readonly context: Context;
|
||||
@@ -83,7 +83,7 @@ async function checkForKubectlInternal(context: Context, errorMessageMode: Check
|
||||
|
||||
function getCheckKubectlContextMessage(errorMessageMode: CheckPresentMessageMode): string {
|
||||
if (errorMessageMode === CheckPresentMessageMode.Activation) {
|
||||
return localize('kubernetesRequired',' SQL Server Big data cluster requires kubernetes.');
|
||||
return localize('kubernetesRequired', ' SQL Server Big data cluster requires kubernetes.');
|
||||
} else if (errorMessageMode === CheckPresentMessageMode.Command) {
|
||||
return localize('cannotExecuteCmd', ' Cannot execute command.');
|
||||
}
|
||||
@@ -138,5 +138,5 @@ async function asJson<T>(context: Context, command: string): Promise<Errorable<T
|
||||
return { succeeded: true, result: JSON.parse(shellResult.stdout.trim()) as T };
|
||||
|
||||
}
|
||||
return { succeeded: false, error: [ shellResult.stderr ] };
|
||||
return { succeeded: false, error: [shellResult.stderr] };
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import { Kubectl } from './kubectl/kubectl';
|
||||
*/
|
||||
export class MainController {
|
||||
protected _context: vscode.ExtensionContext;
|
||||
protected _kubectl : Kubectl;
|
||||
protected _kubectl: Kubectl;
|
||||
|
||||
public constructor(context: vscode.ExtensionContext, kubectl: Kubectl) {
|
||||
this._context = context;
|
||||
|
||||
@@ -11,16 +11,16 @@ import mkdirp = require('mkdirp');
|
||||
import { Kubectl, baseKubectlPath } from '../kubectl/kubectl';
|
||||
import { KubectlContext } from '../kubectl/kubectlUtils';
|
||||
|
||||
export interface Scriptable {
|
||||
export interface Scriptable {
|
||||
getScriptProperties(): Promise<ScriptingDictionary<string>>;
|
||||
getTargetKubectlContext() : KubectlContext;
|
||||
}
|
||||
getTargetKubectlContext(): KubectlContext;
|
||||
}
|
||||
|
||||
export interface ScriptingDictionary<V> {
|
||||
export interface ScriptingDictionary<V> {
|
||||
[name: string]: V;
|
||||
}
|
||||
|
||||
const deployFilePrefix : string = 'mssql-bdc-deploy';
|
||||
const deployFilePrefix: string = 'mssql-bdc-deploy';
|
||||
export class ScriptGenerator {
|
||||
|
||||
private _shell: Shell;
|
||||
@@ -33,7 +33,7 @@ export class ScriptGenerator {
|
||||
this._kubectlPath = baseKubectlPath(this._kubectl.getContext());
|
||||
}
|
||||
|
||||
public async generateDeploymentScript(scriptable: Scriptable) : Promise<void> {
|
||||
public async generateDeploymentScript(scriptable: Scriptable): Promise<void> {
|
||||
let targetClusterName = scriptable.getTargetKubectlContext().clusterName;
|
||||
let targetContextName = scriptable.getTargetKubectlContext().contextName;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ export enum Platform {
|
||||
Unsupported,
|
||||
}
|
||||
|
||||
export interface ExecCallback extends shelljs.ExecCallback {}
|
||||
export interface ExecCallback extends shelljs.ExecCallback { }
|
||||
|
||||
export interface Shell {
|
||||
isWindows(): boolean;
|
||||
@@ -37,16 +37,16 @@ export interface Shell {
|
||||
}
|
||||
|
||||
export const shell: Shell = {
|
||||
isWindows : isWindows,
|
||||
isUnix : isUnix,
|
||||
platform : platform,
|
||||
home : home,
|
||||
combinePath : combinePath,
|
||||
fileUri : fileUri,
|
||||
execOpts : execOpts,
|
||||
exec : exec,
|
||||
execCore : execCore,
|
||||
unquotedPath : unquotedPath,
|
||||
isWindows: isWindows,
|
||||
isUnix: isUnix,
|
||||
platform: platform,
|
||||
home: home,
|
||||
combinePath: combinePath,
|
||||
fileUri: fileUri,
|
||||
execOpts: execOpts,
|
||||
exec: exec,
|
||||
execCore: execCore,
|
||||
unquotedPath: unquotedPath,
|
||||
which: which,
|
||||
cat: cat,
|
||||
ls: ls,
|
||||
@@ -113,7 +113,7 @@ function fileUri(filePath: string): vscode.Uri {
|
||||
function execOpts(): any {
|
||||
let env = process.env;
|
||||
if (isWindows()) {
|
||||
env = Object.assign({ }, env, { HOME: home() });
|
||||
env = Object.assign({}, env, { HOME: home() });
|
||||
}
|
||||
env = shellEnvironment(env);
|
||||
const opts = {
|
||||
@@ -135,7 +135,7 @@ async function exec(cmd: string, stdin?: string): Promise<ShellResult | undefine
|
||||
|
||||
function execCore(cmd: string, opts: any, stdin?: string): Promise<ShellResult> {
|
||||
return new Promise<ShellResult>((resolve) => {
|
||||
const proc = shelljs.exec(cmd, opts, (code, stdout, stderr) => resolve({code : code, stdout : stdout, stderr : stderr}));
|
||||
const proc = shelljs.exec(cmd, opts, (code, stdout, stderr) => resolve({ code: code, stdout: stdout, stderr: stderr }));
|
||||
if (stdin) {
|
||||
proc.stdin.end(stdin);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { WizardPageBase } from '../../wizardPageBase';
|
||||
import { CreateClusterWizard } from '../createClusterWizard';
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -347,7 +345,7 @@ export class ClusterProfilePage extends WizardPageBase<CreateClusterWizard> {
|
||||
case ClusterPoolType.Spark:
|
||||
return localize('bdc-create.SparkPoolDisplayName', 'Spark pool');
|
||||
default:
|
||||
throw 'unknown pool type';
|
||||
throw new Error('unknown pool type');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,7 +362,7 @@ export class ClusterProfilePage extends WizardPageBase<CreateClusterWizard> {
|
||||
case ClusterPoolType.Spark:
|
||||
return localize('bdc-create.SparkPoolDescription', 'TODO: Add description');
|
||||
default:
|
||||
throw 'unknown pool type';
|
||||
throw new Error('unknown pool type');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import { WizardPageBase } from '../../wizardPageBase';
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import { DacFxDataModel } from './models';
|
||||
@@ -15,19 +14,16 @@ export abstract class BasePage {
|
||||
|
||||
/**
|
||||
* This method constructs all the elements of the page.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
public async abstract start(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* This method is called when the user is entering the page.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
public async abstract onPageEnter(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* This method is called when the user is leaving the page.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
async onPageLeave(): Promise<boolean> {
|
||||
return true;
|
||||
@@ -35,7 +31,6 @@ export abstract class BasePage {
|
||||
|
||||
/**
|
||||
* Override this method to cleanup what you don't need cached in the page.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
public async cleanup(): Promise<boolean> {
|
||||
return true;
|
||||
@@ -136,4 +131,3 @@ export abstract class BasePage {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -2,13 +2,9 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { RequestType, NotificationType } from 'vscode-languageclient';
|
||||
|
||||
/**
|
||||
* @interface IMessage
|
||||
*/
|
||||
export interface IMessage {
|
||||
jsonrpc: string;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as path from 'path';
|
||||
import * as crypto from 'crypto';
|
||||
@@ -97,7 +96,7 @@ export function generateGuid(): string {
|
||||
}
|
||||
|
||||
export function verifyPlatform(): Thenable<boolean> {
|
||||
if (os.platform() === 'darwin' && parseFloat(os.release()) < 16.0) {
|
||||
if (os.platform() === 'darwin' && parseFloat(os.release()) < 16) {
|
||||
return Promise.resolve(false);
|
||||
} else {
|
||||
return Promise.resolve(true);
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { ErrorAction, CloseAction } from 'vscode-languageclient';
|
||||
import TelemetryReporter from 'vscode-extension-telemetry';
|
||||
import { PlatformInformation } from 'service-downloader/out/platform';
|
||||
@@ -20,7 +18,6 @@ import { IMessage, ITelemetryEventProperties, ITelemetryEventMeasures } from './
|
||||
|
||||
/**
|
||||
* Handle Language Service client errors
|
||||
* @class LanguageClientErrorHandler
|
||||
*/
|
||||
export class LanguageClientErrorHandler {
|
||||
|
||||
@@ -53,11 +50,6 @@ export class LanguageClientErrorHandler {
|
||||
/**
|
||||
* Callback for language service client error
|
||||
*
|
||||
* @param {Error} error
|
||||
* @param {Message} message
|
||||
* @param {number} count
|
||||
* @returns {ErrorAction}
|
||||
*
|
||||
* @memberOf LanguageClientErrorHandler
|
||||
*/
|
||||
error(error: Error, message: IMessage, count: number): ErrorAction {
|
||||
@@ -71,8 +63,6 @@ export class LanguageClientErrorHandler {
|
||||
/**
|
||||
* Callback for language service client closed
|
||||
*
|
||||
* @returns {CloseAction}
|
||||
*
|
||||
* @memberOf LanguageClientErrorHandler
|
||||
*/
|
||||
closed(): CloseAction {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import { ImportDataModel } from './models';
|
||||
@@ -15,19 +14,16 @@ export abstract class BasePage {
|
||||
|
||||
/**
|
||||
* This method constructs all the elements of the page.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
public async abstract start(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* This method is called when the user is entering the page.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
public async abstract onPageEnter(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* This method is called when the user is leaving the page.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
async onPageLeave(): Promise<boolean> {
|
||||
return true;
|
||||
@@ -35,7 +31,6 @@ export abstract class BasePage {
|
||||
|
||||
/**
|
||||
* Override this method to cleanup what you don't need cached in the page.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
public async cleanup(): Promise<boolean> {
|
||||
return true;
|
||||
@@ -136,4 +131,3 @@ export abstract class BasePage {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
@@ -133,7 +131,6 @@ export class SummaryPage extends ImportPage {
|
||||
|
||||
/**
|
||||
* Gets the connection string to send to the middleware
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
private async getConnectionString(): Promise<string> {
|
||||
let options = this.model.server.options;
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
const fs = require('fs');
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import { normalize, join } from 'path';
|
||||
@@ -12,10 +12,10 @@ const TEST_SETUP_COMPLETED_TEXT: string = 'Test Setup Completed';
|
||||
const EXTENSION_LOADED_TEXT: string = 'Test Extension Loaded';
|
||||
const ALL_EXTENSION_LOADED_TEXT: string = 'All Extensions Loaded';
|
||||
|
||||
var statusBarItemTimer: NodeJS.Timer;
|
||||
let statusBarItemTimer: NodeJS.Timer;
|
||||
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
var statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
|
||||
let statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
|
||||
vscode.commands.registerCommand('test.setupIntegrationTest', async () => {
|
||||
let extensionInstallersFolder = normalize(join(__dirname, '../extensionInstallers'));
|
||||
let installers = fs.readdirSync(extensionInstallersFolder);
|
||||
|
||||
@@ -41,8 +41,8 @@ export enum EngineType {
|
||||
BigDataCluster
|
||||
}
|
||||
|
||||
var connectionProviderMapping = {};
|
||||
var authenticationTypeMapping = {};
|
||||
let connectionProviderMapping = {};
|
||||
let authenticationTypeMapping = {};
|
||||
connectionProviderMapping[ConnectionProvider.SQLServer] = { name: 'MSSQL', displayName: 'Microsoft SQL Server' };
|
||||
|
||||
authenticationTypeMapping[AuthenticationType.SqlLogin] = { name: 'SqlLogin', displayName: 'SQL Login' };
|
||||
@@ -80,7 +80,7 @@ export class TestServerProfile {
|
||||
public get engineType(): EngineType { return this._profile.engineType; }
|
||||
}
|
||||
|
||||
var TestingServers: TestServerProfile[] = [
|
||||
let TestingServers: TestServerProfile[] = [
|
||||
new TestServerProfile(
|
||||
{
|
||||
serverName: getConfigValue(EnvironmentVariable_STANDALONE_SERVER),
|
||||
@@ -121,7 +121,7 @@ function getEnumMappingEntry(mapping: any, enumValue: any): INameDisplayNamePair
|
||||
if (entry) {
|
||||
return entry;
|
||||
} else {
|
||||
throw `Unknown enum type: ${enumValue.toString()}`;
|
||||
throw new Error(`Unknown enum type: ${enumValue.toString()}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export var context = {
|
||||
export let context = {
|
||||
RunTest: true
|
||||
};
|
||||
-54
@@ -10,24 +10,17 @@ import * as vscode from 'vscode';
|
||||
|
||||
/**
|
||||
* The APIs provided by Mssql extension
|
||||
*
|
||||
* @export
|
||||
* @interface MssqlExtensionApi
|
||||
*/
|
||||
export interface MssqlExtensionApi {
|
||||
/**
|
||||
* Gets the object explorer API that supports querying over the connections supported by this extension
|
||||
*
|
||||
* @returns {IMssqlObjectExplorerBrowser}
|
||||
* @memberof IMssqlExtensionApi
|
||||
*/
|
||||
getMssqlObjectExplorerBrowser(): MssqlObjectExplorerBrowser;
|
||||
|
||||
/**
|
||||
* Get the Cms Service APIs to communicate with CMS connections supported by this extension
|
||||
*
|
||||
* @returns {Promise<CmsService>}
|
||||
* @memberof IMssqlExtensionApi
|
||||
*/
|
||||
getCmsServiceProvider(): Promise<CmsService>;
|
||||
}
|
||||
@@ -35,25 +28,16 @@ export interface MssqlExtensionApi {
|
||||
/**
|
||||
* A browser supporting actions over the object explorer connections provided by this extension.
|
||||
* Currently this is the
|
||||
*
|
||||
* @export
|
||||
* @interface MssqlObjectExplorerBrowser
|
||||
*/
|
||||
export interface MssqlObjectExplorerBrowser {
|
||||
/**
|
||||
* Gets the matching node given a context object, e.g. one from a right-click on a node in Object Explorer
|
||||
*
|
||||
* @param {azdata.ObjectExplorerContext} objectExplorerContext
|
||||
* @returns {Promise<T>}
|
||||
*/
|
||||
getNode<T extends ITreeNode>(objectExplorerContext: azdata.ObjectExplorerContext): Promise<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
* A tree node in the object explorer tree
|
||||
*
|
||||
* @export
|
||||
* @interface ITreeNode
|
||||
*/
|
||||
export interface ITreeNode {
|
||||
getNodeInfo(): azdata.NodeInfo;
|
||||
@@ -63,10 +47,6 @@ export interface ITreeNode {
|
||||
/**
|
||||
* A HDFS file node. This is a leaf node in the object explorer tree, and its contents
|
||||
* can be queried
|
||||
*
|
||||
* @export
|
||||
* @interface IFileNode
|
||||
* @extends {ITreeNode}
|
||||
*/
|
||||
export interface IFileNode extends ITreeNode {
|
||||
getFileContentsAsString(maxBytes?: number): Promise<string>;
|
||||
@@ -79,64 +59,31 @@ export interface IFileNode extends ITreeNode {
|
||||
export interface CmsService {
|
||||
/**
|
||||
* Connects to or creates a Central management Server
|
||||
*
|
||||
* @param {string} name
|
||||
* @param {string} description
|
||||
* @param {azdata.ConnectionInfo} connectiondetails
|
||||
* @param {string} ownerUri
|
||||
* @returns {Thenable<azdata.ListRegisteredServersResult>}
|
||||
*/
|
||||
createCmsServer(name: string, description:string, connectiondetails: azdata.ConnectionInfo, ownerUri: string): Thenable<ListRegisteredServersResult>;
|
||||
|
||||
/**
|
||||
* gets all Registered Servers inside a CMS on a particular level
|
||||
*
|
||||
* @param {string} ownerUri
|
||||
* @param {string} relativePath
|
||||
* @returns {Thenable<azdata.ListRegisteredServersResult>}
|
||||
*/
|
||||
getRegisteredServers(ownerUri: string, relativePath: string): Thenable<ListRegisteredServersResult>;
|
||||
|
||||
/**
|
||||
* Adds a Registered Server inside a CMS on a particular level
|
||||
*
|
||||
* @param {string} ownerUri
|
||||
* @param {string} relativePath
|
||||
* @param {string} registeredServerName
|
||||
* @param {string} registeredServerDescription
|
||||
* @param {azdata.ConnectionInfo} connectiondetails
|
||||
* @returns {Thenable<boolean>>}
|
||||
*/
|
||||
addRegisteredServer (ownerUri: string, relativePath: string, registeredServerName: string, registeredServerDescription:string, connectionDetails:azdata.ConnectionInfo): Thenable<boolean>;
|
||||
|
||||
/**
|
||||
* Removes a Registered Server inside a CMS on a particular level
|
||||
*
|
||||
* @param {string} ownerUri
|
||||
* @param {string} relativePath
|
||||
* @param {string} registeredServerName
|
||||
* @returns {Thenable<boolean>}
|
||||
*/
|
||||
removeRegisteredServer (ownerUri: string, relativePath: string, registeredServerName: string): Thenable<boolean>;
|
||||
|
||||
/**
|
||||
* Adds a Server Group inside a CMS on a particular level
|
||||
*
|
||||
* @param {string} ownerUri
|
||||
* @param {string} relativePath
|
||||
* @param {string} groupName
|
||||
* @param {string} groupDescription
|
||||
* @param {azdata.ConnectionInfo} connectiondetails
|
||||
*/
|
||||
addServerGroup (ownerUri: string, relativePath: string, groupName: string, groupDescription:string): Thenable<boolean>;
|
||||
|
||||
/**
|
||||
* Removes a Server Group inside a CMS on a particular level
|
||||
*
|
||||
* @param {string} ownerUri
|
||||
* @param {string} relativePath
|
||||
* @param {string} groupName
|
||||
* @param {string} groupDescription
|
||||
*/
|
||||
removeServerGroup (ownerUri: string, relativePath: string, groupName: string): Thenable<boolean>;
|
||||
}
|
||||
@@ -162,4 +109,3 @@ export interface ListRegisteredServersResult {
|
||||
registeredServersList: Array<RegisteredServerResult>;
|
||||
registeredServerGroups: Array<RegisteredServerGroup>;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
@@ -13,7 +11,6 @@ import * as azdata from 'azdata';
|
||||
* this API from our code
|
||||
*
|
||||
* @export
|
||||
* @class ApiWrapper
|
||||
*/
|
||||
export class ApiWrapper {
|
||||
// Data APIs
|
||||
|
||||
@@ -20,9 +20,9 @@ export class CmsService {
|
||||
this.appContext.registerService<CmsService>(constants.CmsService, this);
|
||||
}
|
||||
|
||||
createCmsServer(name: string, description:string, connectiondetails: azdata.ConnectionInfo, ownerUri: string): Thenable<ListRegisteredServersResult> {
|
||||
createCmsServer(name: string, description: string, connectiondetails: azdata.ConnectionInfo, ownerUri: string): Thenable<ListRegisteredServersResult> {
|
||||
let connectparams: ConnectParams = { ownerUri: ownerUri, connection: connectiondetails };
|
||||
let cmsparams: contracts.CreateCentralManagementServerParams = { registeredServerName: name, registeredServerDescription: description, connectParams: connectparams};
|
||||
let cmsparams: contracts.CreateCentralManagementServerParams = { registeredServerName: name, registeredServerDescription: description, connectParams: connectparams };
|
||||
|
||||
return this.client.sendRequest(contracts.CreateCentralManagementServerRequest.type, cmsparams).then(
|
||||
r => {
|
||||
@@ -48,7 +48,7 @@ export class CmsService {
|
||||
);
|
||||
}
|
||||
|
||||
addRegisteredServer (ownerUri: string, relativePath: string, registeredServerName: string, registeredServerDescription:string, connectionDetails:azdata.ConnectionInfo): Thenable<boolean> {
|
||||
addRegisteredServer(ownerUri: string, relativePath: string, registeredServerName: string, registeredServerDescription: string, connectionDetails: azdata.ConnectionInfo): Thenable<boolean> {
|
||||
let params: contracts.AddRegisteredServerParams = { parentOwnerUri: ownerUri, relativePath: relativePath, registeredServerName: registeredServerName, registeredServerDescription: registeredServerDescription, registeredServerConnectionDetails: connectionDetails };
|
||||
return this.client.sendRequest(contracts.AddRegisteredServerRequest.type, params).then(
|
||||
r => {
|
||||
@@ -61,7 +61,7 @@ export class CmsService {
|
||||
);
|
||||
}
|
||||
|
||||
removeRegisteredServer (ownerUri: string, relativePath: string, registeredServerName: string): Thenable<boolean> {
|
||||
removeRegisteredServer(ownerUri: string, relativePath: string, registeredServerName: string): Thenable<boolean> {
|
||||
let params: contracts.RemoveRegisteredServerParams = { parentOwnerUri: ownerUri, relativePath: relativePath, registeredServerName: registeredServerName };
|
||||
return this.client.sendRequest(contracts.RemoveRegisteredServerRequest.type, params).then(
|
||||
r => {
|
||||
@@ -74,7 +74,7 @@ export class CmsService {
|
||||
);
|
||||
}
|
||||
|
||||
addServerGroup (ownerUri: string, relativePath: string, groupName: string, groupDescription:string): Thenable<boolean> {
|
||||
addServerGroup(ownerUri: string, relativePath: string, groupName: string, groupDescription: string): Thenable<boolean> {
|
||||
let params: contracts.AddServerGroupParams = { parentOwnerUri: ownerUri, relativePath: relativePath, groupName: groupName, groupDescription: groupDescription };
|
||||
return this.client.sendRequest(contracts.AddServerGroupRequest.type, params).then(
|
||||
r => {
|
||||
@@ -87,7 +87,7 @@ export class CmsService {
|
||||
);
|
||||
}
|
||||
|
||||
removeServerGroup (ownerUri: string, relativePath: string, groupName: string): Thenable<boolean> {
|
||||
removeServerGroup(ownerUri: string, relativePath: string, groupName: string): Thenable<boolean> {
|
||||
let params: contracts.RemoveServerGroupParams = { parentOwnerUri: ownerUri, relativePath: relativePath, groupName: groupName };
|
||||
return this.client.sendRequest(contracts.RemoveServerGroupRequest.type, params).then(
|
||||
r => {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { NotificationType, RequestType } from 'vscode-languageclient';
|
||||
import { ITelemetryEventProperties, ITelemetryEventMeasures } from './telemetry';
|
||||
@@ -378,7 +377,7 @@ export namespace GenerateDeployPlanRequest {
|
||||
|
||||
export interface CreateCentralManagementServerParams {
|
||||
registeredServerName: string;
|
||||
registeredServerDescription : string;
|
||||
registeredServerDescription: string;
|
||||
connectParams: ConnectParams;
|
||||
}
|
||||
|
||||
@@ -388,7 +387,7 @@ export interface ListRegisteredServersParams extends RegisteredServerParamsBase
|
||||
|
||||
export interface AddRegisteredServerParams extends RegisteredServerParamsBase {
|
||||
registeredServerName: string;
|
||||
registeredServerDescription : string;
|
||||
registeredServerDescription: string;
|
||||
registeredServerConnectionDetails: azdata.ConnectionInfo;
|
||||
}
|
||||
|
||||
@@ -442,7 +441,7 @@ export interface SchemaCompareParams {
|
||||
taskExecutionMode: TaskExecutionMode;
|
||||
}
|
||||
|
||||
export interface SchemaCompareGenerateScriptParams {
|
||||
export interface SchemaCompareGenerateScriptParams {
|
||||
operationId: string;
|
||||
targetDatabaseName: string;
|
||||
scriptFilePath: string;
|
||||
@@ -453,7 +452,7 @@ export namespace SchemaCompareRequest {
|
||||
export const type = new RequestType<SchemaCompareParams, azdata.SchemaCompareResult, void, void>('schemaCompare/compare');
|
||||
}
|
||||
|
||||
export namespace SchemaCompareGenerateScriptRequest {
|
||||
export namespace SchemaCompareGenerateScriptRequest {
|
||||
export const type = new RequestType<SchemaCompareGenerateScriptParams, azdata.ResultStatus, void, void>('schemaCompare/generateScript');
|
||||
}
|
||||
// ------------------------------- <Schema Compare> -----------------------------
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
export default require('error-ex')('EscapeException');
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { SqlOpsDataClient, SqlOpsFeature } from 'dataprotocol-client';
|
||||
import { ClientCapabilities, StaticFeature, RPCMessageType, ServerCapabilities } from 'vscode-languageclient';
|
||||
@@ -12,7 +11,6 @@ import * as contracts from './contracts';
|
||||
import * as azdata from 'azdata';
|
||||
import * as Utils from './utils';
|
||||
import * as UUID from 'vscode-languageclient/lib/utils/uuid';
|
||||
import { ConnectParams } from 'dataprotocol-client/lib/protocol';
|
||||
|
||||
export class TelemetryFeature implements StaticFeature {
|
||||
|
||||
@@ -170,7 +168,7 @@ export class SchemaCompareServicesFeature extends SqlOpsFeature<undefined> {
|
||||
let self = this;
|
||||
|
||||
let schemaCompare = (sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.SchemaCompareResult> => {
|
||||
let params: contracts.SchemaCompareParams = {sourceEndpointInfo: sourceEndpointInfo, targetEndpointInfo: targetEndpointInfo, taskExecutionMode: taskExecutionMode};
|
||||
let params: contracts.SchemaCompareParams = { sourceEndpointInfo: sourceEndpointInfo, targetEndpointInfo: targetEndpointInfo, taskExecutionMode: taskExecutionMode };
|
||||
return client.sendRequest(contracts.SchemaCompareRequest.type, params).then(
|
||||
r => {
|
||||
return r;
|
||||
@@ -183,7 +181,7 @@ export class SchemaCompareServicesFeature extends SqlOpsFeature<undefined> {
|
||||
};
|
||||
|
||||
let schemaCompareGenerateScript = (operationId: string, targetDatabaseName: string, scriptFilePath: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
|
||||
let params: contracts.SchemaCompareGenerateScriptParams = {operationId: operationId, targetDatabaseName: targetDatabaseName, scriptFilePath: scriptFilePath, taskExecutionMode: taskExecutionMode};
|
||||
let params: contracts.SchemaCompareGenerateScriptParams = { operationId: operationId, targetDatabaseName: targetDatabaseName, scriptFilePath: scriptFilePath, taskExecutionMode: taskExecutionMode };
|
||||
return client.sendRequest(contracts.SchemaCompareGenerateScriptRequest.type, params).then(
|
||||
r => {
|
||||
return r;
|
||||
|
||||
@@ -24,4 +24,4 @@ export function sparkJobSubmissionYarnUIMessage(yarnUIURL: string): string { ret
|
||||
export function sparkJobSubmissionSparkHistoryLinkMessage(sparkHistoryLink: string): string { return localize('sparkJobSubmission_SparkHistoryLinkMessage', 'Spark History Url: {0} ', sparkHistoryLink); }
|
||||
export function sparkJobSubmissionGetApplicationIdFailed(err: string): string { return localize('sparkJobSubmission_GetApplicationIdFailed', 'Get Application Id Failed. {0}', err); }
|
||||
export function sparkJobSubmissionLocalFileNotExisted(path: string): string { return localize('sparkJobSubmission_LocalFileNotExisted', 'Local file {0} does not existed. ', path); }
|
||||
export const sparkJobSubmissionNoSqlBigDataClusterFound = localize('sparkJobSubmission_NoSqlBigDataClusterFound','No Sql Server Big Data Cluster found.');
|
||||
export const sparkJobSubmissionNoSqlBigDataClusterFound = localize('sparkJobSubmission_NoSqlBigDataClusterFound', 'No Sql Server Big Data Cluster found.');
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -74,7 +73,9 @@ export abstract class Command extends vscode.Disposable {
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.disposable && this.disposable.dispose();
|
||||
if (this.disposable) {
|
||||
this.disposable.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
protected get apiWrapper(): ApiWrapper {
|
||||
|
||||
@@ -69,8 +69,8 @@ export class SqlClusterConnection {
|
||||
return FileSourceFactory.instance.createHdfsFileSource(options);
|
||||
}
|
||||
|
||||
public updatePassword(password : string): void{
|
||||
if(password){
|
||||
public updatePassword(password: string): void {
|
||||
if (password) {
|
||||
this._password = password;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ export class HdfsFileSource implements IFileSource {
|
||||
reject(error);
|
||||
} else {
|
||||
let hdfsFiles: IFile[] = files.map(file => {
|
||||
let hdfsFile = <IHdfsFileStatus> file;
|
||||
let hdfsFile = <IHdfsFileStatus>file;
|
||||
return new File(File.createPath(path, hdfsFile.pathSuffix), hdfsFile.type === 'DIRECTORY');
|
||||
});
|
||||
resolve(hdfsFiles);
|
||||
@@ -195,8 +195,8 @@ export class HdfsFileSource implements IFileSource {
|
||||
error = <HdfsError>err;
|
||||
if (error.message.includes('Stream exceeded specified max')) {
|
||||
// We have data > maxbytes, show we're truncating
|
||||
let previewNote: string = '#################################################################################################################### \r\n'+
|
||||
'########################### '+ localize('maxSizeNotice', "NOTICE: This file has been truncated at {0} for preview. ", bytes(maxBytes)) + '############################### \r\n' +
|
||||
let previewNote: string = '#################################################################################################################### \r\n' +
|
||||
'########################### ' + localize('maxSizeNotice', "NOTICE: This file has been truncated at {0} for preview. ", bytes(maxBytes)) + '############################### \r\n' +
|
||||
'#################################################################################################################### \r\n';
|
||||
data.splice(0, 0, Buffer.from(previewNote, 'utf-8'));
|
||||
vscode.window.showWarningMessage(localize('maxSizeReached', "The file has been truncated at {0} for preview.", bytes(maxBytes)));
|
||||
|
||||
@@ -345,7 +345,7 @@ export class ErrorNode extends TreeNode {
|
||||
public static create(message: string, parent: TreeNode, errorCode?: number): ErrorNode {
|
||||
let node = new ErrorNode(message);
|
||||
node.parent = parent;
|
||||
if(errorCode){
|
||||
if (errorCode) {
|
||||
node.errorStatusCode = errorCode;
|
||||
}
|
||||
return node;
|
||||
|
||||
@@ -97,7 +97,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements azd
|
||||
}
|
||||
|
||||
private hasExpansionError(children: TreeNode[]): boolean {
|
||||
if(children.find(c => c.errorStatusCode > 0)){
|
||||
if (children.find(c => c.errorStatusCode > 0)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
|
||||
@@ -78,7 +78,7 @@ export abstract class TreeNode implements ITreeNode {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public updateFileSource(connection: SqlClusterConnection): void{
|
||||
public updateFileSource(connection: SqlClusterConnection): void {
|
||||
this.fileSource = connection.createHdfsFileSource();
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,6 @@ import * as azdata from 'azdata';
|
||||
* A tree node in the object explorer tree
|
||||
*
|
||||
* @export
|
||||
* @interface ITreeNode
|
||||
*/
|
||||
export interface ITreeNode {
|
||||
getNodeInfo(): azdata.NodeInfo;
|
||||
@@ -22,7 +21,6 @@ export interface ITreeNode {
|
||||
* can be queried
|
||||
*
|
||||
* @export
|
||||
* @interface IFileNode
|
||||
* @extends {ITreeNode}
|
||||
*/
|
||||
export interface IFileNode extends ITreeNode {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// This code is originally from https://github.com/harrisiirak/webhdfs
|
||||
// License: https://github.com/harrisiirak/webhdfs/blob/master/LICENSE
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as url from 'url';
|
||||
import * as fs from 'fs';
|
||||
import * as querystring from 'querystring';
|
||||
@@ -53,10 +51,8 @@ export class WebHDFS {
|
||||
/**
|
||||
* Generate WebHDFS REST API endpoint URL for given operation
|
||||
*
|
||||
* @param {string} operation WebHDFS operation name
|
||||
* @param {string} path
|
||||
* @param {object} params
|
||||
* @returns {string} WebHDFS REST API endpoint URL
|
||||
* @param operation WebHDFS operation name
|
||||
* @returns WebHDFS REST API endpoint URL
|
||||
*/
|
||||
private getOperationEndpoint(operation: string, path: string, params?: object): string {
|
||||
let endpoint = this._url;
|
||||
@@ -73,8 +69,8 @@ export class WebHDFS {
|
||||
/**
|
||||
* Gets localized status message for given status code
|
||||
*
|
||||
* @param {number} statusCode Http status code
|
||||
* @returns {string} status message
|
||||
* @param statusCode Http status code
|
||||
* @returns status message
|
||||
*/
|
||||
private toStatusMessage(statusCode: number): string {
|
||||
let statusMessage: string = undefined;
|
||||
@@ -93,9 +89,9 @@ export class WebHDFS {
|
||||
/**
|
||||
* Gets status message from response
|
||||
*
|
||||
* @param {request.Response} response response object
|
||||
* @param {boolean} strict If set true then RemoteException must be present in the body
|
||||
* @returns {string} Error message interpreted by status code
|
||||
* @param response response object
|
||||
* @param strict If set true then RemoteException must be present in the body
|
||||
* @returns Error message interpreted by status code
|
||||
*/
|
||||
private getStatusMessage(response: request.Response): string {
|
||||
if (!response) { return undefined; }
|
||||
@@ -107,8 +103,8 @@ export class WebHDFS {
|
||||
/**
|
||||
* Gets remote exception message from response body
|
||||
*
|
||||
* @param {any} responseBody response body
|
||||
* @returns {string} Error message interpreted by status code
|
||||
* @param responseBody response body
|
||||
* @returns Error message interpreted by status code
|
||||
*/
|
||||
private getRemoteExceptionMessage(responseBody: any): string {
|
||||
if (!responseBody) { return undefined; }
|
||||
@@ -128,10 +124,10 @@ export class WebHDFS {
|
||||
/**
|
||||
* Generates error message descriptive as much as possible
|
||||
*
|
||||
* @param {string} statusMessage status message
|
||||
* @param {string} [remoteExceptionMessage] remote exception message
|
||||
* @param {any} [error] error
|
||||
* @returns {string} error message
|
||||
* @param statusMessage status message
|
||||
* @param [remoteExceptionMessage] remote exception message
|
||||
* @param [error] error
|
||||
* @returns error message
|
||||
*/
|
||||
private getErrorMessage(statusMessage: string, remoteExceptionMessage?: string, error?: any): string {
|
||||
statusMessage = statusMessage === '' ? undefined : statusMessage;
|
||||
@@ -146,10 +142,10 @@ export class WebHDFS {
|
||||
/**
|
||||
* Parse error state from response and return valid Error object
|
||||
*
|
||||
* @param {request.Response} response response object
|
||||
* @param {any} [responseBody] response body
|
||||
* @param {any} [error] error
|
||||
* @returns {HdfsError} HdfsError object
|
||||
* @param response response object
|
||||
* @param [responseBody] response body
|
||||
* @param [error] error
|
||||
* @returns HdfsError object
|
||||
*/
|
||||
private parseError(response: request.Response, responseBody?: any, error?: any): HdfsError {
|
||||
let statusMessage: string = this.getStatusMessage(response);
|
||||
@@ -165,8 +161,8 @@ export class WebHDFS {
|
||||
/**
|
||||
* Check if response is redirect
|
||||
*
|
||||
* @param {request.Response} response response object
|
||||
* @returns {boolean} if response is redirect
|
||||
* @param response response object
|
||||
* @returns if response is redirect
|
||||
*/
|
||||
private isRedirect(response: request.Response): boolean {
|
||||
return [301, 307].indexOf(response.statusCode) !== -1 &&
|
||||
@@ -176,8 +172,8 @@ export class WebHDFS {
|
||||
/**
|
||||
* Check if response is successful
|
||||
*
|
||||
* @param {request.Response} response response object
|
||||
* @returns {boolean} if response is successful
|
||||
* @param response response object
|
||||
* @returns if response is successful
|
||||
*/
|
||||
private isSuccess(response: request.Response): boolean {
|
||||
return [200, 201].indexOf(response.statusCode) !== -1;
|
||||
@@ -186,8 +182,8 @@ export class WebHDFS {
|
||||
/**
|
||||
* Check if response is error
|
||||
*
|
||||
* @param {request.Response} response response object
|
||||
* @returns {boolean} if response is error
|
||||
* @param response response object
|
||||
* @returns if response is error
|
||||
*/
|
||||
private isError(response: request.Response): boolean {
|
||||
return [400, 401, 402, 403, 404, 500].indexOf(response.statusCode) !== -1;
|
||||
@@ -196,10 +192,8 @@ export class WebHDFS {
|
||||
/**
|
||||
* Send a request to WebHDFS REST API
|
||||
*
|
||||
* @param {string} method HTTP method
|
||||
* @param {string} url
|
||||
* @param {object} opts Options for request
|
||||
* @param {(error: HdfsError, response: request.Response) => void} callback
|
||||
* @param method HTTP method
|
||||
* @param opts Options for request
|
||||
* @returns void
|
||||
*/
|
||||
private sendRequest(method: string, url: string, opts: object,
|
||||
@@ -234,10 +228,6 @@ export class WebHDFS {
|
||||
|
||||
/**
|
||||
* Change file permissions
|
||||
*
|
||||
* @param {string} path
|
||||
* @param {string} mode
|
||||
* @param {(error: HdfsError) => void} callback
|
||||
* @returns void
|
||||
*/
|
||||
public chmod(path: string, mode: string, callback: (error: HdfsError) => void): void {
|
||||
@@ -253,10 +243,8 @@ export class WebHDFS {
|
||||
/**
|
||||
* Change file owner
|
||||
*
|
||||
* @param {string} path
|
||||
* @param {string} userId User name
|
||||
* @param {string} groupId Group name
|
||||
* @param {(error: HdfsError) => void} callback
|
||||
* @param userId User name
|
||||
* @param groupId Group name
|
||||
* @returns void
|
||||
*/
|
||||
public chown(path: string, userId: string, groupId: string, callback: (error: HdfsError) => void): void {
|
||||
@@ -279,8 +267,6 @@ export class WebHDFS {
|
||||
/**
|
||||
* Read directory contents
|
||||
*
|
||||
* @param {string} path
|
||||
* @param {(error: HdfsError, files: any[]) => void)} callback
|
||||
* @returns void
|
||||
*/
|
||||
public readdir(path: string, callback: (error: HdfsError, files: any[]) => void): void {
|
||||
@@ -305,10 +291,6 @@ export class WebHDFS {
|
||||
|
||||
/**
|
||||
* Make new directory
|
||||
*
|
||||
* @param {string} path
|
||||
* @param {string} [permission=0755]
|
||||
* @param {(error: HdfsError) => void} callback
|
||||
* @returns void
|
||||
*/
|
||||
public mkdir(path: string, permission: string = '0755', callback: (error: HdfsError) => void): void {
|
||||
@@ -327,10 +309,6 @@ export class WebHDFS {
|
||||
|
||||
/**
|
||||
* Rename path
|
||||
*
|
||||
* @param {string} path
|
||||
* @param {string} destination
|
||||
* @param {(error: HdfsError) => void} callback
|
||||
* @returns void
|
||||
*/
|
||||
public rename(path: string, destination: string, callback: (error: HdfsError) => void): void {
|
||||
@@ -350,9 +328,6 @@ export class WebHDFS {
|
||||
|
||||
/**
|
||||
* Get file status for given path
|
||||
*
|
||||
* @param {string} path
|
||||
* @param {(error: HdfsError, fileStatus: any) => void} callback
|
||||
* @returns void
|
||||
*/
|
||||
public stat(path: string, callback: (error: HdfsError, fileStatus: any) => void): void {
|
||||
@@ -376,8 +351,6 @@ export class WebHDFS {
|
||||
* Wraps stat method
|
||||
*
|
||||
* @see WebHDFS.stat
|
||||
* @param {string} path
|
||||
* @param {(error: HdfsError, exists: boolean) => void} callback
|
||||
* @returns void
|
||||
*/
|
||||
public exists(path: string, callback: (error: HdfsError, exists: boolean) => void): void {
|
||||
@@ -392,12 +365,7 @@ export class WebHDFS {
|
||||
/**
|
||||
* Write data to the file
|
||||
*
|
||||
* @param {string} path
|
||||
* @param {string | Buffer} data
|
||||
* @param {boolean} append If set to true then append data to the file
|
||||
* @param {object} opts
|
||||
* @param {(error: HdfsError) => void} callback
|
||||
* @returns {fs.WriteStream}
|
||||
* @param append If set to true then append data to the file
|
||||
*/
|
||||
public writeFile(path: string, data: string | Buffer, append: boolean, opts: object,
|
||||
callback: (error: HdfsError) => void): fs.WriteStream {
|
||||
@@ -427,11 +395,6 @@ export class WebHDFS {
|
||||
* Append data to the file
|
||||
*
|
||||
* @see writeFile
|
||||
* @param {string} path
|
||||
* @param {string | Buffer} data
|
||||
* @param {object} opts
|
||||
* @param {(error: HdfsError) => void} callback
|
||||
* @returns {fs.WriteStream}
|
||||
*/
|
||||
public appendFile(path: string, data: string | Buffer, opts: object, callback: (error: HdfsError) => void): fs.WriteStream {
|
||||
return this.writeFile(path, data, true, opts, callback);
|
||||
@@ -442,8 +405,6 @@ export class WebHDFS {
|
||||
*
|
||||
* @fires Request#data
|
||||
* @fires WebHDFS#finish
|
||||
* @param {path} path
|
||||
* @param {(error: HdfsError, buffer: Buffer) => void} callback
|
||||
* @returns void
|
||||
*/
|
||||
public readFile(path: string, callback: (error: HdfsError, buffer: Buffer) => void): void {
|
||||
@@ -475,10 +436,7 @@ export class WebHDFS {
|
||||
* Create writable stream for given path
|
||||
*
|
||||
* @fires WebHDFS#finish
|
||||
* @param {string} path
|
||||
* @param {boolean} [append] If set to true then append data to the file
|
||||
* @param {object} [opts]
|
||||
* @returns {fs.WriteStream}
|
||||
* @param [append] If set to true then append data to the file
|
||||
*
|
||||
* @example
|
||||
* let hdfs = WebHDFS.createClient();
|
||||
@@ -593,9 +551,6 @@ export class WebHDFS {
|
||||
*
|
||||
* @fires Request#data
|
||||
* @fires WebHDFS#finish
|
||||
* @param {string} path
|
||||
* @param {object} [opts]
|
||||
* @returns {fs.ReadStream}
|
||||
*
|
||||
* @example
|
||||
* let hdfs = WebHDFS.createClient();
|
||||
@@ -677,10 +632,6 @@ export class WebHDFS {
|
||||
/**
|
||||
* Create symbolic link to the destination path
|
||||
*
|
||||
* @param {string} src
|
||||
* @param {string} destination
|
||||
* @param {boolean} [createParent=false]
|
||||
* @param {(error: HdfsError) => void} callback
|
||||
* @returns void
|
||||
*/
|
||||
public symlink(src: string, destination: string, createParent: boolean = false, callback: (error: HdfsError) => void): void {
|
||||
@@ -702,9 +653,6 @@ export class WebHDFS {
|
||||
/**
|
||||
* Unlink path
|
||||
*
|
||||
* @param {string} path
|
||||
* @param {boolean} [recursive=false]
|
||||
* @param {(error: any) => void} callback
|
||||
* @returns void
|
||||
*/
|
||||
public unlink(path: string, recursive: boolean = false, callback: (error: HdfsError) => void): void {
|
||||
@@ -720,9 +668,6 @@ export class WebHDFS {
|
||||
|
||||
/**
|
||||
* @alias WebHDFS.unlink
|
||||
* @param {string} path
|
||||
* @param {boolean} [recursive=false]
|
||||
* @param {(error: any) => void} callback
|
||||
* @returns void
|
||||
*/
|
||||
public rmdir(path: string, recursive: boolean = false, callback: (error: HdfsError) => void): void {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
|
||||
'use strict';
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import vscode = require('vscode');
|
||||
|
||||
@@ -56,7 +58,7 @@ export interface IPrompter {
|
||||
/**
|
||||
* Prompts for multiple questions
|
||||
*
|
||||
* @returns {[questionId: string]: T} Map of question IDs to results, or undefined if
|
||||
* @returns Map of question IDs to results, or undefined if
|
||||
* the user canceled the question session
|
||||
*/
|
||||
prompt<T>(questions: IQuestion[], ignoreFocusOut?: boolean): Promise<{ [questionId: string]: any }>;
|
||||
|
||||
@@ -18,9 +18,8 @@ export class OpenSparkYarnHistoryTask {
|
||||
async execute(sqlConnProfile: azdata.IConnectionProfile, isSpark: boolean): Promise<void> {
|
||||
try {
|
||||
let sqlClusterConnection = SqlClusterLookUp.findSqlClusterConnection(sqlConnProfile, this.appContext);
|
||||
if (!sqlClusterConnection)
|
||||
{
|
||||
let name = isSpark? 'Spark' : 'Yarn';
|
||||
if (!sqlClusterConnection) {
|
||||
let name = isSpark ? 'Spark' : 'Yarn';
|
||||
this.appContext.apiWrapper.showErrorMessage(`Please connect to the Spark cluster before View ${name} History.`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as childProcess from 'child_process';
|
||||
import * as fs from 'fs-extra';
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -17,7 +15,7 @@ import * as Constants from '../constants';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export function getDropdownValue(dropdownValue: string | azdata.CategoryValue): string {
|
||||
if (typeof(dropdownValue) === 'string') {
|
||||
if (typeof (dropdownValue) === 'string') {
|
||||
return <string>dropdownValue;
|
||||
} else {
|
||||
return dropdownValue ? (<azdata.CategoryValue>dropdownValue).name : undefined;
|
||||
@@ -170,7 +168,7 @@ export function getOSPlatform(): Platform {
|
||||
}
|
||||
|
||||
export function getOSPlatformId(): string {
|
||||
var platformId = undefined;
|
||||
let platformId = undefined;
|
||||
switch (process.platform) {
|
||||
case 'win32':
|
||||
platformId = 'win-x64';
|
||||
|
||||
@@ -17,7 +17,7 @@ import { MssqlObjectExplorerNodeProvider } from './objectExplorerNodeProvider/ob
|
||||
|
||||
export function findSqlClusterConnection(
|
||||
obj: ICommandObjectExplorerContext | azdata.IConnectionProfile,
|
||||
appContext: AppContext) : SqlClusterConnection {
|
||||
appContext: AppContext): SqlClusterConnection {
|
||||
|
||||
if (!obj || !appContext) { return undefined; }
|
||||
|
||||
@@ -123,8 +123,7 @@ function connToConnectionParam(connection: azdata.connection.Connection): Connec
|
||||
return <ConnectionParam>result;
|
||||
}
|
||||
|
||||
class ConnectionParam implements azdata.connection.Connection, azdata.IConnectionProfile, azdata.ConnectionInfo
|
||||
{
|
||||
class ConnectionParam implements azdata.connection.Connection, azdata.IConnectionProfile, azdata.ConnectionInfo {
|
||||
public connectionName: string;
|
||||
public serverName: string;
|
||||
public databaseName: string;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as vscode from 'vscode';
|
||||
import * as opener from 'opener';
|
||||
import TelemetryReporter from 'vscode-extension-telemetry';
|
||||
@@ -138,7 +137,6 @@ export class Telemetry {
|
||||
|
||||
/**
|
||||
* Handle Language Service client errors
|
||||
* @class LanguageClientErrorHandler
|
||||
*/
|
||||
export class LanguageClientErrorHandler implements ErrorHandler {
|
||||
|
||||
@@ -160,11 +158,6 @@ export class LanguageClientErrorHandler implements ErrorHandler {
|
||||
/**
|
||||
* Callback for language service client error
|
||||
*
|
||||
* @param {Error} error
|
||||
* @param {Message} message
|
||||
* @param {number} count
|
||||
* @returns {ErrorAction}
|
||||
*
|
||||
* @memberOf LanguageClientErrorHandler
|
||||
*/
|
||||
error(error: Error, message: Message, count: number): ErrorAction {
|
||||
@@ -178,8 +171,6 @@ export class LanguageClientErrorHandler implements ErrorHandler {
|
||||
/**
|
||||
* Callback for language service client closed
|
||||
*
|
||||
* @returns {CloseAction}
|
||||
*
|
||||
* @memberOf LanguageClientErrorHandler
|
||||
*/
|
||||
closed(): CloseAction {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
@@ -163,7 +162,7 @@ export function generateGuid(): string {
|
||||
}
|
||||
|
||||
export function verifyPlatform(): Thenable<boolean> {
|
||||
if (os.platform() === 'darwin' && parseFloat(os.release()) < 16.0) {
|
||||
if (os.platform() === 'darwin' && parseFloat(os.release()) < 16) {
|
||||
return Promise.resolve(false);
|
||||
} else {
|
||||
return Promise.resolve(true);
|
||||
|
||||
@@ -3,17 +3,12 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
/**
|
||||
* Wrapper class to act as a facade over VSCode and Data APIs and allow us to test / mock callbacks into
|
||||
* this API from our code
|
||||
*
|
||||
* @export
|
||||
* @class ApiWrapper
|
||||
*/
|
||||
export class ApiWrapper {
|
||||
public createOutputChannel(name: string): vscode.OutputChannel {
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
// CONFIG VALUES ///////////////////////////////////////////////////////////
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// This code is originally from https://github.com/Microsoft/vscode/blob/master/src/vs/base/node/ports.ts
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as net from 'net';
|
||||
|
||||
export class StrictPortFindOptions {
|
||||
@@ -36,9 +34,9 @@ export async function strictFindFreePort(options: StrictPortFindOptions): Promis
|
||||
/**
|
||||
* Get a random integer between `min` and `max`.
|
||||
*
|
||||
* @param {number} min - min number
|
||||
* @param {number} max - max number
|
||||
* @return {number} a random integer
|
||||
* @param min - min number
|
||||
* @param max - max number
|
||||
* @return a random integer
|
||||
*/
|
||||
function getRandomInt(min, max): number {
|
||||
return Math.floor(Math.random() * (max - min + 1) + min);
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
'use strict';
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as childProcess from 'child_process';
|
||||
import * as fs from 'fs-extra';
|
||||
@@ -108,7 +111,7 @@ export function getOSPlatform(): Platform {
|
||||
}
|
||||
|
||||
export function getOSPlatformId(): string {
|
||||
var platformId = undefined;
|
||||
let platformId = undefined;
|
||||
switch (process.platform) {
|
||||
case 'win32':
|
||||
platformId = 'win-x64';
|
||||
|
||||
@@ -23,7 +23,7 @@ const msgSampleCodeDataFrame = localize('msgSampleCodeDataFrame', "This sample c
|
||||
const noNotebookVisible = localize('noNotebookVisible', "No notebook editor is active");
|
||||
|
||||
let controller: JupyterController;
|
||||
type ChooseCellType = { label: string, id: CellType};
|
||||
type ChooseCellType = { label: string, id: CellType };
|
||||
|
||||
export async function activate(extensionContext: vscode.ExtensionContext): Promise<IExtensionApi> {
|
||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.new', (context?: azdata.ConnectedContext) => {
|
||||
|
||||
@@ -31,9 +31,9 @@ export function jsIndexToCharIndex(jsIdx: number, text: string): number {
|
||||
for (let i = 0; i + 1 < text.length && i < jsIdx; i++) {
|
||||
let charCode = text.charCodeAt(i);
|
||||
// check for surrogate pair
|
||||
if (charCode >= 0xd800 && charCode <= 0xdbff) {
|
||||
if (charCode >= 0xD800 && charCode <= 0xDBFF) {
|
||||
let nextCharCode = text.charCodeAt(i + 1);
|
||||
if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {
|
||||
if (nextCharCode >= 0xDC00 && nextCharCode <= 0xDFFF) {
|
||||
charIdx--;
|
||||
i++;
|
||||
}
|
||||
@@ -60,9 +60,9 @@ export function charCountToJsCountDiff(text: string): number {
|
||||
for (let i = 0; i + 1 < text.length; i++) {
|
||||
let charCode = text.charCodeAt(i);
|
||||
// check for surrogate pair
|
||||
if (charCode >= 0xd800 && charCode <= 0xdbff) {
|
||||
if (charCode >= 0xD800 && charCode <= 0xDBFF) {
|
||||
let nextCharCode = text.charCodeAt(i + 1);
|
||||
if (nextCharCode >= 0xdc00 && nextCharCode <= 0xdfff) {
|
||||
if (nextCharCode >= 0xDC00 && nextCharCode <= 0xDFFF) {
|
||||
diff++;
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { nb } from 'azdata';
|
||||
import { Kernel, KernelMessage } from '@jupyterlab/services';
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as UUID from 'vscode-languageclient/lib/utils/uuid';
|
||||
import * as vscode from 'vscode';
|
||||
import * as path from 'path';
|
||||
@@ -224,7 +222,6 @@ export class PerNotebookServerInstance implements IServerInstance {
|
||||
/**
|
||||
* Starts a Jupyter instance using the provided a start command. Server is determined to have
|
||||
* started when the log message with URL to connect to is emitted.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
protected async startInternal(): Promise<void> {
|
||||
if (this.isStarted) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
|
||||
'use strict';
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import vscode = require('vscode');
|
||||
|
||||
@@ -56,7 +58,7 @@ export interface IPrompter {
|
||||
/**
|
||||
* Prompts for multiple questions
|
||||
*
|
||||
* @returns {[questionId: string]: T} Map of question IDs to results, or undefined if
|
||||
* @returns Map of question IDs to results, or undefined if
|
||||
* the user canceled the question session
|
||||
*/
|
||||
prompt<T>(questions: IQuestion[], ignoreFocusOut?: boolean): Promise<{ [questionId: string]: any }>;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -3,16 +3,12 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as vscode from 'vscode';
|
||||
import * as data from 'azdata';
|
||||
|
||||
/**
|
||||
* Wrapper class to act as a facade over VSCode and Data APIs and allow us to test / mock callbacks into
|
||||
* this API from our code
|
||||
*
|
||||
* @export
|
||||
* @class ApiWrapper
|
||||
*/
|
||||
export class ApiWrapper {
|
||||
// Data APIs
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"moduleResolution": "node",
|
||||
"declaration": true
|
||||
"moduleResolution": "node"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as azdata from 'azdata';
|
||||
@@ -278,7 +277,7 @@ export class SchemaCompareResult {
|
||||
this.generateScriptButton = view.modelBuilder.button().withProperties({
|
||||
label: localize('schemaCompare.generateScriptButton', 'Generate script'),
|
||||
iconPath: {
|
||||
light : path.join(__dirname, 'media', 'generate-script.svg'),
|
||||
light: path.join(__dirname, 'media', 'generate-script.svg'),
|
||||
dark: path.join(__dirname, 'media', 'generate-script-inverse.svg')
|
||||
},
|
||||
}).component();
|
||||
@@ -324,7 +323,7 @@ export class SchemaCompareResult {
|
||||
this.switchButton = view.modelBuilder.button().withProperties({
|
||||
label: localize('schemaCompare.switchDirectionButton', 'Switch direction'),
|
||||
iconPath: {
|
||||
light : path.join(__dirname, 'media', 'switch-directions.svg'),
|
||||
light: path.join(__dirname, 'media', 'switch-directions.svg'),
|
||||
dark: path.join(__dirname, 'media', 'switch-directions-inverse.svg')
|
||||
},
|
||||
title: localize('schemaCompare.switchButtonTitle', 'Switch source and target')
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as Proto from '../protocol';
|
||||
import { ITypeScriptServiceClient } from '../typescriptService';
|
||||
import API from '../utils/api';
|
||||
import { VersionDependentRegistration } from '../utils/dependentRegistration';
|
||||
import * as typeConverters from '../utils/typeConverters';
|
||||
|
||||
class SmartSelection implements vscode.SelectionRangeProvider {
|
||||
public static readonly minVersion = API.v350;
|
||||
|
||||
public constructor(
|
||||
private readonly client: ITypeScriptServiceClient
|
||||
) { }
|
||||
|
||||
public async provideSelectionRanges(
|
||||
document: vscode.TextDocument,
|
||||
positions: vscode.Position[],
|
||||
token: vscode.CancellationToken,
|
||||
): Promise<vscode.SelectionRange[] | undefined> {
|
||||
const file = this.client.toOpenedFilePath(document);
|
||||
if (!file) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const args: Proto.FileRequestArgs & { locations: Proto.Location[] } = {
|
||||
file,
|
||||
locations: positions.map(typeConverters.Position.toLocation)
|
||||
};
|
||||
const response = await this.client.execute('selectionRange', args, token);
|
||||
if (response.type !== 'response' || !response.body) {
|
||||
return undefined;
|
||||
}
|
||||
return response.body.map(SmartSelection.convertSelectionRange);
|
||||
}
|
||||
|
||||
private static convertSelectionRange(
|
||||
selectionRange: Proto.SelectionRange
|
||||
): vscode.SelectionRange {
|
||||
return new vscode.SelectionRange(
|
||||
typeConverters.Range.fromTextSpan(selectionRange.textSpan),
|
||||
selectionRange.parent ? SmartSelection.convertSelectionRange(selectionRange.parent) : undefined,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function register(
|
||||
selector: vscode.DocumentSelector,
|
||||
client: ITypeScriptServiceClient,
|
||||
) {
|
||||
return new VersionDependentRegistration(client, SmartSelection.minVersion, () =>
|
||||
vscode.languages.registerSelectionRangeProvider(selector, new SmartSelection(client)));
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import 'mocha';
|
||||
import * as vscode from 'vscode';
|
||||
import { CURSOR, withRandomFileEditor } from './testUtils';
|
||||
|
||||
const onDocumentChange = (doc: vscode.TextDocument): Promise<vscode.TextDocument> => {
|
||||
return new Promise<vscode.TextDocument>(resolve => {
|
||||
const sub = vscode.workspace.onDidChangeTextDocument(e => {
|
||||
if (e.document !== doc) {
|
||||
return;
|
||||
}
|
||||
sub.dispose();
|
||||
resolve(e.document);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const type = async (document: vscode.TextDocument, text: string): Promise<vscode.TextDocument> => {
|
||||
const onChange = onDocumentChange(document);
|
||||
await vscode.commands.executeCommand('type', { text });
|
||||
await onChange;
|
||||
return document;
|
||||
};
|
||||
|
||||
suite('OnEnter', () => {
|
||||
test('should indent after if block with braces', () => {
|
||||
return withRandomFileEditor(`if (true) {${CURSOR}`, 'js', async (_editor, document) => {
|
||||
await type(document, '\nx');
|
||||
assert.strictEqual(document.getText(), `if (true) {\n x`);
|
||||
});
|
||||
});
|
||||
|
||||
test('should indent within empty object literal', () => {
|
||||
return withRandomFileEditor(`({${CURSOR}})`, 'js', async (_editor, document) => {
|
||||
await type(document, '\nx');
|
||||
assert.strictEqual(document.getText(), `({\n x\n})`);
|
||||
});
|
||||
});
|
||||
|
||||
test('should indent after simple jsx tag with attributes', () => {
|
||||
return withRandomFileEditor(`const a = <div onclick={bla}>${CURSOR}`, 'jsx', async (_editor, document) => {
|
||||
await type(document, '\nx');
|
||||
assert.strictEqual(document.getText(), `const a = <div onclick={bla}>\n x`);
|
||||
});
|
||||
});
|
||||
|
||||
test('should indent after simple jsx tag with attributes', () => {
|
||||
return withRandomFileEditor(`const a = <div onclick={bla}>${CURSOR}`, 'jsx', async (_editor, document) => {
|
||||
await type(document, '\nx');
|
||||
assert.strictEqual(document.getText(), `const a = <div onclick={bla}>\n x`);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,68 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import { join } from 'path';
|
||||
|
||||
function rndName() {
|
||||
return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 10);
|
||||
}
|
||||
|
||||
export function createRandomFile(contents = '', fileExtension = 'txt'): Thenable<vscode.Uri> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const tmpFile = join(os.tmpdir(), rndName() + '.' + fileExtension);
|
||||
fs.writeFile(tmpFile, contents, (error) => {
|
||||
if (error) {
|
||||
return reject(error);
|
||||
}
|
||||
|
||||
resolve(vscode.Uri.file(tmpFile));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function deleteFile(file: vscode.Uri): Thenable<boolean> {
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.unlink(file.fsPath, (err) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export const CURSOR = '$$CURSOR$$';
|
||||
|
||||
export function withRandomFileEditor(
|
||||
contents: string,
|
||||
fileExtension: string,
|
||||
run: (editor: vscode.TextEditor, doc: vscode.TextDocument) => Thenable<void>
|
||||
): Thenable<boolean> {
|
||||
const cursorIndex = contents.indexOf(CURSOR);
|
||||
return createRandomFile(contents.replace(CURSOR, ''), fileExtension).then(file => {
|
||||
return vscode.workspace.openTextDocument(file).then(doc => {
|
||||
return vscode.window.showTextDocument(doc).then((editor) => {
|
||||
if (cursorIndex >= 0) {
|
||||
const pos = doc.positionAt(cursorIndex);
|
||||
editor.selection = new vscode.Selection(pos, pos);
|
||||
}
|
||||
return run(editor, doc).then(_ => {
|
||||
if (doc.isDirty) {
|
||||
return doc.save().then(() => {
|
||||
return deleteFile(file);
|
||||
});
|
||||
} else {
|
||||
return deleteFile(file);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
'use strict';
|
||||
|
||||
// @ts-ignore
|
||||
const pkg = require('../package.json');
|
||||
// const pkg = require('../package.json');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
|
||||
|
||||
Vendored
+44
-56
@@ -60,8 +60,8 @@ declare module 'azdata' {
|
||||
export namespace credentials {
|
||||
/**
|
||||
* Register a credential provider to handle credential requests.
|
||||
* @param {CredentialProvider} provider The provider to register
|
||||
* @return {Disposable} Handle to the provider for disposal
|
||||
* @param provider The provider to register
|
||||
* @return Handle to the provider for disposal
|
||||
*/
|
||||
export function registerProvider(provider: CredentialProvider): vscode.Disposable;
|
||||
|
||||
@@ -69,8 +69,8 @@ declare module 'azdata' {
|
||||
* Retrieves a provider from the extension host if one has been registered. Any credentials
|
||||
* accessed with the returned provider will have the namespaceId appended to credential ID
|
||||
* to prevent extensions from trampling over each others' credentials.
|
||||
* @param {string} namespaceId ID that will be appended to credential IDs.
|
||||
* @return {Thenable<CredentialProvider>} Promise that returns the namespaced provider
|
||||
* @param namespaceId ID that will be appended to credential IDs.
|
||||
* @return Promise that returns the namespaced provider
|
||||
*/
|
||||
export function getProvider(namespaceId: string): Thenable<CredentialProvider>;
|
||||
}
|
||||
@@ -98,14 +98,14 @@ declare module 'azdata' {
|
||||
|
||||
/**
|
||||
* Get the credentials for an active connection
|
||||
* @param {string} connectionId The id of the connection
|
||||
* @returns {{ [name: string]: string}} A dictionary containing the credentials as they would be included in the connection's options dictionary
|
||||
* @param connectionId The id of the connection
|
||||
* @returns A dictionary containing the credentials as they would be included in the connection's options dictionary
|
||||
*/
|
||||
export function getCredentials(connectionId: string): Thenable<{ [name: string]: string }>;
|
||||
|
||||
/**
|
||||
* Get ServerInfo for a connectionId
|
||||
* @param {string} connectionId The id of the connection
|
||||
* @param connectionId The id of the connection
|
||||
* @returns ServerInfo
|
||||
*/
|
||||
export function getServerInfo(connectionId: string): Thenable<ServerInfo>;
|
||||
@@ -134,35 +134,35 @@ declare module 'azdata' {
|
||||
* Get an Object Explorer node corresponding to the given connection and path. If no path
|
||||
* is given, it returns the top-level node for the given connection. If there is no node at
|
||||
* the given path, it returns undefined.
|
||||
* @param {string} connectionId The id of the connection that the node exists on
|
||||
* @param {string?} nodePath The path of the node to get
|
||||
* @returns {ObjectExplorerNode} The node corresponding to the given connection and path,
|
||||
* @param connectionId The id of the connection that the node exists on
|
||||
* @param nodePath The path of the node to get
|
||||
* @returns The node corresponding to the given connection and path,
|
||||
* or undefined if no such node exists.
|
||||
*/
|
||||
export function getNode(connectionId: string, nodePath?: string): Thenable<ObjectExplorerNode>;
|
||||
|
||||
/**
|
||||
* Get all active Object Explorer connection nodes
|
||||
* @returns {ObjectExplorerNode[]} The Object Explorer nodes for each saved connection
|
||||
* @returns The Object Explorer nodes for each saved connection
|
||||
*/
|
||||
export function getActiveConnectionNodes(): Thenable<ObjectExplorerNode[]>;
|
||||
|
||||
/**
|
||||
* Find Object Explorer nodes that match the given information
|
||||
* @param {string} connectionId The id of the connection that the node exists on
|
||||
* @param {string} type The type of the object to retrieve
|
||||
* @param {string} schema The schema of the object, if applicable
|
||||
* @param {string} name The name of the object
|
||||
* @param {string} database The database the object exists under, if applicable
|
||||
* @param {string[]} parentObjectNames A list of names of parent objects in the tree, ordered from highest to lowest level
|
||||
* @param connectionId The id of the connection that the node exists on
|
||||
* @param type The type of the object to retrieve
|
||||
* @param schema The schema of the object, if applicable
|
||||
* @param name The name of the object
|
||||
* @param database The database the object exists under, if applicable
|
||||
* @param parentObjectNames A list of names of parent objects in the tree, ordered from highest to lowest level
|
||||
* (for example when searching for a table's column, provide the name of its parent table for this argument)
|
||||
*/
|
||||
export function findNodes(connectionId: string, type: string, schema: string, name: string, database: string, parentObjectNames: string[]): Thenable<ObjectExplorerNode[]>;
|
||||
|
||||
/**
|
||||
* Get connectionProfile from sessionId
|
||||
* *@param {string} sessionId The id of the session that the node exists on
|
||||
* @returns {IConnectionProfile} The IConnecitonProfile for the session
|
||||
* @param sessionId The id of the session that the node exists on
|
||||
* @returns The IConnecitonProfile for the session
|
||||
*/
|
||||
export function getSessionConnectionProfile(sessionId: string): Thenable<IConnectionProfile>;
|
||||
|
||||
@@ -2047,11 +2047,7 @@ declare module 'azdata' {
|
||||
* Launches a flyout dialog that will display the information on how to complete device
|
||||
* code OAuth login to the user. Only one flyout can be opened at once and each must be closed
|
||||
* by calling {@link endAutoOAuthDeviceCode}.
|
||||
* @param {string} providerId ID of the provider that's requesting the flyout be opened
|
||||
* @param {string} title
|
||||
* @param {string} message
|
||||
* @param {string} userCode
|
||||
* @param {string} uri
|
||||
* @param providerId ID of the provider that's requesting the flyout be opened
|
||||
*/
|
||||
export function beginAutoOAuthDeviceCode(providerId: string, title: string, message: string, userCode: string, uri: string): Thenable<void>;
|
||||
|
||||
@@ -2063,21 +2059,21 @@ declare module 'azdata' {
|
||||
/**
|
||||
* Notifies the account management service that an account has updated (usually due to the
|
||||
* account going stale).
|
||||
* @param {Account} updatedAccount Account object with updated properties
|
||||
* @param updatedAccount Account object with updated properties
|
||||
*/
|
||||
export function accountUpdated(updatedAccount: Account): void;
|
||||
|
||||
/**
|
||||
* Gets all added accounts.
|
||||
* @returns {Thenable<Account>} Promise to return the accounts
|
||||
* @returns Promise to return the accounts
|
||||
*/
|
||||
export function getAllAccounts(): Thenable<Account[]>;
|
||||
|
||||
/**
|
||||
* Generates a security token by asking the account's provider
|
||||
* @param {Account} account Account to generate security token for (defaults to
|
||||
* @param account Account to generate security token for (defaults to
|
||||
* AzureResource.ResourceManagement if not given)
|
||||
* @return {Thenable<{}>} Promise to return the security token
|
||||
* @return Promise to return the security token
|
||||
*/
|
||||
export function getSecurityToken(account: Account, resource?: AzureResource): Thenable<{}>;
|
||||
|
||||
@@ -2211,16 +2207,16 @@ declare module 'azdata' {
|
||||
export interface AccountProvider {
|
||||
/**
|
||||
* Initializes the account provider with the accounts restored from the memento,
|
||||
* @param {Account[]} storedAccounts Accounts restored from the memento
|
||||
* @return {Thenable<Account[]>} Account objects after being rehydrated (if necessary)
|
||||
* @param storedAccounts Accounts restored from the memento
|
||||
* @return Account objects after being rehydrated (if necessary)
|
||||
*/
|
||||
initialize(storedAccounts: Account[]): Thenable<Account[]>;
|
||||
|
||||
/**
|
||||
* Generates a security token for the provided account
|
||||
* @param {Account} account The account to generate a security token for
|
||||
* @param {AzureResource} resource The resource to get the token for
|
||||
* @return {Thenable<{}>} Promise to return a security token object
|
||||
* @param account The account to generate a security token for
|
||||
* @param resource The resource to get the token for
|
||||
* @return Promise to return a security token object
|
||||
*/
|
||||
getSecurityToken(account: Account, resource: AzureResource): Thenable<{}>;
|
||||
|
||||
@@ -2444,7 +2440,6 @@ declare module 'azdata' {
|
||||
/**
|
||||
* Supports defining a model that can be instantiated as a view in the UI
|
||||
* @export
|
||||
* @interface ModelBuilder
|
||||
*/
|
||||
export interface ModelBuilder {
|
||||
navContainer(): ContainerBuilder<NavContainer, any, any>;
|
||||
@@ -2554,7 +2549,7 @@ declare module 'azdata' {
|
||||
* Creates a collection of child components and adds them all to this container
|
||||
*
|
||||
* @param formComponents the definitions
|
||||
* @param {*} [itemLayout] Optional layout for the child items
|
||||
* @param [itemLayout] Optional layout for the child items
|
||||
*/
|
||||
addFormItems(formComponents: Array<FormComponent | FormComponentGroup>, itemLayout?: FormItemLayout): void;
|
||||
|
||||
@@ -2562,7 +2557,7 @@ declare module 'azdata' {
|
||||
* Creates a child component and adds it to this container.
|
||||
*
|
||||
* @param formComponent the component to be added
|
||||
* @param {*} [itemLayout] Optional layout for this child item
|
||||
* @param [itemLayout] Optional layout for this child item
|
||||
*/
|
||||
addFormItem(formComponent: FormComponent | FormComponentGroup, itemLayout?: FormItemLayout): void;
|
||||
|
||||
@@ -2576,7 +2571,6 @@ declare module 'azdata' {
|
||||
|
||||
/**
|
||||
* Removes a from item from the from
|
||||
* @param formComponent
|
||||
*/
|
||||
removeFormItem(formComponent: FormComponent | FormComponentGroup): boolean;
|
||||
}
|
||||
@@ -2587,18 +2581,16 @@ declare module 'azdata' {
|
||||
/**
|
||||
* Sends any updated properties of the component to the UI
|
||||
*
|
||||
* @returns {Thenable<void>} Thenable that completes once the update
|
||||
* @returns Thenable that completes once the update
|
||||
* has been applied in the UI
|
||||
* @memberof Component
|
||||
*/
|
||||
updateProperties(properties: { [key: string]: any }): Thenable<void>;
|
||||
|
||||
/**
|
||||
* Sends an updated property of the component to the UI
|
||||
*
|
||||
* @returns {Thenable<void>} Thenable that completes once the update
|
||||
* @returns Thenable that completes once the update
|
||||
* has been applied in the UI
|
||||
* @memberof Component
|
||||
*/
|
||||
updateProperty(key: string, value: any): Thenable<void>;
|
||||
|
||||
@@ -2665,7 +2657,7 @@ declare module 'azdata' {
|
||||
* Creates a collection of child components and adds them all to this container
|
||||
*
|
||||
* @param itemConfigs the definitions
|
||||
* @param {*} [itemLayout] Optional layout for the child items
|
||||
* @param [itemLayout] Optional layout for the child items
|
||||
*/
|
||||
addItems(itemConfigs: Array<Component>, itemLayout?: TItemLayout): void;
|
||||
|
||||
@@ -2673,8 +2665,8 @@ declare module 'azdata' {
|
||||
* Creates a child component and adds it to this container.
|
||||
* Adding component to multiple containers is not supported
|
||||
*
|
||||
* @param {Component} component the component to be added
|
||||
* @param {*} [itemLayout] Optional layout for this child item
|
||||
* @param component the component to be added
|
||||
* @param [itemLayout] Optional layout for this child item
|
||||
*/
|
||||
addItem(component: Component, itemLayout?: TItemLayout): void;
|
||||
|
||||
@@ -2683,7 +2675,7 @@ declare module 'azdata' {
|
||||
* Adding component to multiple containers is not supported
|
||||
* @param component the component to be added
|
||||
* @param index the index to insert the component to
|
||||
* @param {*} [itemLayout] Optional layout for this child item
|
||||
* @param [itemLayout] Optional layout for this child item
|
||||
*/
|
||||
insertItem(component: Component, index: number, itemLayout?: TItemLayout): void;
|
||||
|
||||
@@ -2696,7 +2688,7 @@ declare module 'azdata' {
|
||||
/**
|
||||
* Defines the layout for this container
|
||||
*
|
||||
* @param {TLayout} layout object
|
||||
* @param layout object
|
||||
*/
|
||||
setLayout(layout: TLayout): void;
|
||||
}
|
||||
@@ -3372,7 +3364,6 @@ declare module 'azdata' {
|
||||
export namespace window {
|
||||
/**
|
||||
* creates a web view dialog
|
||||
* @param title
|
||||
*/
|
||||
export function createWebViewDialog(title: string): ModalDialog;
|
||||
|
||||
@@ -3736,14 +3727,14 @@ declare module 'azdata' {
|
||||
|
||||
/**
|
||||
* Make connection for the query editor
|
||||
* @param {string} fileUri file URI for the query editor
|
||||
* @param {string} connectionId connection ID
|
||||
* @param fileUri file URI for the query editor
|
||||
* @param connectionId connection ID
|
||||
*/
|
||||
export function connect(fileUri: string, connectionId: string): Thenable<void>;
|
||||
|
||||
/**
|
||||
* Run query if it is a query editor and it is already opened.
|
||||
* @param {string} fileUri file URI for the query editor
|
||||
* @param fileUri file URI for the query editor
|
||||
*/
|
||||
export function runQuery(fileUri: string, options?: Map<string, string>): void;
|
||||
|
||||
@@ -3752,7 +3743,7 @@ declare module 'azdata' {
|
||||
*/
|
||||
export function registerQueryEventListener(listener: queryeditor.QueryEventListener): void;
|
||||
|
||||
export function getQueryDocument(fileUri: string): queryeditor.QueryDocument
|
||||
export function getQueryDocument(fileUri: string): queryeditor.QueryDocument;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3944,8 +3935,8 @@ declare module 'azdata' {
|
||||
export namespace connection {
|
||||
/**
|
||||
* List the databases that can be accessed from the given connection
|
||||
* @param {string} connectionId The ID of the connection
|
||||
* @returns {string[]} An list of names of databases
|
||||
* @param connectionId The ID of the connection
|
||||
* @returns An list of names of databases
|
||||
*/
|
||||
export function listDatabases(connectionId: string): Thenable<string[]>;
|
||||
|
||||
@@ -3960,7 +3951,6 @@ declare module 'azdata' {
|
||||
/**
|
||||
* Opens the connection dialog, calls the callback with the result. If connection was successful
|
||||
* returns the connection otherwise returns undefined
|
||||
* @param callback
|
||||
*/
|
||||
export function openConnectionDialog(providers?: string[], initialConnectionProfile?: IConnectionProfile, connectionCompletionOptions?: IConnectionCompletionOptions): Thenable<connection.Connection>;
|
||||
|
||||
@@ -3974,8 +3964,6 @@ declare module 'azdata' {
|
||||
export namespace nb {
|
||||
/**
|
||||
* All notebook documents currently known to the system.
|
||||
*
|
||||
* @readonly
|
||||
*/
|
||||
export let notebookDocuments: NotebookDocument[];
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.custom-checkbox.sql-checkbox {
|
||||
.custom-checkbox.sql-checkbox {
|
||||
margin-right: 5px;
|
||||
margin-top: 2px;
|
||||
width: 12px;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user