diff --git a/azure-pipelines-linux-mac.yml b/azure-pipelines-linux-mac.yml index 90c1044df2..725d896143 100644 --- a/azure-pipelines-linux-mac.yml +++ b/azure-pipelines-linux-mac.yml @@ -24,12 +24,27 @@ steps: - script: | yarn - displayName: 'Install' + 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' diff --git a/azure-pipelines-windows.yml b/azure-pipelines-windows.yml index a6caba377b..5ce4c0a799 100644 --- a/azure-pipelines-windows.yml +++ b/azure-pipelines-windows.yml @@ -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' diff --git a/build/azure-pipelines/common/sync-mooncake.ts b/build/azure-pipelines/common/sync-mooncake.ts index af0db53068..a7a38d3211 100644 --- a/build/azure-pipelines/common/sync-mooncake.ts +++ b/build/azure-pipelines/common/sync-mooncake.ts @@ -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'; diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index db97428736..ad49b731fa 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -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}} - this.emit('end'); + 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'); + } })); } diff --git a/build/gulpfile.mixin.js b/build/gulpfile.mixin.js index f03209f894..48d9381422 100644 --- a/build/gulpfile.mixin.js +++ b/build/gulpfile.mixin.js @@ -6,21 +6,12 @@ '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'); gulp.task('mixin', function () { - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} const updateUrl = process.env['SQLOPS_UPDATEURL']; if (!updateUrl) { console.log('Missing SQLOPS_UPDATEURL, skipping mixin'); diff --git a/build/gulpfile.sql.js b/build/gulpfile.sql.js index a181fcdaa7..b7cb2df749 100644 --- a/build/gulpfile.sql.js +++ b/build/gulpfile.sql.js @@ -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); }); }); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index ed72b6b355..a563ed929f 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -27,7 +27,7 @@ function getDebPackageArch(arch) { } function prepareDebPackage(arch) { - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} const binaryDir = '../azuredatastudio-linux-' + arch; const debArch = getDebPackageArch(arch); const destination = '.build/linux/deb/' + debArch + '/' + product.applicationName + '-' + debArch; diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js index a311e2cd21..33145c2c4c 100644 --- a/build/gulpfile.vscode.win32.js +++ b/build/gulpfile.vscode.win32.js @@ -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 || {}; diff --git a/extensions/admin-tool-ext-win/package.nls.json b/extensions/admin-tool-ext-win/package.nls.json index 75d292cf28..f64fa0e48e 100644 --- a/extensions/admin-tool-ext-win/package.nls.json +++ b/extensions/admin-tool-ext-win/package.nls.json @@ -1,3 +1,3 @@ { - "adminToolExtWin.launchSsmsServerPropertiesDialog": "Properties" + "adminToolExtWin.launchSsmsServerPropertiesDialog": "Properties" } \ No newline at end of file diff --git a/extensions/admin-tool-ext-win/src/config.json b/extensions/admin-tool-ext-win/src/config.json index 48eea0a775..89eadffc31 100644 --- a/extensions/admin-tool-ext-win/src/config.json +++ b/extensions/admin-tool-ext-win/src/config.json @@ -1,12 +1,12 @@ { - "downloadUrl": "https://sqlopsextensions.blob.core.windows.net/tools/ssmsmin/{#version#}/{#fileName#}", - "version": "15.0.18092.0", - "downloadFileNames": { - "Windows_64": "SsmsMin-15.0.18092.0-win-x64.zip", - "Windows_86": "SsmsMin-15.0.18092.0-win-x86.zip" - }, - "installDirectory": "ssmsmin/{#platform#}/{#version#}", - "executableFiles": [ - "SsmsMin.exe" - ] + "downloadUrl": "https://sqlopsextensions.blob.core.windows.net/tools/ssmsmin/{#version#}/{#fileName#}", + "version": "15.0.18092.0", + "downloadFileNames": { + "Windows_64": "SsmsMin-15.0.18092.0-win-x64.zip", + "Windows_86": "SsmsMin-15.0.18092.0-win-x86.zip" + }, + "installDirectory": "ssmsmin/{#platform#}/{#version#}", + "executableFiles": [ + "SsmsMin.exe" + ] } diff --git a/extensions/admin-tool-ext-win/src/main.ts b/extensions/admin-tool-ext-win/src/main.ts index 2e0b4ac93c..05f219eaaf 100644 --- a/extensions/admin-tool-ext-win/src/main.ts +++ b/extensions/admin-tool-ext-win/src/main.ts @@ -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,9 +113,9 @@ 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( - /*command*/`"${exePath}" ${args}`, - /*options*/undefined, + let proc: ChildProcess = exec( + /*command*/`"${exePath}" ${args}`, + /*options*/undefined, (execException, stdout, stderr) => { // Process has exited so remove from map of running processes runningProcesses.delete(proc.pid); diff --git a/extensions/admin-tool-ext-win/src/telemetry.ts b/extensions/admin-tool-ext-win/src/telemetry.ts index a66295f152..d14333c4ff 100644 --- a/extensions/admin-tool-ext-win/src/telemetry.ts +++ b/extensions/admin-tool-ext-win/src/telemetry.ts @@ -13,123 +13,123 @@ import * as Utils from './utils'; const packageJson = require('../package.json'); export interface ITelemetryEventProperties { - [key: string]: string; + [key: string]: string; } export interface ITelemetryEventMeasures { - [key: string]: number; + [key: string]: number; } /** * Filters error paths to only include source files. Exported to support testing */ export function filterErrorPath(line: string): string { - if (line) { - let values: string[] = line.split('/out/'); - if (values.length <= 1) { - // Didn't match expected format - return line; - } else { - return values[1]; - } - } + if (line) { + let values: string[] = line.split('/out/'); + if (values.length <= 1) { + // Didn't match expected format + return line; + } else { + return values[1]; + } + } } export class Telemetry { - private static reporter: TelemetryReporter; - private static userId: string; - private static platformInformation: PlatformInformation; - private static disabled: boolean; + private static reporter: TelemetryReporter; + private static userId: string; + private static platformInformation: PlatformInformation; + private static disabled: boolean; - public static getPlatformInformation(): Promise { - if (this.platformInformation) { - return Promise.resolve(this.platformInformation); - } else { - return new Promise(resolve => { - PlatformInformation.getCurrent().then(info => { - this.platformInformation = info; - resolve(this.platformInformation); - }); - }); - } - } + public static getPlatformInformation(): Promise { + if (this.platformInformation) { + return Promise.resolve(this.platformInformation); + } else { + return new Promise(resolve => { + PlatformInformation.getCurrent().then(info => { + this.platformInformation = info; + resolve(this.platformInformation); + }); + }); + } + } - /** - * Disable telemetry reporting - */ - public static disable(): void { - this.disabled = true; - } + /** + * Disable telemetry reporting + */ + public static disable(): void { + this.disabled = true; + } - /** - * Initialize the telemetry reporter for use. - */ - public static initialize(): void { - if (typeof this.reporter === 'undefined') { - // Check if the user has opted out of telemetry - if (!vscode.workspace.getConfiguration('telemetry').get('enableTelemetry', true)) { - this.disable(); - return; - } + /** + * Initialize the telemetry reporter for use. + */ + public static initialize(): void { + if (typeof this.reporter === 'undefined') { + // Check if the user has opted out of telemetry + if (!vscode.workspace.getConfiguration('telemetry').get('enableTelemetry', true)) { + this.disable(); + return; + } - let packageInfo = Utils.getPackageInfo(packageJson); - this.reporter = new TelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey); - } - } + let packageInfo = Utils.getPackageInfo(packageJson); + this.reporter = new TelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey); + } + } - /** - * Send a telemetry event for an exception - */ - public static sendTelemetryEventForException( - err: any, methodName: string, extensionConfigName: string): void { - try { - let stackArray: string[]; - let firstLine: string = ''; - if (err !== undefined && err.stack !== undefined) { - stackArray = err.stack.split('\n'); - if (stackArray !== undefined && stackArray.length >= 2) { - firstLine = stackArray[1]; // The first line is the error message and we don't want to send that telemetry event - firstLine = filterErrorPath(firstLine); - } - } + /** + * Send a telemetry event for an exception + */ + public static sendTelemetryEventForException( + err: any, methodName: string, extensionConfigName: string): void { + try { + let stackArray: string[]; + let firstLine: string = ''; + if (err !== undefined && err.stack !== undefined) { + stackArray = err.stack.split('\n'); + if (stackArray !== undefined && stackArray.length >= 2) { + firstLine = stackArray[1]; // The first line is the error message and we don't want to send that telemetry event + firstLine = filterErrorPath(firstLine); + } + } - // Only adding the method name and the fist line of the stack trace. We don't add the error message because it might have PII - this.sendTelemetryEvent('Exception', { methodName: methodName, errorLine: firstLine }); - } catch (telemetryErr) { - // If sending telemetry event fails ignore it so it won't break the extension - console.error('Failed to send telemetry event. error: ' + telemetryErr, extensionConfigName); - } - } + // Only adding the method name and the fist line of the stack trace. We don't add the error message because it might have PII + this.sendTelemetryEvent('Exception', { methodName: methodName, errorLine: firstLine }); + } catch (telemetryErr) { + // If sending telemetry event fails ignore it so it won't break the extension + console.error('Failed to send telemetry event. error: ' + telemetryErr, extensionConfigName); + } + } - /** - * Send a telemetry event using application insights - */ - public static sendTelemetryEvent( - eventName: string, - properties?: ITelemetryEventProperties, - measures?: ITelemetryEventMeasures): void { + /** + * Send a telemetry event using application insights + */ + public static sendTelemetryEvent( + eventName: string, + properties?: ITelemetryEventProperties, + measures?: ITelemetryEventMeasures): void { - if (typeof this.disabled === 'undefined') { - this.disabled = false; - } + if (typeof this.disabled === 'undefined') { + this.disabled = false; + } - if (this.disabled || typeof (this.reporter) === 'undefined') { - // Don't do anything if telemetry is disabled - return; - } + if (this.disabled || typeof (this.reporter) === 'undefined') { + // Don't do anything if telemetry is disabled + return; + } - if (!properties || typeof properties === 'undefined') { - properties = {}; - } + if (!properties || typeof properties === 'undefined') { + properties = {}; + } - // Augment the properties structure with additional common properties before sending - Promise.all([this.getPlatformInformation()]).then(() => { - properties['distribution'] = (this.platformInformation && this.platformInformation.distribution) ? - `${this.platformInformation.distribution.name}, ${this.platformInformation.distribution.version}` : ''; + // Augment the properties structure with additional common properties before sending + Promise.all([this.getPlatformInformation()]).then(() => { + properties['distribution'] = (this.platformInformation && this.platformInformation.distribution) ? + `${this.platformInformation.distribution.name}, ${this.platformInformation.distribution.version}` : ''; - this.reporter.sendTelemetryEvent(eventName, properties, measures); - }); - } + this.reporter.sendTelemetryEvent(eventName, properties, measures); + }); + } } Telemetry.initialize(); diff --git a/extensions/admin-tool-ext-win/src/test/index.ts b/extensions/admin-tool-ext-win/src/test/index.ts index db42150eca..aa5127acdc 100644 --- a/extensions/admin-tool-ext-win/src/test/index.ts +++ b/extensions/admin-tool-ext-win/src/test/index.ts @@ -9,20 +9,20 @@ const testRunner = require('vscode/lib/testrunner'); const suite = 'Database Admin Tool Extensions for Windows'; const options: any = { - ui: 'bdd', - useColors: true, - timeout: 600000 + ui: 'bdd', + useColors: true, + timeout: 600000 }; if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) { - options.reporter = 'mocha-multi-reporters'; - options.reporterOptions = { - reporterEnabled: 'spec, mocha-junit-reporter', - mochaJunitReporterReporterOptions: { - testsuitesTitle: `${suite} ${process.platform}`, - mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`) - } - }; + options.reporter = 'mocha-multi-reporters'; + options.reporterOptions = { + reporterEnabled: 'spec, mocha-junit-reporter', + mochaJunitReporterReporterOptions: { + testsuitesTitle: `${suite} ${process.platform}`, + mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`) + } + }; } testRunner.configure(options); diff --git a/extensions/admin-tool-ext-win/src/test/utils.test.ts b/extensions/admin-tool-ext-win/src/test/utils.test.ts index 9724ffbb95..51b5fdc0f9 100644 --- a/extensions/admin-tool-ext-win/src/test/utils.test.ts +++ b/extensions/admin-tool-ext-win/src/test/utils.test.ts @@ -11,57 +11,57 @@ import 'mocha'; import * as extensionMain from '../main'; describe('buildSsmsMinCommandArgs Method Tests', () => { - it('Should be built correctly with all params and UseAAD as false', function (): void { - let params: extensionMain.LaunchSsmsDialogParams = { - action: 'myAction', - server: 'myServer', - database: 'myDatabase', - user: 'user', - password: 'password', - useAad: false, - urn: 'Server\\Database\\Table' - }; - let args = extensionMain.buildSsmsMinCommandArgs(params); - should(args).equal('-a "myAction" -S "myServer" -D "myDatabase" -U "user" -u "Server\\Database\\Table"'); - }); + it('Should be built correctly with all params and UseAAD as false', function (): void { + let params: extensionMain.LaunchSsmsDialogParams = { + action: 'myAction', + server: 'myServer', + database: 'myDatabase', + user: 'user', + password: 'password', + useAad: false, + urn: 'Server\\Database\\Table' + }; + let args = extensionMain.buildSsmsMinCommandArgs(params); + should(args).equal('-a "myAction" -S "myServer" -D "myDatabase" -U "user" -u "Server\\Database\\Table"'); + }); - it('Should be built correctly with all params and UseAAD as true', function (): void { - let params: extensionMain.LaunchSsmsDialogParams = { - action: 'myAction', - server: 'myServer', - database: 'myDatabase', - user: 'user', - password: 'password', - useAad: true, - urn: 'Server\\Database\\Table' - }; - let args = extensionMain.buildSsmsMinCommandArgs(params); - // User is omitted since UseAAD is true - should(args).equal('-a "myAction" -S "myServer" -D "myDatabase" -G -u "Server\\Database\\Table"'); - }); + it('Should be built correctly with all params and UseAAD as true', function (): void { + let params: extensionMain.LaunchSsmsDialogParams = { + action: 'myAction', + server: 'myServer', + database: 'myDatabase', + user: 'user', + password: 'password', + useAad: true, + urn: 'Server\\Database\\Table' + }; + let args = extensionMain.buildSsmsMinCommandArgs(params); + // User is omitted since UseAAD is true + should(args).equal('-a "myAction" -S "myServer" -D "myDatabase" -G -u "Server\\Database\\Table"'); + }); - it('Should be built correctly and names escaped correctly', function (): void { - let params: extensionMain.LaunchSsmsDialogParams = { - action: 'myAction\'"/\\[]tricky', - server: 'myServer\'"/\\[]tricky', - database: 'myDatabase\'"/\\[]tricky', - user: 'user\'"/\\[]tricky', - password: 'password', - useAad: true, - urn: 'Server\\Database[\'myDatabase\'\'"/\\[]tricky\']\\Table["myTable\'""/\\[]tricky"]' - }; - let args = extensionMain.buildSsmsMinCommandArgs(params); - // User is omitted since UseAAD is true - should(args).equal('-a "myAction\'\\"/\\[]tricky" -S "myServer\'\\"/\\[]tricky" -D "myDatabase\'\\"/\\[]tricky" -G -u "Server\\Database[\'myDatabase\'\'\\"/\\[]tricky\']\\Table[\\"myTable\'\\"\\"/\\[]tricky\\"]"'); - }); + it('Should be built correctly and names escaped correctly', function (): void { + let params: extensionMain.LaunchSsmsDialogParams = { + action: 'myAction\'"/\\[]tricky', + server: 'myServer\'"/\\[]tricky', + database: 'myDatabase\'"/\\[]tricky', + user: 'user\'"/\\[]tricky', + password: 'password', + useAad: true, + urn: 'Server\\Database[\'myDatabase\'\'"/\\[]tricky\']\\Table["myTable\'""/\\[]tricky"]' + }; + let args = extensionMain.buildSsmsMinCommandArgs(params); + // User is omitted since UseAAD is true + should(args).equal('-a "myAction\'\\"/\\[]tricky" -S "myServer\'\\"/\\[]tricky" -D "myDatabase\'\\"/\\[]tricky" -G -u "Server\\Database[\'myDatabase\'\'\\"/\\[]tricky\']\\Table[\\"myTable\'\\"\\"/\\[]tricky\\"]"'); + }); - it('Should be built correctly with only action and server', function (): void { + it('Should be built correctly with only action and server', function (): void { - let params: extensionMain.LaunchSsmsDialogParams = { - action: 'myAction', - server: 'myServer' - }; - let args = extensionMain.buildSsmsMinCommandArgs(params); - should(args).equal('-a "myAction" -S "myServer"'); - }); + let params: extensionMain.LaunchSsmsDialogParams = { + action: 'myAction', + server: 'myServer' + }; + let args = extensionMain.buildSsmsMinCommandArgs(params); + should(args).equal('-a "myAction" -S "myServer"'); + }); }); diff --git a/extensions/admin-tool-ext-win/src/utils.ts b/extensions/admin-tool-ext-win/src/utils.ts index cd77461ec4..5d0497763a 100644 --- a/extensions/admin-tool-ext-win/src/utils.ts +++ b/extensions/admin-tool-ext-win/src/utils.ts @@ -7,19 +7,19 @@ import * as vscode from 'vscode'; export interface IPackageInfo { - name: string; - version: string; - aiKey: string; + name: string; + version: string; + aiKey: string; } export function getPackageInfo(packageJson: any): IPackageInfo { - if (packageJson) { - return { - name: packageJson.name, - version: packageJson.version, - aiKey: packageJson.aiKey - }; - } + if (packageJson) { + return { + name: packageJson.name, + version: packageJson.version, + aiKey: packageJson.aiKey + }; + } } /** @@ -28,15 +28,15 @@ export function getPackageInfo(packageJson: any): IPackageInfo { * @param resource The optional URI, as a URI object or a string, to use to get resource-scoped configurations */ export function getConfiguration(extensionName?: string, resource?: vscode.Uri | string): vscode.WorkspaceConfiguration { - if (typeof resource === 'string') { - try { - resource = this.parseUri(resource); - } catch (e) { - resource = undefined; - } - } else if (!resource) { - // Fix to avoid adding lots of errors to debug console. Expects a valid resource or null, not undefined - resource = null; - } - return vscode.workspace.getConfiguration(extensionName, resource as vscode.Uri); + if (typeof resource === 'string') { + try { + resource = this.parseUri(resource); + } catch (e) { + resource = undefined; + } + } else if (!resource) { + // Fix to avoid adding lots of errors to debug console. Expects a valid resource or null, not undefined + resource = null; + } + return vscode.workspace.getConfiguration(extensionName, resource as vscode.Uri); } diff --git a/extensions/admin-tool-ext-win/tsconfig.json b/extensions/admin-tool-ext-win/tsconfig.json index 1096df454c..563a016a53 100644 --- a/extensions/admin-tool-ext-win/tsconfig.json +++ b/extensions/admin-tool-ext-win/tsconfig.json @@ -1,22 +1,22 @@ { - "compileOnSave": true, - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "outDir": "./out", - "lib": [ - "es6", "es2015.promise" - ], - "typeRoots": [ - "./node_modules/@types" - ], - "sourceMap": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "moduleResolution": "node", - "declaration": true - }, - "exclude": [ - "node_modules" - ] + "compileOnSave": true, + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "outDir": "./out", + "lib": [ + "es6", "es2015.promise" + ], + "typeRoots": [ + "./node_modules/@types" + ], + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "moduleResolution": "node", + "declaration": true + }, + "exclude": [ + "node_modules" + ] } \ No newline at end of file diff --git a/extensions/agent/src/agentUtils.ts b/extensions/agent/src/agentUtils.ts index 16b75c8308..2fa8e27556 100644 --- a/extensions/agent/src/agentUtils.ts +++ b/extensions/agent/src/agentUtils.ts @@ -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'; diff --git a/extensions/agent/src/apiWrapper.ts b/extensions/agent/src/apiWrapper.ts index 926912ce30..3329407e4b 100644 --- a/extensions/agent/src/apiWrapper.ts +++ b/extensions/agent/src/apiWrapper.ts @@ -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,52 +11,51 @@ import * as data from 'azdata'; * this API from our code * * @export - * @class ApiWrapper */ export class ApiWrapper { - // Data APIs + // Data APIs - public registerWebviewProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void { - return data.dashboard.registerWebviewProvider(widgetId, handler); - } + public registerWebviewProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void { + return data.dashboard.registerWebviewProvider(widgetId, handler); + } - public registerControlHostProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void { - return data.dashboard.registerWebviewProvider(widgetId, handler); - } + public registerControlHostProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void { + return data.dashboard.registerWebviewProvider(widgetId, handler); + } - /** - * Get the configuration for a extensionName - * @param extensionName The string name of the extension to get the configuration for - * @param resource The optional URI, as a URI object or a string, to use to get resource-scoped configurations - */ - public getConfiguration(extensionName: string, resource?: vscode.Uri | string): vscode.WorkspaceConfiguration { - if (typeof resource === 'string') { - try { - resource = this.parseUri(resource); - } catch (e) { - resource = undefined; - } - } - return vscode.workspace.getConfiguration(extensionName, resource as vscode.Uri); - } + /** + * Get the configuration for a extensionName + * @param extensionName The string name of the extension to get the configuration for + * @param resource The optional URI, as a URI object or a string, to use to get resource-scoped configurations + */ + public getConfiguration(extensionName: string, resource?: vscode.Uri | string): vscode.WorkspaceConfiguration { + if (typeof resource === 'string') { + try { + resource = this.parseUri(resource); + } catch (e) { + resource = undefined; + } + } + return vscode.workspace.getConfiguration(extensionName, resource as vscode.Uri); + } - /** - * Parse uri - */ - public parseUri(uri: string): vscode.Uri { - return vscode.Uri.parse(uri); - } + /** + * Parse uri + */ + public parseUri(uri: string): vscode.Uri { + return vscode.Uri.parse(uri); + } - public showOpenDialog(options: vscode.OpenDialogOptions): Thenable { - return vscode.window.showOpenDialog(options); - } + public showOpenDialog(options: vscode.OpenDialogOptions): Thenable { + return vscode.window.showOpenDialog(options); + } - public showErrorMessage(message: string, ...items: string[]): Thenable { - return vscode.window.showErrorMessage(message, ...items); - } + public showErrorMessage(message: string, ...items: string[]): Thenable { + return vscode.window.showErrorMessage(message, ...items); + } - public get workspaceRootPath(): string { - return vscode.workspace.rootPath; - } + public get workspaceRootPath(): string { + return vscode.workspace.rootPath; + } } diff --git a/extensions/agent/src/data/alertData.ts b/extensions/agent/src/data/alertData.ts index 9dbf3faeaa..604685061f 100644 --- a/extensions/agent/src/data/alertData.ts +++ b/extensions/agent/src/data/alertData.ts @@ -17,7 +17,7 @@ export class AlertData implements IAgentDialogData { public static readonly AlertTypeSqlServerEventString: string = localize('alertData.DefaultAlertTypString', 'SQL Server event alert'); public static readonly AlertTypePerformanceConditionString: string = localize('alertDialog.PerformanceCondition', 'SQL Server performance condition alert'); public static readonly AlertTypeWmiEventString: string = localize('alertDialog.WmiEvent', 'WMI event alert'); - public static readonly DefaultAlertTypeString: string = AlertData.AlertTypeSqlServerEventString; + public static readonly DefaultAlertTypeString: string = AlertData.AlertTypeSqlServerEventString; ownerUri: string; dialogMode: AgentDialogMode = AgentDialogMode.CREATE; @@ -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 diff --git a/extensions/agent/src/data/jobData.ts b/extensions/agent/src/data/jobData.ts index a436939452..f5c849518f 100644 --- a/extensions/agent/src/data/jobData.ts +++ b/extensions/agent/src/data/jobData.ts @@ -14,7 +14,7 @@ const localize = nls.loadMessageBundle(); export class JobData implements IAgentDialogData { - private readonly JobCompletionActionCondition_Always: string = localize('jobData.whenJobCompletes', 'When the job completes'); + private readonly JobCompletionActionCondition_Always: string = localize('jobData.whenJobCompletes', 'When the job completes'); private readonly JobCompletionActionCondition_OnFailure: string = localize('jobData.whenJobFails', 'When the job fails'); private readonly JobCompletionActionCondition_OnSuccess: string = localize('jobData.whenJobSucceeds', 'When the job succeeds'); @@ -126,7 +126,7 @@ export class JobData implements IAgentDialogData { public async save() { let jobInfo: azdata.AgentJobInfo = this.toAgentJobInfo(); let result = this.dialogMode === AgentDialogMode.CREATE - ? await this._agentService.createJob(this.ownerUri, jobInfo) + ? await this._agentService.createJob(this.ownerUri, jobInfo) : await this._agentService.updateJob(this.ownerUri, this.originalName, jobInfo); if (!result || !result.success) { if (this.dialogMode === AgentDialogMode.EDIT) { @@ -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)); } } diff --git a/extensions/agent/src/data/jobStepData.ts b/extensions/agent/src/data/jobStepData.ts index 226a702e6a..3a4c2668c0 100644 --- a/extensions/agent/src/data/jobStepData.ts +++ b/extensions/agent/src/data/jobStepData.ts @@ -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; @@ -102,26 +102,26 @@ export class JobStepData implements IAgentDialogData { stepData.jobName = jobStepInfo.jobName; stepData.script = jobStepInfo.script; stepData.scriptName = jobStepInfo.scriptName, - stepData.stepName = jobStepInfo.stepName, - stepData.subSystem = jobStepInfo.subSystem, - stepData.id = jobStepInfo.id, - stepData.failureAction = jobStepInfo.failureAction, - stepData.successAction = jobStepInfo.successAction, - stepData.failStepId = jobStepInfo.failStepId, - stepData.successStepId = jobStepInfo.successStepId, - stepData.command = jobStepInfo.command, - stepData.commandExecutionSuccessCode = jobStepInfo.commandExecutionSuccessCode, - stepData.databaseName = jobStepInfo.databaseName, - stepData.databaseUserName = jobStepInfo.databaseUserName, - stepData.server = jobStepInfo.server, - stepData.outputFileName = jobStepInfo.outputFileName, - stepData.appendToLogFile = jobStepInfo.appendToLogFile, - stepData.appendToStepHist = jobStepInfo.appendToStepHist, - stepData.writeLogToTable = jobStepInfo.writeLogToTable, - stepData.appendLogToTable = jobStepInfo.appendLogToTable, - stepData.retryAttempts = jobStepInfo.retryAttempts, - stepData.retryInterval = jobStepInfo.retryInterval, - stepData.proxyName = jobStepInfo.proxyName; + stepData.stepName = jobStepInfo.stepName, + stepData.subSystem = jobStepInfo.subSystem, + stepData.id = jobStepInfo.id, + stepData.failureAction = jobStepInfo.failureAction, + stepData.successAction = jobStepInfo.successAction, + stepData.failStepId = jobStepInfo.failStepId, + stepData.successStepId = jobStepInfo.successStepId, + stepData.command = jobStepInfo.command, + stepData.commandExecutionSuccessCode = jobStepInfo.commandExecutionSuccessCode, + stepData.databaseName = jobStepInfo.databaseName, + stepData.databaseUserName = jobStepInfo.databaseUserName, + stepData.server = jobStepInfo.server, + stepData.outputFileName = jobStepInfo.outputFileName, + stepData.appendToLogFile = jobStepInfo.appendToLogFile, + stepData.appendToStepHist = jobStepInfo.appendToStepHist, + stepData.writeLogToTable = jobStepInfo.writeLogToTable, + stepData.appendLogToTable = jobStepInfo.appendLogToTable, + stepData.retryAttempts = jobStepInfo.retryAttempts, + stepData.retryInterval = jobStepInfo.retryInterval, + stepData.proxyName = jobStepInfo.proxyName; stepData.dialogMode = AgentDialogMode.EDIT; stepData.viaJobDialog = true; return stepData; diff --git a/extensions/agent/src/data/operatorData.ts b/extensions/agent/src/data/operatorData.ts index 7d760e61f4..198404d3cb 100644 --- a/extensions/agent/src/data/operatorData.ts +++ b/extensions/agent/src/data/operatorData.ts @@ -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; @@ -58,7 +58,7 @@ export class OperatorData implements IAgentDialogData { public async save() { let agentService = await AgentUtils.getAgentService(); - let result = await agentService.createOperator(this.ownerUri, this.toAgentOperatorInfo()); + let result = await agentService.createOperator(this.ownerUri, this.toAgentOperatorInfo()); if (!result || !result.success) { // TODO handle error here } diff --git a/extensions/agent/src/data/pickScheduleData.ts b/extensions/agent/src/data/pickScheduleData.ts index 5be15d679a..cc69316279 100644 --- a/extensions/agent/src/data/pickScheduleData.ts +++ b/extensions/agent/src/data/pickScheduleData.ts @@ -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; } diff --git a/extensions/agent/src/data/proxyData.ts b/extensions/agent/src/data/proxyData.ts index d95716f2a2..cf5f3e7f26 100644 --- a/extensions/agent/src/data/proxyData.ts +++ b/extensions/agent/src/data/proxyData.ts @@ -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)); } } diff --git a/extensions/agent/src/data/scheduleData.ts b/extensions/agent/src/data/scheduleData.ts index aaa55b8f75..19814bf067 100644 --- a/extensions/agent/src/data/scheduleData.ts +++ b/extensions/agent/src/data/scheduleData.ts @@ -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; } diff --git a/extensions/agent/src/dialogs/alertDialog.ts b/extensions/agent/src/dialogs/alertDialog.ts index 2c4a505f5a..0b44b5e022 100644 --- a/extensions/agent/src/dialogs/alertDialog.ts +++ b/extensions/agent/src/dialogs/alertDialog.ts @@ -62,14 +62,14 @@ export class AlertDialog extends AgentDialog { private static readonly AlertSeverity025Label: string = localize('alertDialog.Severity025', '025 - Fatal Error'); private static readonly AllDatabases: string = localize('alertDialog.AllDatabases', ''); - private static readonly AlertTypes: string[] = [ + private static readonly AlertTypes: string[] = [ AlertData.AlertTypeSqlServerEventString, // Disabled until next release // AlertData.AlertTypePerformanceConditionString, // AlertData.AlertTypeWmiEventString ]; - private static readonly AlertSeverities: string[] = [ + private static readonly AlertSeverities: string[] = [ AlertDialog.AlertSeverity001Label, AlertDialog.AlertSeverity002Label, AlertDialog.AlertSeverity003Label, @@ -100,21 +100,21 @@ export class AlertDialog extends AgentDialog { // Response tab strings private static readonly ExecuteJobCheckBoxLabel: string = localize('alertDialog.ExecuteJob', 'Execute Job'); private static readonly ExecuteJobTextBoxLabel: string = localize('alertDialog.ExecuteJobName', 'Job Name'); - private static readonly NotifyOperatorsTextBoxLabel: string = localize('alertDialog.NotifyOperators', 'Notify Operators'); - private static readonly NewJobButtonLabel: string = localize('alertDialog.NewJob', 'New Job'); - private static readonly OperatorListLabel: string = localize('alertDialog.OperatorList', 'Operator List'); - private static readonly OperatorNameColumnLabel: string = localize('alertDialog.OperatorName', 'Operator'); - private static readonly OperatorEmailColumnLabel: string = localize('alertDialog.OperatorEmail', 'E-mail'); - private static readonly OperatorPagerColumnLabel: string = localize('alertDialog.OperatorPager', 'Pager'); - private static readonly NewOperatorButtonLabel: string = localize('alertDialog.NewOperator', 'New Operator'); + private static readonly NotifyOperatorsTextBoxLabel: string = localize('alertDialog.NotifyOperators', 'Notify Operators'); + private static readonly NewJobButtonLabel: string = localize('alertDialog.NewJob', 'New Job'); + private static readonly OperatorListLabel: string = localize('alertDialog.OperatorList', 'Operator List'); + private static readonly OperatorNameColumnLabel: string = localize('alertDialog.OperatorName', 'Operator'); + private static readonly OperatorEmailColumnLabel: string = localize('alertDialog.OperatorEmail', 'E-mail'); + private static readonly OperatorPagerColumnLabel: string = localize('alertDialog.OperatorPager', 'Pager'); + private static readonly NewOperatorButtonLabel: string = localize('alertDialog.NewOperator', 'New Operator'); // Options tab strings - private static readonly IncludeErrorInEmailCheckBoxLabel: string = localize('alertDialog.IncludeErrorInEmail', 'Include alert error text in e-mail'); - private static readonly IncludeErrorInPagerCheckBoxLabel: string = localize('alertDialog.IncludeErrorInPager', 'Include alert error text in pager'); - private static readonly AdditionalMessageTextBoxLabel: string = localize('alertDialog.AdditionalNotification', 'Additional notification message to send'); - private static readonly DelayBetweenResponsesTextBoxLabel: string = localize('alertDialog.DelayBetweenResponse', 'Delay between responses'); - private static readonly DelayMinutesTextBoxLabel: string = localize('alertDialog.DelayMinutes', 'Delay Minutes'); - private static readonly DelaySecondsTextBoxLabel: string = localize('alertDialog.DelaySeconds', 'Delay Seconds'); + private static readonly IncludeErrorInEmailCheckBoxLabel: string = localize('alertDialog.IncludeErrorInEmail', 'Include alert error text in e-mail'); + private static readonly IncludeErrorInPagerCheckBoxLabel: string = localize('alertDialog.IncludeErrorInPager', 'Include alert error text in pager'); + private static readonly AdditionalMessageTextBoxLabel: string = localize('alertDialog.AdditionalNotification', 'Additional notification message to send'); + private static readonly DelayBetweenResponsesTextBoxLabel: string = localize('alertDialog.DelayBetweenResponse', 'Delay between responses'); + private static readonly DelayMinutesTextBoxLabel: string = localize('alertDialog.DelayMinutes', 'Delay Minutes'); + private static readonly DelaySecondsTextBoxLabel: string = localize('alertDialog.DelaySeconds', 'Delay Seconds'); // Event Name strings private readonly NewAlertDialog = 'NewAlertDialogOpen'; @@ -315,7 +315,7 @@ export class AlertDialog extends AgentDialog { }], title: AlertDialog.EventAlertText } - ]).withLayout({ width: '100%' }).component(); + ]).withLayout({ width: '100%' }).component(); await view.initializeModel(formModel); @@ -332,7 +332,7 @@ export class AlertDialog extends AgentDialog { 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) { @@ -356,9 +356,9 @@ export class AlertDialog extends AgentDialog { .component(); this.executeJobTextBox.enabled = false; this.newJobButton = view.modelBuilder.button().withProperties({ - label: AlertDialog.NewJobButtonLabel, - width: 80 - }).component(); + label: AlertDialog.NewJobButtonLabel, + width: 80 + }).component(); this.newJobButton.enabled = false; this.newJobButton.onDidClick(() => { let jobDialog = new JobDialog(this.ownerUri); @@ -382,7 +382,7 @@ export class AlertDialog extends AgentDialog { }, { component: this.newJobButton, title: AlertDialog.NewJobButtonLabel - }], { componentWidth: '100%'}).component(); + }], { componentWidth: '100%' }).component(); let previewTag = view.modelBuilder.text() .withProperties({ @@ -409,9 +409,9 @@ export class AlertDialog extends AgentDialog { }).component(); this.newOperatorButton = view.modelBuilder.button().withProperties({ - label: AlertDialog.NewOperatorButtonLabel, - width: 80 - }).component(); + label: AlertDialog.NewOperatorButtonLabel, + width: 80 + }).component(); this.operatorsTable.enabled = false; this.newOperatorButton.enabled = false; @@ -438,7 +438,7 @@ export class AlertDialog extends AgentDialog { }, { component: this.newOperatorButton, title: '' - }], { componentWidth: '100%'}).component(); + }], { componentWidth: '100%' }).component(); let formModel = view.modelBuilder.formContainer() .withFormItems([{ @@ -548,7 +548,7 @@ export class AlertDialog extends AgentDialog { } else { this.model.eventDescriptionKeyword = ''; } - let minutes = this.delayMinutesTextBox.value ? +this.delayMinutesTextBox.value : 0; + let minutes = this.delayMinutesTextBox.value ? +this.delayMinutesTextBox.value : 0; let seconds = this.delaySecondsTextBox.value ? +this.delaySecondsTextBox : 0; this.model.delayBetweenResponses = minutes + seconds; diff --git a/extensions/agent/src/dialogs/jobDialog.ts b/extensions/agent/src/dialogs/jobDialog.ts index 2ba896392e..ca7fc661b9 100644 --- a/extensions/agent/src/dialogs/jobDialog.ts +++ b/extensions/agent/src/dialogs/jobDialog.ts @@ -70,7 +70,7 @@ export class JobDialog extends AgentDialog { // Event Name strings private readonly NewJobDialogEvent: string = 'NewJobDialogOpened'; - private readonly EditJobDialogEvent: string = 'EditJobDialogOpened'; + private readonly EditJobDialogEvent: string = 'EditJobDialogOpened'; // UI Components private generalTab: azdata.window.DialogTab; @@ -259,9 +259,9 @@ export class JobDialog extends AgentDialog { 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); @@ -296,7 +296,7 @@ export class JobDialog extends AgentDialog { this.deleteStepButton.enabled = false; this.moveStepUpButton.onDidClick(() => { - let rowNumber = this.stepsTable.selectedRows[0]; + let rowNumber = this.stepsTable.selectedRows[0]; let previousRow = rowNumber - 1; let previousStep = this.steps[previousRow]; let previousStepId = this.steps[previousRow].id; @@ -329,7 +329,7 @@ export class JobDialog extends AgentDialog { 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 { } }); - 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 { 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 { 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; @@ -507,8 +507,8 @@ export class JobDialog extends AgentDialog { pickScheduleDialog.showDialog(); }); this.removeScheduleButton.onDidClick(() => { - if (this.schedulesTable.selectedRows.length === 1) { - let selectedRow = this.schedulesTable.selectedRows[0]; + if (this.schedulesTable.selectedRows.length === 1) { + let selectedRow = this.schedulesTable.selectedRows[0]; let selectedScheduleName = this.schedulesTable.data[selectedRow][1]; for (let i = 0; i < this.schedules.length; i++) { if (this.schedules[i].name === selectedScheduleName) { @@ -595,22 +595,23 @@ export class JobDialog extends AgentDialog { let formModel = view.modelBuilder.formContainer().withFormItems([ { components: - [{ - component: emailContainer, - title: '' - }, - { - component: pagerContainer, - title: '' - }, - { - component: eventLogContainer, - title: '' - }, - { - component: deleteJobContainer, - title: '' - }], title: this.NotificationsTabTopLabelString}]).withLayout({ width: '100%' }).component(); + [{ + component: emailContainer, + title: '' + }, + { + component: pagerContainer, + title: '' + }, + { + component: eventLogContainer, + title: '' + }, + { + component: deleteJobContainer, + title: '' + }], title: this.NotificationsTabTopLabelString + }]).withLayout({ width: '100%' }).component(); await view.initializeModel(formModel); this.emailConditionDropdown.values = this.model.JobCompletionActionConditions; @@ -694,7 +695,7 @@ export class JobDialog extends AgentDialog { this.model.pageLevel = this.getActualConditionValue(this.pagerCheckBox, this.pagerConditionDropdown); this.model.eventLogLevel = this.getActualConditionValue(this.eventLogCheckBox, this.eventLogConditionDropdown); this.model.deleteLevel = this.getActualConditionValue(this.deleteJobCheckBox, this.deleteJobConditionDropdown); - this.model.startStepId = this.startStepDropdown.enabled ? +this.getDropdownValue(this.startStepDropdown) : 1; + this.model.startStepId = this.startStepDropdown.enabled ? +this.getDropdownValue(this.startStepDropdown) : 1; if (!this.model.jobSteps) { this.model.jobSteps = []; } diff --git a/extensions/agent/src/dialogs/jobStepDialog.ts b/extensions/agent/src/dialogs/jobStepDialog.ts index daafa3a149..f5933fc9db 100644 --- a/extensions/agent/src/dialogs/jobStepDialog.ts +++ b/extensions/agent/src/dialogs/jobStepDialog.ts @@ -28,7 +28,7 @@ export class JobStepDialog extends AgentDialog { 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'); @@ -124,15 +124,15 @@ export class JobStepDialog extends AgentDialog { viaJobDialog: boolean = false ) { super(ownerUri, - jobStepInfo ? JobStepData.convertToJobStepData(jobStepInfo, jobModel) : new JobStepData(ownerUri, jobModel, viaJobDialog), - jobStepInfo ? JobStepDialog.EditDialogTitle : JobStepDialog.NewDialogTitle); + jobStepInfo ? JobStepData.convertToJobStepData(jobStepInfo, jobModel) : new JobStepData(ownerUri, jobModel, viaJobDialog), + jobStepInfo ? JobStepDialog.EditDialogTitle : JobStepDialog.NewDialogTitle); this.stepId = jobStepInfo ? - jobStepInfo.id : jobModel.jobSteps ? - jobModel.jobSteps.length + 1 : 1; + jobStepInfo.id : jobModel.jobSteps ? + jobModel.jobSteps.length + 1 : 1; this.isEdit = jobStepInfo ? true : false; this.model.dialogMode = this.isEdit ? AgentDialogMode.EDIT : AgentDialogMode.CREATE; this.jobModel = jobModel; - this.jobName = this.jobName ? this.jobName : this.jobModel.name; + this.jobName = this.jobName ? this.jobName : this.jobModel.name; this.server = server; this.dialogName = this.isEdit ? this.EditStepDialog : this.NewStepDialog; } @@ -164,7 +164,7 @@ export class JobStepDialog extends AgentDialog { 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 { }).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 { 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 { this.processExitCodeBox.value = ''; this.processExitCodeBox.enabled = false; break; - case(this.CmdExec): + case (this.CmdExec): this.databaseDropdown.enabled = false; this.databaseDropdown.values = ['']; this.databaseDropdown.value = ''; @@ -397,13 +397,13 @@ export class JobStepDialog extends AgentDialog { let retryAttemptsContainer = view.modelBuilder.formContainer() .withFormItems( - [{ - component: this.retryAttemptsBox, - title: this.RetryAttemptsLabel - }], { - horizontal: false, - componentWidth: '100%' - }) + [{ + component: this.retryAttemptsBox, + title: this.RetryAttemptsLabel + }], { + horizontal: false, + componentWidth: '100%' + }) .component(); let retryIntervalContainer = view.modelBuilder.formContainer() @@ -411,7 +411,7 @@ export class JobStepDialog extends AgentDialog { [{ component: this.retryIntervalBox, title: this.RetryIntervalLabel - }], { + }], { horizontal: false }) .component(); @@ -427,13 +427,13 @@ export class JobStepDialog extends AgentDialog { let fileBrowserTitle = this.FileBrowserDialogTitle + `${this.server}`; this.fileBrowserDialog = azdata.window.createModelViewDialog(fileBrowserTitle); let fileBrowserTab = azdata.window.createTab('File Browser'); - this.fileBrowserDialog.content = [fileBrowserTab]; + this.fileBrowserDialog.content = [fileBrowserTab]; fileBrowserTab.registerContent(async (view) => { this.fileBrowserTree = view.modelBuilder.fileBrowserTree() .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; @@ -462,7 +462,7 @@ export class JobStepDialog extends AgentDialog { component: this.fileBrowserNameBox, title: this.FileNameLabelString } - ]).component(); + ]).component(); view.initializeModel(fileBrowserContainer); }); this.fileBrowserDialog.okButton.onClick(() => { diff --git a/extensions/agent/src/dialogs/operatorDialog.ts b/extensions/agent/src/dialogs/operatorDialog.ts index 27714264dd..89b44d50f6 100644 --- a/extensions/agent/src/dialogs/operatorDialog.ts +++ b/extensions/agent/src/dialogs/operatorDialog.ts @@ -135,7 +135,7 @@ export class OperatorDialog extends AgentDialog { 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 { }).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 { }).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 { }, { component: pagerSundayCheckboxContainer, title: '' - }] , + }], title: OperatorDialog.PagerDutyScheduleLabel }]).withLayout({ width: '100%' }).component(); await view.initializeModel(formModel); diff --git a/extensions/agent/src/dialogs/pickScheduleDialog.ts b/extensions/agent/src/dialogs/pickScheduleDialog.ts index 2083bbb581..06d029476b 100644 --- a/extensions/agent/src/dialogs/pickScheduleDialog.ts +++ b/extensions/agent/src/dialogs/pickScheduleDialog.ts @@ -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; } diff --git a/extensions/agent/src/dialogs/proxyDialog.ts b/extensions/agent/src/dialogs/proxyDialog.ts index 7e07e3dbd3..dad2466ee8 100644 --- a/extensions/agent/src/dialogs/proxyDialog.ts +++ b/extensions/agent/src/dialogs/proxyDialog.ts @@ -84,7 +84,7 @@ export class ProxyDialog extends AgentDialog { this.generalTab.registerContent(async view => { this.proxyNameTextBox = view.modelBuilder.inputBox() - .withProperties({width: 420}) + .withProperties({ width: 420 }) .component(); this.credentialNameDropDown = view.modelBuilder.dropDown() diff --git a/extensions/agent/src/dialogs/scheduleDialog.ts b/extensions/agent/src/dialogs/scheduleDialog.ts index 4c06658d4f..59e5a2f9b5 100644 --- a/extensions/agent/src/dialogs/scheduleDialog.ts +++ b/extensions/agent/src/dialogs/scheduleDialog.ts @@ -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; } diff --git a/extensions/agent/src/mainController.ts b/extensions/agent/src/mainController.ts index 73c5c36bbd..b21587efa3 100644 --- a/extensions/agent/src/mainController.ts +++ b/extensions/agent/src/mainController.ts @@ -22,57 +22,57 @@ const localize = nls.loadMessageBundle(); * The main controller class that initializes the extension */ export class MainController { - protected _context: vscode.ExtensionContext; + protected _context: vscode.ExtensionContext; - // PUBLIC METHODS ////////////////////////////////////////////////////// - public constructor(context: vscode.ExtensionContext) { - this._context = context; - } + // PUBLIC METHODS ////////////////////////////////////////////////////// + public constructor(context: vscode.ExtensionContext) { + this._context = context; + } - public static showNotYetImplemented(): void { - vscode.window.showInformationMessage( - localize('mainController.notImplemented', "This feature is under development. Check-out the latest insiders build if you'd like to try out the most recent changes!")); - } + public static showNotYetImplemented(): void { + vscode.window.showInformationMessage( + localize('mainController.notImplemented', "This feature is under development. Check-out the latest insiders build if you'd like to try out the most recent changes!")); + } - /** - * Activates the extension - */ - public activate(): void { - vscode.commands.registerCommand('agent.openJobDialog', async (ownerUri: string, jobInfo: azdata.AgentJobInfo) => { - let dialog = new JobDialog(ownerUri, jobInfo); - 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) => { - 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(); - }); - }); - vscode.commands.registerCommand('agent.openPickScheduleDialog', async (ownerUri: string, jobName: string) => { - let dialog = new PickScheduleDialog(ownerUri, jobName); - await dialog.showDialog(); - }); - vscode.commands.registerCommand('agent.openAlertDialog', (ownerUri: string, jobInfo: azdata.AgentJobInfo, alertInfo: azdata.AgentAlertInfo) => { - AgentUtils.getAgentService().then(async (agentService) => { - let jobData: JobData = new JobData(ownerUri, jobInfo, agentService); - let dialog = new AlertDialog(ownerUri, jobData, alertInfo, false); - dialog.dialogName ? await dialog.openDialog(dialog.dialogName) : await dialog.openDialog(); - }); - }); - vscode.commands.registerCommand('agent.openOperatorDialog', async (ownerUri: string, operatorInfo: azdata.AgentOperatorInfo) => { - let dialog = new OperatorDialog(ownerUri, operatorInfo); - dialog.dialogName ? await dialog.openDialog(dialog.dialogName) : await dialog.openDialog(); - }); - vscode.commands.registerCommand('agent.openProxyDialog', async (ownerUri: string, proxyInfo: azdata.AgentProxyInfo, credentials: azdata.CredentialInfo[]) => { - let dialog = new ProxyDialog(ownerUri, proxyInfo, credentials); - dialog.dialogName ? await dialog.openDialog(dialog.dialogName) : await dialog.openDialog(); - }); - } + /** + * Activates the extension + */ + public activate(): void { + vscode.commands.registerCommand('agent.openJobDialog', async (ownerUri: string, jobInfo: azdata.AgentJobInfo) => { + let dialog = new JobDialog(ownerUri, jobInfo); + 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) => { + 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(); + }); + }); + vscode.commands.registerCommand('agent.openPickScheduleDialog', async (ownerUri: string, jobName: string) => { + let dialog = new PickScheduleDialog(ownerUri, jobName); + await dialog.showDialog(); + }); + vscode.commands.registerCommand('agent.openAlertDialog', (ownerUri: string, jobInfo: azdata.AgentJobInfo, alertInfo: azdata.AgentAlertInfo) => { + AgentUtils.getAgentService().then(async (agentService) => { + let jobData: JobData = new JobData(ownerUri, jobInfo, agentService); + let dialog = new AlertDialog(ownerUri, jobData, alertInfo, false); + dialog.dialogName ? await dialog.openDialog(dialog.dialogName) : await dialog.openDialog(); + }); + }); + vscode.commands.registerCommand('agent.openOperatorDialog', async (ownerUri: string, operatorInfo: azdata.AgentOperatorInfo) => { + let dialog = new OperatorDialog(ownerUri, operatorInfo); + dialog.dialogName ? await dialog.openDialog(dialog.dialogName) : await dialog.openDialog(); + }); + vscode.commands.registerCommand('agent.openProxyDialog', async (ownerUri: string, proxyInfo: azdata.AgentProxyInfo, credentials: azdata.CredentialInfo[]) => { + let dialog = new ProxyDialog(ownerUri, proxyInfo, credentials); + dialog.dialogName ? await dialog.openDialog(dialog.dialogName) : await dialog.openDialog(); + }); + } - /** - * Deactivates the extension - */ - public deactivate(): void { - } + /** + * Deactivates the extension + */ + public deactivate(): void { + } } diff --git a/extensions/agent/tsconfig.json b/extensions/agent/tsconfig.json index e6baa6d40d..9bf2e497f7 100644 --- a/extensions/agent/tsconfig.json +++ b/extensions/agent/tsconfig.json @@ -1,19 +1,18 @@ { - "compileOnSave": true, - "compilerOptions": { - "module": "commonjs", - "target": "es6", + "compileOnSave": true, + "compilerOptions": { + "module": "commonjs", + "target": "es6", "outDir": "./out", "lib": [ "es6", "es2015.promise" ], - "sourceMap": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "moduleResolution": "node", - "declaration": true - }, - "exclude": [ - "node_modules" - ] + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "moduleResolution": "node" + }, + "exclude": [ + "node_modules" + ] } diff --git a/extensions/azurecore/src/account-provider/azureAccountProvider.ts b/extensions/azurecore/src/account-provider/azureAccountProvider.ts index e3f6ae7adf..30acdfacf9 100644 --- a/extensions/azurecore/src/account-provider/azureAccountProvider.ts +++ b/extensions/azurecore/src/account-provider/azureAccountProvider.ts @@ -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} 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 { 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} Promise to clear the token cache + * @returns Promise to clear the token cache */ public clearTokenCache(): Thenable { return this._tokenCache.clear(); @@ -92,13 +90,13 @@ export class AzureAccountProvider implements azdata.AccountProvider { // NOTE: Based on ADAL implementation, getting tokens should use the refresh token if necessary let task = this.getAccessTokens(account, azdata.AzureResource.ResourceManagement) .then( - () => { - return account; - }, - () => { - account.isStale = true; - return account; - } + () => { + return account; + }, + () => { + account.isStale = true; + return account; + } ); rehydrationTasks.push(task); } @@ -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} 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 { 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} 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 { return new Promise((resolve, reject) => { diff --git a/extensions/azurecore/src/account-provider/azureAccountProviderService.ts b/extensions/azurecore/src/account-provider/azureAccountProviderService.ts index 6202c39fc0..9f93074575 100644 --- a/extensions/azurecore/src/account-provider/azureAccountProviderService.ts +++ b/extensions/azurecore/src/account-provider/azureAccountProviderService.ts @@ -77,14 +77,14 @@ export class AzureAccountProviderService implements vscode.Disposable { return Promise.all(promises) .then( - () => { - let message = localize('clearTokenCacheSuccess', 'Token cache successfully cleared'); - vscode.window.showInformationMessage(`${constants.extensionName}: ${message}`); - }, - err => { - let message = localize('clearTokenCacheFailure', 'Failed to clear token cache'); - vscode.window.showErrorMessage(`${constants.extensionName}: ${message}: ${err}`); - }); + () => { + let message = localize('clearTokenCacheSuccess', 'Token cache successfully cleared'); + vscode.window.showInformationMessage(`${constants.extensionName}: ${message}`); + }, + err => { + let message = localize('clearTokenCacheFailure', 'Failed to clear token cache'); + vscode.window.showErrorMessage(`${constants.extensionName}: ${message}: ${err}`); + }); } private onDidChangeConfiguration(): void { diff --git a/extensions/azurecore/src/account-provider/interfaces.ts b/extensions/azurecore/src/account-provider/interfaces.ts index bb1c5ad3ec..2da13684e4 100644 --- a/extensions/azurecore/src/account-provider/interfaces.ts +++ b/extensions/azurecore/src/account-provider/interfaces.ts @@ -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'; diff --git a/extensions/azurecore/src/account-provider/tokenCache.ts b/extensions/azurecore/src/account-provider/tokenCache.ts index 81f91295ce..4225cc26da 100644 --- a/extensions/azurecore/src/account-provider/tokenCache.ts +++ b/extensions/azurecore/src/account-provider/tokenCache.ts @@ -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'; @@ -34,8 +32,8 @@ export default class TokenCache implements adal.TokenCache { .then(cache => self.addToCache(cache, entries)) .then(updatedCache => self.writeCache(updatedCache)) .then( - () => callback(null, false), - (err) => callback(err, true) + () => callback(null, false), + (err) => callback(err, true) ); }); } @@ -70,8 +68,8 @@ export default class TokenCache implements adal.TokenCache { ); }) .then( - results => callback(null, results), - (err) => callback(err, null) + results => callback(null, results), + (err) => callback(err, null) ); }); } @@ -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} 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 { @@ -104,16 +102,16 @@ export default class TokenCache implements adal.TokenCache { .then(cache => self.removeFromCache(cache, entries)) .then(updatedCache => self.writeCache(updatedCache)) .then( - () => callback(null, null), - (err) => callback(err, null) + () => callback(null, null), + (err) => callback(err, null) ); }); } /** * 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} 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 { @@ -186,8 +184,8 @@ export default class TokenCache implements adal.TokenCache { if (splitValues.length === 2 && splitValues[0] && splitValues[1]) { try { return { - 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 diff --git a/extensions/azurecore/src/apiWrapper.ts b/extensions/azurecore/src/apiWrapper.ts index 41e9315edf..a37914bcd3 100644 --- a/extensions/azurecore/src/apiWrapper.ts +++ b/extensions/azurecore/src/apiWrapper.ts @@ -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 diff --git a/extensions/azurecore/src/azureResource/providers/database/commands.ts b/extensions/azurecore/src/azureResource/providers/database/commands.ts index 8369834a41..954ba1b7d8 100644 --- a/extensions/azurecore/src/azureResource/providers/database/commands.ts +++ b/extensions/azurecore/src/azureResource/providers/database/commands.ts @@ -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; } diff --git a/extensions/azurecore/src/azureResource/providers/databaseServer/commands.ts b/extensions/azurecore/src/azureResource/providers/databaseServer/commands.ts index cbe768e374..664c205866 100644 --- a/extensions/azurecore/src/azureResource/providers/databaseServer/commands.ts +++ b/extensions/azurecore/src/azureResource/providers/databaseServer/commands.ts @@ -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; } diff --git a/extensions/azurecore/src/azureResource/providers/databaseServer/databaseServerService.ts b/extensions/azurecore/src/azureResource/providers/databaseServer/databaseServerService.ts index 5dcfd1b8aa..bf87ba9bbc 100644 --- a/extensions/azurecore/src/azureResource/providers/databaseServer/databaseServerService.ts +++ b/extensions/azurecore/src/azureResource/providers/databaseServer/databaseServerService.ts @@ -21,9 +21,9 @@ export class AzureResourceDatabaseServerService implements IAzureResourceDatabas svrs.forEach((svr) => databaseServers.push({ name: svr.name, - fullName: svr.fullyQualifiedDomainName, - loginName: svr.administratorLogin, - defaultDatabaseName: 'master' + fullName: svr.fullyQualifiedDomainName, + loginName: svr.administratorLogin, + defaultDatabaseName: 'master' })); return databaseServers; diff --git a/extensions/azurecore/src/azureResource/providers/databaseServer/interfaces.ts b/extensions/azurecore/src/azureResource/providers/databaseServer/interfaces.ts index 7bfa3e5c21..b4cf6dc64f 100644 --- a/extensions/azurecore/src/azureResource/providers/databaseServer/interfaces.ts +++ b/extensions/azurecore/src/azureResource/providers/databaseServer/interfaces.ts @@ -5,7 +5,7 @@ 'use strict'; -import { ServiceClientCredentials } from 'ms-rest'; +import { ServiceClientCredentials } from 'ms-rest'; import { azureResource } from '../../azure-resource'; import { AzureResourceDatabaseServer } from './models'; diff --git a/extensions/azurecore/src/azureResource/services/cacheService.ts b/extensions/azurecore/src/azureResource/services/cacheService.ts index d6d4780470..826236783c 100644 --- a/extensions/azurecore/src/azureResource/services/cacheService.ts +++ b/extensions/azurecore/src/azureResource/services/cacheService.ts @@ -17,10 +17,10 @@ export class AzureResourceCacheService implements IAzureResourceCacheService { } public generateKey(id: string): string { - return `${AzureResourceCacheService.cacheKeyPrefix}.${id}`; - } + return `${AzureResourceCacheService.cacheKeyPrefix}.${id}`; + } - public get(key: string): T | undefined { + public get(key: string): T | undefined { return this._context.workspaceState.get(key); } diff --git a/extensions/azurecore/src/azureResource/services/subscriptionFilterService.ts b/extensions/azurecore/src/azureResource/services/subscriptionFilterService.ts index 0d963e81d2..b0f1def106 100644 --- a/extensions/azurecore/src/azureResource/services/subscriptionFilterService.ts +++ b/extensions/azurecore/src/azureResource/services/subscriptionFilterService.ts @@ -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 { - let selectedSubscriptionsCache: { [accountId: string]: azureResource.AzureResourceSubscription[]} = {}; + let selectedSubscriptionsCache: { [accountId: string]: azureResource.AzureResourceSubscription[] } = {}; const cache = this._cacheService.get(this._cacheKey); if (cache) { diff --git a/extensions/azurecore/src/azureResource/tree/accountTreeNode.ts b/extensions/azurecore/src/azureResource/tree/accountTreeNode.ts index 3dd54e1a80..f815dc51b7 100644 --- a/extensions/azurecore/src/azureResource/tree/accountTreeNode.ts +++ b/extensions/azurecore/src/azureResource/tree/accountTreeNode.ts @@ -46,7 +46,7 @@ export class AzureResourceAccountTreeNode extends AzureResourceContainerTreeNode if (this._isClearingCache) { try { - const tokens = await this.appContext.apiWrapper.getSecurityToken(this.account, AzureResource.ResourceManagement); + const tokens = await this.appContext.apiWrapper.getSecurityToken(this.account, AzureResource.ResourceManagement); for (const tenant of this.account.properties.tenants) { const token = tokens[tenant.id].token; diff --git a/extensions/azurecore/src/azureResource/tree/baseTreeNodes.ts b/extensions/azurecore/src/azureResource/tree/baseTreeNodes.ts index 35530fcd01..f5533a02ea 100644 --- a/extensions/azurecore/src/azureResource/tree/baseTreeNodes.ts +++ b/extensions/azurecore/src/azureResource/tree/baseTreeNodes.ts @@ -44,8 +44,8 @@ export abstract class AzureResourceContainerTreeNodeBase extends AzureResourceTr } protected setCacheKey(id: string): void { - this._cacheKey = this._cacheService.generateKey(id); - } + this._cacheKey = this._cacheService.generateKey(id); + } protected updateCache(cache: T): void { this._cacheService.update(this._cacheKey, cache); diff --git a/extensions/azurecore/src/azureResource/tree/subscriptionTreeNode.ts b/extensions/azurecore/src/azureResource/tree/subscriptionTreeNode.ts index 476cfe7055..9177ca4f69 100644 --- a/extensions/azurecore/src/azureResource/tree/subscriptionTreeNode.ts +++ b/extensions/azurecore/src/azureResource/tree/subscriptionTreeNode.ts @@ -86,7 +86,7 @@ export class AzureResourceSubscriptionTreeNode extends AzureResourceContainerTre } public get nodePathValue(): string { - return this._id; + return this._id; } private _id: string = undefined; diff --git a/extensions/azurecore/src/azureResource/treeNode.ts b/extensions/azurecore/src/azureResource/treeNode.ts index 2e7ea861c2..560a5dcb5a 100644 --- a/extensions/azurecore/src/azureResource/treeNode.ts +++ b/extensions/azurecore/src/azureResource/treeNode.ts @@ -45,7 +45,7 @@ export abstract class TreeNode { if (children) { for (let child of children) { if (filter && filter(child)) { - let childNode = await this.findNode(child, condition, filter, expandIfNeeded); + let childNode = await this.findNode(child, condition, filter, expandIfNeeded); if (childNode) { return childNode; } diff --git a/extensions/azurecore/src/azureResource/utils.ts b/extensions/azurecore/src/azureResource/utils.ts index b907d58493..c629193b1b 100644 --- a/extensions/azurecore/src/azureResource/utils.ts +++ b/extensions/azurecore/src/azureResource/utils.ts @@ -9,7 +9,7 @@ import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); export function getErrorMessage(error: Error | string): string { - return (error instanceof Error) ? error.message : error; + return (error instanceof Error) ? error.message : error; } export class AzureResourceErrorMessageUtil { @@ -19,78 +19,78 @@ export class AzureResourceErrorMessageUtil { } export function generateGuid(): string { - let hexValues: string[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']; - // c.f. rfc4122 (UUID version 4 = xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx) - let oct: string = ''; - let tmp: number; - /* tslint:disable:no-bitwise */ - for (let a: number = 0; a < 4; a++) { - tmp = (4294967296 * Math.random()) | 0; - oct += hexValues[tmp & 0xF] + - hexValues[tmp >> 4 & 0xF] + - hexValues[tmp >> 8 & 0xF] + - hexValues[tmp >> 12 & 0xF] + - hexValues[tmp >> 16 & 0xF] + - hexValues[tmp >> 20 & 0xF] + - hexValues[tmp >> 24 & 0xF] + - hexValues[tmp >> 28 & 0xF]; - } + let hexValues: string[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']; + // c.f. rfc4122 (UUID version 4 = xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx) + let oct: string = ''; + let tmp: number; + /* tslint:disable:no-bitwise */ + for (let a: number = 0; a < 4; a++) { + tmp = (4294967296 * Math.random()) | 0; + oct += hexValues[tmp & 0xF] + + hexValues[tmp >> 4 & 0xF] + + hexValues[tmp >> 8 & 0xF] + + hexValues[tmp >> 12 & 0xF] + + hexValues[tmp >> 16 & 0xF] + + hexValues[tmp >> 20 & 0xF] + + hexValues[tmp >> 24 & 0xF] + + hexValues[tmp >> 28 & 0xF]; + } - // 'Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively' - let clockSequenceHi: string = hexValues[8 + (Math.random() * 4) | 0]; - return oct.substr(0, 8) + '-' + oct.substr(9, 4) + '-4' + oct.substr(13, 3) + '-' + clockSequenceHi + oct.substr(16, 3) + '-' + oct.substr(19, 12); - /* tslint:enable:no-bitwise */ + // 'Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively' + let clockSequenceHi: string = hexValues[8 + (Math.random() * 4) | 0]; + return oct.substr(0, 8) + '-' + oct.substr(9, 4) + '-4' + oct.substr(13, 3) + '-' + clockSequenceHi + oct.substr(16, 3) + '-' + oct.substr(19, 12); + /* tslint:enable:no-bitwise */ } export function equals(one: any, other: any): boolean { - if (one === other) { - return true; - } - if (one === null || one === undefined || other === null || other === undefined) { - return false; - } - if (typeof one !== typeof other) { - return false; - } - if (typeof one !== 'object') { - return false; - } - if ((Array.isArray(one)) !== (Array.isArray(other))) { - return false; - } + if (one === other) { + return true; + } + if (one === null || one === undefined || other === null || other === undefined) { + return false; + } + if (typeof one !== typeof other) { + return false; + } + if (typeof one !== 'object') { + return false; + } + if ((Array.isArray(one)) !== (Array.isArray(other))) { + return false; + } - let i: number; - let key: string; + let i: number; + let key: string; - if (Array.isArray(one)) { - if (one.length !== other.length) { - return false; - } - for (i = 0; i < one.length; i++) { - if (!equals(one[i], other[i])) { - return false; - } - } - } else { - const oneKeys: string[] = []; + if (Array.isArray(one)) { + if (one.length !== other.length) { + return false; + } + for (i = 0; i < one.length; i++) { + if (!equals(one[i], other[i])) { + return false; + } + } + } else { + const oneKeys: string[] = []; - for (key in one) { - oneKeys.push(key); - } - oneKeys.sort(); - const otherKeys: string[] = []; - for (key in other) { - otherKeys.push(key); - } - otherKeys.sort(); - if (!equals(oneKeys, otherKeys)) { - return false; - } - for (i = 0; i < oneKeys.length; i++) { - if (!equals(one[oneKeys[i]], other[oneKeys[i]])) { - return false; - } - } - } - return true; + for (key in one) { + oneKeys.push(key); + } + oneKeys.sort(); + const otherKeys: string[] = []; + for (key in other) { + otherKeys.push(key); + } + otherKeys.sort(); + if (!equals(oneKeys, otherKeys)) { + return false; + } + for (i = 0; i < oneKeys.length; i++) { + if (!equals(one[oneKeys[i]], other[oneKeys[i]])) { + return false; + } + } + } + return true; } \ No newline at end of file diff --git a/extensions/azurecore/src/constants.ts b/extensions/azurecore/src/constants.ts index 591a359587..50eb2eb531 100644 --- a/extensions/azurecore/src/constants.ts +++ b/extensions/azurecore/src/constants.ts @@ -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'; diff --git a/extensions/azurecore/src/controllers/azureResourceController.ts b/extensions/azurecore/src/controllers/azureResourceController.ts index 6daed0888d..fc4c29b72f 100644 --- a/extensions/azurecore/src/controllers/azureResourceController.ts +++ b/extensions/azurecore/src/controllers/azureResourceController.ts @@ -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'; diff --git a/extensions/azurecore/src/extension.ts b/extensions/azurecore/src/extension.ts index 62e0c7c8e4..75c84db5ae 100644 --- a/extensions/azurecore/src/extension.ts +++ b/extensions/azurecore/src/extension.ts @@ -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'); diff --git a/extensions/big-data-cluster/src/config/config.ts b/extensions/big-data-cluster/src/config/config.ts index 4ba6b5d8e1..05e440ced8 100644 --- a/extensions/big-data-cluster/src/config/config.ts +++ b/extensions/big-data-cluster/src/config/config.ts @@ -12,110 +12,110 @@ const KUBECONFIG_PATH_KEY = 'mssql-bdc.kubeconfig'; const KNOWN_KUBECONFIGS_KEY = 'mssql-bdc.knownKubeconfigs'; export async function addPathToConfig(configKey: string, value: string): Promise { - await setConfigValue(configKey, value); + await setConfigValue(configKey, value); } async function setConfigValue(configKey: string, value: any): Promise { - await atAllConfigScopes(addValueToConfigAtScope, configKey, value); + await atAllConfigScopes(addValueToConfigAtScope, configKey, value); } async function addValueToConfigAtScope(configKey: string, value: any, scope: vscode.ConfigurationTarget, valueAtScope: any, createIfNotExist: boolean): Promise { - if (!createIfNotExist) { - if (!valueAtScope || !(valueAtScope[configKey])) { - return; - } - } + if (!createIfNotExist) { + if (!valueAtScope || !(valueAtScope[configKey])) { + return; + } + } - let newValue: any = {}; - if (valueAtScope) { - newValue = Object.assign({}, valueAtScope); - } - newValue[configKey] = value; - await vscode.workspace.getConfiguration().update(EXTENSION_CONFIG_KEY, newValue, scope); + let newValue: any = {}; + if (valueAtScope) { + newValue = Object.assign({}, valueAtScope); + } + newValue[configKey] = value; + await vscode.workspace.getConfiguration().update(EXTENSION_CONFIG_KEY, newValue, scope); } async function addValueToConfigArray(configKey: string, value: string): Promise { - await atAllConfigScopes(addValueToConfigArrayAtScope, configKey, value); + await atAllConfigScopes(addValueToConfigArrayAtScope, configKey, value); } async function addValueToConfigArrayAtScope(configKey: string, value: string, scope: vscode.ConfigurationTarget, valueAtScope: any, createIfNotExist: boolean): Promise { - if (!createIfNotExist) { - if (!valueAtScope || !(valueAtScope[configKey])) { - return; - } - } + if (!createIfNotExist) { + if (!valueAtScope || !(valueAtScope[configKey])) { + return; + } + } - let newValue: any = {}; - if (valueAtScope) { - newValue = Object.assign({}, valueAtScope); - } - const arrayEntry: string[] = newValue[configKey] || []; - arrayEntry.push(value); - newValue[configKey] = arrayEntry; - await vscode.workspace.getConfiguration().update(EXTENSION_CONFIG_KEY, newValue, scope); + let newValue: any = {}; + if (valueAtScope) { + newValue = Object.assign({}, valueAtScope); + } + const arrayEntry: string[] = newValue[configKey] || []; + arrayEntry.push(value); + newValue[configKey] = arrayEntry; + await vscode.workspace.getConfiguration().update(EXTENSION_CONFIG_KEY, newValue, scope); } type ConfigUpdater = (configKey: string, value: T, scope: vscode.ConfigurationTarget, valueAtScope: any, createIfNotExist: boolean) => Promise; async function atAllConfigScopes(fn: ConfigUpdater, configKey: string, value: T): Promise { - const config = vscode.workspace.getConfiguration().inspect(EXTENSION_CONFIG_KEY)!; - await fn(configKey, value, vscode.ConfigurationTarget.Global, config.globalValue, true); - await fn(configKey, value, vscode.ConfigurationTarget.Workspace, config.workspaceValue, false); - await fn(configKey, value, vscode.ConfigurationTarget.WorkspaceFolder, config.workspaceFolderValue, false); + const config = vscode.workspace.getConfiguration().inspect(EXTENSION_CONFIG_KEY)!; + await fn(configKey, value, vscode.ConfigurationTarget.Global, config.globalValue, true); + await fn(configKey, value, vscode.ConfigurationTarget.Workspace, config.workspaceValue, false); + await fn(configKey, value, vscode.ConfigurationTarget.WorkspaceFolder, config.workspaceFolderValue, false); } // Functions for working with the list of known kubeconfigs export function getKnownKubeconfigs(): string[] { - const kkcConfig = vscode.workspace.getConfiguration(EXTENSION_CONFIG_KEY)[KNOWN_KUBECONFIGS_KEY]; - if (!kkcConfig || !kkcConfig.length) { - return []; - } - return kkcConfig as string[]; + const kkcConfig = vscode.workspace.getConfiguration(EXTENSION_CONFIG_KEY)[KNOWN_KUBECONFIGS_KEY]; + if (!kkcConfig || !kkcConfig.length) { + return []; + } + return kkcConfig as string[]; } export async function addKnownKubeconfig(kubeconfigPath: string) { - await addValueToConfigArray(KNOWN_KUBECONFIGS_KEY, kubeconfigPath); + await addValueToConfigArray(KNOWN_KUBECONFIGS_KEY, kubeconfigPath); } // Functions for working with the active kubeconfig setting export async function setActiveKubeconfig(kubeconfig: string): Promise { - await addPathToConfig(KUBECONFIG_PATH_KEY, kubeconfig); + await addPathToConfig(KUBECONFIG_PATH_KEY, kubeconfig); } export function getActiveKubeconfig(): string { - return vscode.workspace.getConfiguration(EXTENSION_CONFIG_KEY)[KUBECONFIG_PATH_KEY]; + return vscode.workspace.getConfiguration(EXTENSION_CONFIG_KEY)[KUBECONFIG_PATH_KEY]; } // Functions for working with tool paths export function getToolPath(host: Host, shell: Shell, tool: string): string | undefined { - const baseKey = toolPathBaseKey(tool); - return getPathSetting(host, shell, baseKey); + const baseKey = toolPathBaseKey(tool); + return getPathSetting(host, shell, baseKey); } function getPathSetting(host: Host, shell: Shell, baseKey: string): string | undefined { - const os = shell.platform(); - const osOverridePath = host.getConfiguration(EXTENSION_CONFIG_KEY)[osOverrideKey(os, baseKey)]; - return osOverridePath || host.getConfiguration(EXTENSION_CONFIG_KEY)[baseKey]; + const os = shell.platform(); + const osOverridePath = host.getConfiguration(EXTENSION_CONFIG_KEY)[osOverrideKey(os, baseKey)]; + return osOverridePath || host.getConfiguration(EXTENSION_CONFIG_KEY)[baseKey]; } export function toolPathBaseKey(tool: string): string { - return `mssql-bdc.${tool}-path`; + return `mssql-bdc.${tool}-path`; } function osOverrideKey(os: Platform, baseKey: string): string { - const osKey = osKeyString(os); - return osKey ? `${baseKey}.${osKey}` : baseKey; // The 'else' clause should never happen so don't worry that this would result in double-checking a missing base key + const osKey = osKeyString(os); + return osKey ? `${baseKey}.${osKey}` : baseKey; // The 'else' clause should never happen so don't worry that this would result in double-checking a missing base key } function osKeyString(os: Platform): string | null { - switch (os) { - case Platform.Windows: return 'windows'; - case Platform.MacOS: return 'mac'; - case Platform.Linux: return 'linux'; - default: return null; - } + switch (os) { + case Platform.Windows: return 'windows'; + case Platform.MacOS: return 'mac'; + case Platform.Linux: return 'linux'; + default: return null; + } } diff --git a/extensions/big-data-cluster/src/installer/download.ts b/extensions/big-data-cluster/src/installer/download.ts index b616b99a0f..f80aba6827 100644 --- a/extensions/big-data-cluster/src/installer/download.ts +++ b/extensions/big-data-cluster/src/installer/download.ts @@ -10,36 +10,36 @@ import * as tmp from 'tmp'; import { succeeded, Errorable } from '../interfaces'; type DownloadFunc = - (url: string, destination?: string, options?: any) - => Promise & stream.Duplex; // Stream has additional events - see https://www.npmjs.com/package/download + (url: string, destination?: string, options?: any) + => Promise & stream.Duplex; // Stream has additional events - see https://www.npmjs.com/package/download let download: DownloadFunc; function ensureDownloadFunc() { - if (!download) { - const home = process.env['HOME']; - download = require('download'); - if (home) { - process.env['HOME'] = home; - } - } + if (!download) { + const home = process.env['HOME']; + download = require('download'); + if (home) { + process.env['HOME'] = home; + } + } } export async function toTempFile(sourceUrl: string): Promise> { - const tempFileObj = tmp.fileSync({ prefix: 'mssql-bdc-autoinstall-' }); - const downloadResult = await to(sourceUrl, tempFileObj.name); - if (succeeded(downloadResult)) { - return { succeeded: true, result: tempFileObj.name }; - } - return { succeeded: false, error: downloadResult.error }; + const tempFileObj = tmp.fileSync({ prefix: 'mssql-bdc-autoinstall-' }); + const downloadResult = await to(sourceUrl, tempFileObj.name); + if (succeeded(downloadResult)) { + return { succeeded: true, result: tempFileObj.name }; + } + return { succeeded: false, error: downloadResult.error }; } export async function to(sourceUrl: string, destinationFile: string): Promise> { - ensureDownloadFunc(); - try { - await download(sourceUrl, path.dirname(destinationFile), { filename: path.basename(destinationFile) }); - return { succeeded: true, result: null }; - } catch (e) { - return { succeeded: false, error: [e.message] }; - } + ensureDownloadFunc(); + try { + await download(sourceUrl, path.dirname(destinationFile), { filename: path.basename(destinationFile) }); + return { succeeded: true, result: null }; + } catch (e) { + return { succeeded: false, error: [e.message] }; + } } diff --git a/extensions/big-data-cluster/src/installer/installer.ts b/extensions/big-data-cluster/src/installer/installer.ts index 02e74daa15..62b0ad37c9 100644 --- a/extensions/big-data-cluster/src/installer/installer.ts +++ b/extensions/big-data-cluster/src/installer/installer.ts @@ -16,57 +16,57 @@ import { Errorable, failed } from '../interfaces'; import { addPathToConfig, toolPathBaseKey } from '../config/config'; export async function installKubectl(shell: Shell): Promise> { - const tool = 'kubectl'; - const binFile = (shell.isUnix()) ? 'kubectl' : 'kubectl.exe'; - const os = platformUrlString(shell.platform()); + const tool = 'kubectl'; + const binFile = (shell.isUnix()) ? 'kubectl' : 'kubectl.exe'; + const os = platformUrlString(shell.platform()); - const version = await getStableKubectlVersion(); - if (failed(version)) { - return { succeeded: false, error: version.error }; - } + const version = await getStableKubectlVersion(); + if (failed(version)) { + return { succeeded: false, error: version.error }; + } - const installFolder = getInstallFolder(shell, tool); - mkdirp.sync(installFolder); + const installFolder = getInstallFolder(shell, tool); + mkdirp.sync(installFolder); - const kubectlUrl = `https://storage.googleapis.com/kubernetes-release/release/${version.result.trim()}/bin/${os}/amd64/${binFile}`; - const downloadFile = path.join(installFolder, binFile); - const downloadResult = await download.to(kubectlUrl, downloadFile); - if (failed(downloadResult)) { - return { succeeded: false, error: [localize('downloadKubectlFailed', 'Failed to download kubectl: {0}', downloadResult.error[0])] }; - } + const kubectlUrl = `https://storage.googleapis.com/kubernetes-release/release/${version.result.trim()}/bin/${os}/amd64/${binFile}`; + const downloadFile = path.join(installFolder, binFile); + const downloadResult = await download.to(kubectlUrl, downloadFile); + if (failed(downloadResult)) { + return { succeeded: false, error: [localize('downloadKubectlFailed', 'Failed to download kubectl: {0}', downloadResult.error[0])] }; + } - if (shell.isUnix()) { - fs.chmodSync(downloadFile, '0777'); - } + if (shell.isUnix()) { + fs.chmodSync(downloadFile, '0777'); + } - await addPathToConfig(toolPathBaseKey(tool), downloadFile); - return { succeeded: true, result: null }; + await addPathToConfig(toolPathBaseKey(tool), downloadFile); + return { succeeded: true, result: null }; } async function getStableKubectlVersion(): Promise> { - const downloadResult = await download.toTempFile('https://storage.googleapis.com/kubernetes-release/release/stable.txt'); - if (failed(downloadResult)) { - return { succeeded: false, error: [localize('kubectlVersionCheckFailed', 'Failed to establish kubectl stable version: {0}', downloadResult.error[0])] }; - } - const version = fs.readFileSync(downloadResult.result, 'utf-8'); - fs.unlinkSync(downloadResult.result); - return { succeeded: true, result: version }; + const downloadResult = await download.toTempFile('https://storage.googleapis.com/kubernetes-release/release/stable.txt'); + if (failed(downloadResult)) { + return { succeeded: false, error: [localize('kubectlVersionCheckFailed', 'Failed to establish kubectl stable version: {0}', downloadResult.error[0])] }; + } + const version = fs.readFileSync(downloadResult.result, 'utf-8'); + fs.unlinkSync(downloadResult.result); + return { succeeded: true, result: version }; } export function getInstallFolder(shell: Shell, tool: string): string { - return path.join(shell.home(), `.mssql-bdc/tools/${tool}`); + return path.join(shell.home(), `.mssql-bdc/tools/${tool}`); } function platformUrlString(platform: Platform, supported?: Platform[]): string | null { - if (supported && supported.indexOf(platform) < 0) { - return null; - } - switch (platform) { - case Platform.Windows: return 'windows'; - case Platform.MacOS: return 'darwin'; - case Platform.Linux: return 'linux'; - default: return null; - } + if (supported && supported.indexOf(platform) < 0) { + return null; + } + switch (platform) { + case Platform.Windows: return 'windows'; + case Platform.MacOS: return 'darwin'; + case Platform.Linux: return 'linux'; + default: return null; + } } diff --git a/extensions/big-data-cluster/src/kubectl/binutil.ts b/extensions/big-data-cluster/src/kubectl/binutil.ts index 33c275330d..85d1195ed2 100644 --- a/extensions/big-data-cluster/src/kubectl/binutil.ts +++ b/extensions/big-data-cluster/src/kubectl/binutil.ts @@ -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'; @@ -11,111 +11,111 @@ import { Host } from './host'; import { FS } from '../utility/fs'; export interface BinCheckContext { - readonly host: Host; - readonly fs: FS; - readonly shell: Shell; - readonly installDependenciesCallback: () => void; - binFound: boolean; - binPath: string; + readonly host: Host; + readonly fs: FS; + readonly shell: Shell; + readonly installDependenciesCallback: () => void; + binFound: boolean; + binPath: string; } interface FindBinaryResult { - err: number | null; - output: string; + err: number | null; + output: string; } async function findBinary(shell: Shell, binName: string): Promise { - let cmd = `which ${binName}`; + let cmd = `which ${binName}`; - if (shell.isWindows()) { - cmd = `where.exe ${binName}.exe`; - } + if (shell.isWindows()) { + cmd = `where.exe ${binName}.exe`; + } - const opts = { - async: true, - env: { - HOME: process.env.HOME, - PATH: process.env.PATH - } - }; + const opts = { + async: true, + env: { + HOME: process.env.HOME, + PATH: process.env.PATH + } + }; - const execResult = await shell.execCore(cmd, opts); - if (execResult.code) { - return { err: execResult.code, output: execResult.stderr }; - } + const execResult = await shell.execCore(cmd, opts); + if (execResult.code) { + return { err: execResult.code, output: execResult.stderr }; + } - return { err: null, output: execResult.stdout }; + return { err: null, output: execResult.stdout }; } export function execPath(shell: Shell, basePath: string): string { - let bin = basePath; - if (shell.isWindows() && bin && !(bin.endsWith('.exe'))) { - bin = bin + '.exe'; - } - return bin; + let bin = basePath; + if (shell.isWindows() && bin && !(bin.endsWith('.exe'))) { + bin = bin + '.exe'; + } + return bin; } 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': - host.showErrorMessage(message, installDependenciesAction, learnMoreAction).then( - (str) => { - switch (str) { - case learnMoreAction: - host.showInformationMessage(localize('moreInfoMsg', 'Add {0} directory to path, or set "mssql-bdc.{0}-path" config to {0} binary.', binName)); - break; - case installDependenciesAction: - installDependencies(); - break; - } + switch (failureReason) { + case 'inferFailed': + host.showErrorMessage(message, installDependenciesAction, learnMoreAction).then( + (str) => { + switch (str) { + case learnMoreAction: + host.showInformationMessage(localize('moreInfoMsg', 'Add {0} directory to path, or set "mssql-bdc.{0}-path" config to {0} binary.', binName)); + break; + case installDependenciesAction: + installDependencies(); + break; + } - } - ); - break; - case 'configuredFileMissing': - host.showErrorMessage(message, installDependenciesAction).then( - (str) => { - if (str === installDependenciesAction) { - installDependencies(); - } - } - ); - break; - } + } + ); + break; + case 'configuredFileMissing': + host.showErrorMessage(message, installDependenciesAction).then( + (str) => { + if (str === installDependenciesAction) { + installDependencies(); + } + } + ); + break; + } } export async function checkForBinary(context: BinCheckContext, bin: string | undefined, binName: string, inferFailedMessage: string, configuredFileMissingMessage: string, alertOnFail: boolean): Promise { - if (!bin) { - const fb = await findBinary(context.shell, binName); + if (!bin) { + const fb = await findBinary(context.shell, binName); - if (fb.err || fb.output.length === 0) { - if (alertOnFail) { - alertNoBin(context.host, binName, 'inferFailed', inferFailedMessage, context.installDependenciesCallback); - } - return false; - } + if (fb.err || fb.output.length === 0) { + if (alertOnFail) { + alertNoBin(context.host, binName, 'inferFailed', inferFailedMessage, context.installDependenciesCallback); + } + return false; + } - context.binFound = true; + context.binFound = true; - return true; - } + return true; + } - if (context.shell.isWindows) { - context.binFound = context.fs.existsSync(bin); - } else { - const sr = await context.shell.exec(`ls ${bin}`); - context.binFound = (!!sr && sr.code === 0); - } - if (context.binFound) { - context.binPath = bin; - } else { - if (alertOnFail) { - alertNoBin(context.host, binName, 'configuredFileMissing', configuredFileMissingMessage, context.installDependenciesCallback); - } - } + if (context.shell.isWindows) { + context.binFound = context.fs.existsSync(bin); + } else { + const sr = await context.shell.exec(`ls ${bin}`); + context.binFound = (!!sr && sr.code === 0); + } + if (context.binFound) { + context.binPath = bin; + } else { + if (alertOnFail) { + alertNoBin(context.host, binName, 'configuredFileMissing', configuredFileMissingMessage, context.installDependenciesCallback); + } + } - return context.binFound; + return context.binFound; } diff --git a/extensions/big-data-cluster/src/kubectl/compatibility.ts b/extensions/big-data-cluster/src/kubectl/compatibility.ts index 3248ca0bcb..8cea1dba11 100644 --- a/extensions/big-data-cluster/src/kubectl/compatibility.ts +++ b/extensions/big-data-cluster/src/kubectl/compatibility.ts @@ -6,61 +6,61 @@ import { Errorable, failed } from '../interfaces'; interface CompatibilityGuaranteed { - readonly guaranteed: true; + readonly guaranteed: true; } interface CompatibilityNotGuaranteed { - readonly guaranteed: false; - readonly didCheck: boolean; - readonly clientVersion: string; - readonly serverVersion: string; + readonly guaranteed: false; + readonly didCheck: boolean; + readonly clientVersion: string; + readonly serverVersion: string; } export type Compatibility = CompatibilityGuaranteed | CompatibilityNotGuaranteed; export function isGuaranteedCompatible(c: Compatibility): c is CompatibilityGuaranteed { - return c.guaranteed; + return c.guaranteed; } export interface Version { - readonly major: string; - readonly minor: string; - readonly gitVersion: string; + readonly major: string; + readonly minor: string; + readonly gitVersion: string; } export async function check(kubectlLoadJSON: (cmd: string) => Promise>): Promise { - const version = await kubectlLoadJSON('version -o json'); - if (failed(version)) { - return { - guaranteed: false, - didCheck: false, - clientVersion: '', - serverVersion: '' - }; - } + const version = await kubectlLoadJSON('version -o json'); + if (failed(version)) { + return { + guaranteed: false, + didCheck: false, + clientVersion: '', + serverVersion: '' + }; + } - const clientVersion: Version = version.result.clientVersion; - const serverVersion: Version = version.result.serverVersion; + const clientVersion: Version = version.result.clientVersion; + const serverVersion: Version = version.result.serverVersion; - if (isCompatible(clientVersion, serverVersion)) { - return { guaranteed: true }; - } + if (isCompatible(clientVersion, serverVersion)) { + return { guaranteed: true }; + } - return { - guaranteed: false, - didCheck: true, - clientVersion: clientVersion.gitVersion, - serverVersion: serverVersion.gitVersion - }; + return { + guaranteed: false, + didCheck: true, + clientVersion: clientVersion.gitVersion, + serverVersion: serverVersion.gitVersion + }; } function isCompatible(clientVersion: Version, serverVersion: Version): boolean { - if (clientVersion.major === serverVersion.major) { - const clientMinor = Number.parseInt(clientVersion.minor); - const serverMinor = Number.parseInt(serverVersion.minor); - if (Number.isInteger(clientMinor) && Number.isInteger(serverMinor) && Math.abs(clientMinor - serverMinor) <= 1) { - return true; - } - } - return false; + if (clientVersion.major === serverVersion.major) { + const clientMinor = Number.parseInt(clientVersion.minor); + const serverMinor = Number.parseInt(serverVersion.minor); + if (Number.isInteger(clientMinor) && Number.isInteger(serverMinor) && Math.abs(clientMinor - serverMinor) <= 1) { + return true; + } + } + return false; } diff --git a/extensions/big-data-cluster/src/kubectl/host.ts b/extensions/big-data-cluster/src/kubectl/host.ts index 9e0d15e369..de9eb5fbde 100644 --- a/extensions/big-data-cluster/src/kubectl/host.ts +++ b/extensions/big-data-cluster/src/kubectl/host.ts @@ -6,37 +6,37 @@ import * as vscode from 'vscode'; export interface Host { - showErrorMessage(message: string, ...items: string[]): Thenable; - showWarningMessage(message: string, ...items: string[]): Thenable; - showInformationMessage(message: string, ...items: string[]): Thenable; - getConfiguration(key: string): any; - onDidChangeConfiguration(listener: (ch: vscode.ConfigurationChangeEvent) => any): vscode.Disposable; + showErrorMessage(message: string, ...items: string[]): Thenable; + showWarningMessage(message: string, ...items: string[]): Thenable; + showInformationMessage(message: string, ...items: string[]): Thenable; + getConfiguration(key: string): any; + onDidChangeConfiguration(listener: (ch: vscode.ConfigurationChangeEvent) => any): vscode.Disposable; } 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 { - return vscode.window.showErrorMessage(message, ...items); + return vscode.window.showErrorMessage(message, ...items); } function showWarningMessage(message: string, ...items: string[]): Thenable { - return vscode.window.showWarningMessage(message, ...items); + return vscode.window.showWarningMessage(message, ...items); } function showInformationMessage(message: string, ...items: string[]): Thenable { - return vscode.window.showInformationMessage(message, ...items); + return vscode.window.showInformationMessage(message, ...items); } function getConfiguration(key: string): any { - return vscode.workspace.getConfiguration(key); + return vscode.workspace.getConfiguration(key); } function onDidChangeConfiguration(listener: (e: vscode.ConfigurationChangeEvent) => any): vscode.Disposable { - return vscode.workspace.onDidChangeConfiguration(listener); + return vscode.workspace.onDidChangeConfiguration(listener); } diff --git a/extensions/big-data-cluster/src/kubectl/kubectl.ts b/extensions/big-data-cluster/src/kubectl/kubectl.ts index e97face4f2..26d793d851 100644 --- a/extensions/big-data-cluster/src/kubectl/kubectl.ts +++ b/extensions/big-data-cluster/src/kubectl/kubectl.ts @@ -15,128 +15,128 @@ import * as compatibility from './compatibility'; import { getToolPath } from '../config/config'; export interface Kubectl { - checkPresent(errorMessageMode: CheckPresentMessageMode): Promise; - asJson(command: string): Promise>; - invokeAsync(command: string, stdin?: string): Promise; - getContext(): Context; + checkPresent(errorMessageMode: CheckPresentMessageMode): Promise; + asJson(command: string): Promise>; + invokeAsync(command: string, stdin?: string): Promise; + getContext(): Context; } interface Context { - readonly host: Host; - readonly fs: FS; - readonly shell: Shell; - readonly installDependenciesCallback: () => void; - binFound: boolean; - binPath: string; + readonly host: Host; + readonly fs: FS; + readonly shell: Shell; + readonly installDependenciesCallback: () => void; + binFound: boolean; + binPath: string; } 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' }; - } + 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' }; + } - readonly context: Context; + readonly context: Context; - checkPresent(errorMessageMode: CheckPresentMessageMode): Promise { - return checkPresent(this.context, errorMessageMode); - } - asJson(command: string): Promise> { - return asJson(this.context, command); - } - invokeAsync(command: string, stdin?: string): Promise { - return invokeAsync(this.context, command, stdin); - } + checkPresent(errorMessageMode: CheckPresentMessageMode): Promise { + return checkPresent(this.context, errorMessageMode); + } + asJson(command: string): Promise> { + return asJson(this.context, command); + } + invokeAsync(command: string, stdin?: string): Promise { + return invokeAsync(this.context, command, stdin); + } - getContext(): Context { - return this.context; - } + getContext(): Context { + return this.context; + } } export function create(host: Host, fs: FS, shell: Shell, installDependenciesCallback: () => void): Kubectl { - return new KubectlImpl(host, fs, shell, installDependenciesCallback, false); + return new KubectlImpl(host, fs, shell, installDependenciesCallback, false); } export enum CheckPresentMessageMode { - Command, - Activation, - Silent, + Command, + Activation, + Silent, } async function checkPresent(context: Context, errorMessageMode: CheckPresentMessageMode): Promise { - if (context.binFound) { - return true; - } + if (context.binFound) { + return true; + } - return await checkForKubectlInternal(context, errorMessageMode); + return await checkForKubectlInternal(context, errorMessageMode); } async function checkForKubectlInternal(context: Context, errorMessageMode: CheckPresentMessageMode): Promise { - const binName = 'kubectl'; - const bin = getToolPath(context.host, context.shell, binName); + const binName = 'kubectl'; + const bin = getToolPath(context.host, context.shell, binName); - const contextMessage = getCheckKubectlContextMessage(errorMessageMode); - const inferFailedMessage = localize('binaryNotFound', 'Could not find {0} binary. {1}', binName, contextMessage); - const configuredFileMissingMessage = localize('binaryNotInstalled', '{0} is not installed. {1}', bin, contextMessage); + const contextMessage = getCheckKubectlContextMessage(errorMessageMode); + const inferFailedMessage = localize('binaryNotFound', 'Could not find {0} binary. {1}', binName, contextMessage); + const configuredFileMissingMessage = localize('binaryNotInstalled', '{0} is not installed. {1}', bin, contextMessage); - return await binutil.checkForBinary(context, bin, binName, inferFailedMessage, configuredFileMissingMessage, errorMessageMode !== CheckPresentMessageMode.Silent); + return await binutil.checkForBinary(context, bin, binName, inferFailedMessage, configuredFileMissingMessage, errorMessageMode !== CheckPresentMessageMode.Silent); } function getCheckKubectlContextMessage(errorMessageMode: CheckPresentMessageMode): string { - if (errorMessageMode === CheckPresentMessageMode.Activation) { - return localize('kubernetesRequired',' SQL Server Big data cluster requires kubernetes.'); - } else if (errorMessageMode === CheckPresentMessageMode.Command) { - return localize('cannotExecuteCmd', ' Cannot execute command.'); - } - return ''; + if (errorMessageMode === CheckPresentMessageMode.Activation) { + return localize('kubernetesRequired', ' SQL Server Big data cluster requires kubernetes.'); + } else if (errorMessageMode === CheckPresentMessageMode.Command) { + return localize('cannotExecuteCmd', ' Cannot execute command.'); + } + return ''; } async function invokeAsync(context: Context, command: string, stdin?: string): Promise { - if (await checkPresent(context, CheckPresentMessageMode.Command)) { - const bin = baseKubectlPath(context); - const cmd = `${bin} ${command}`; - const sr = await context.shell.exec(cmd, stdin); - if (sr && sr.code !== 0) { - checkPossibleIncompatibility(context); - } - return sr; - } else { - return { code: -1, stdout: '', stderr: '' }; - } + if (await checkPresent(context, CheckPresentMessageMode.Command)) { + const bin = baseKubectlPath(context); + const cmd = `${bin} ${command}`; + const sr = await context.shell.exec(cmd, stdin); + if (sr && sr.code !== 0) { + checkPossibleIncompatibility(context); + } + return sr; + } else { + return { code: -1, stdout: '', stderr: '' }; + } } // TODO: invalidate this when the context changes or if we know kubectl has changed (e.g. config) let checkedCompatibility = false; // We don't want to spam the user (or CPU!) repeatedly running the version check async function checkPossibleIncompatibility(context: Context): Promise { - if (checkedCompatibility) { - return; - } - checkedCompatibility = true; - const compat = await compatibility.check((cmd) => asJson(context, cmd)); - if (!compatibility.isGuaranteedCompatible(compat) && compat.didCheck) { - const versionAlert = localize('kubectlVersionIncompatible', 'kubectl version ${0} may be incompatible with cluster Kubernetes version {1}', compat.clientVersion, compat.serverVersion); - context.host.showWarningMessage(versionAlert); - } + if (checkedCompatibility) { + return; + } + checkedCompatibility = true; + const compat = await compatibility.check((cmd) => asJson(context, cmd)); + if (!compatibility.isGuaranteedCompatible(compat) && compat.didCheck) { + const versionAlert = localize('kubectlVersionIncompatible', 'kubectl version ${0} may be incompatible with cluster Kubernetes version {1}', compat.clientVersion, compat.serverVersion); + context.host.showWarningMessage(versionAlert); + } } export function baseKubectlPath(context: Context): string { - let bin = getToolPath(context.host, context.shell, 'kubectl'); - if (!bin) { - bin = 'kubectl'; - } - return bin; + let bin = getToolPath(context.host, context.shell, 'kubectl'); + if (!bin) { + bin = 'kubectl'; + } + return bin; } async function asJson(context: Context, command: string): Promise> { - const shellResult = await invokeAsync(context, command); - if (!shellResult) { - return { succeeded: false, error: [localize('cannotRunCommand', 'Unable to run command ({0})', command)] }; - } + const shellResult = await invokeAsync(context, command); + if (!shellResult) { + return { succeeded: false, error: [localize('cannotRunCommand', 'Unable to run command ({0})', command)] }; + } - if (shellResult.code === 0) { - return { succeeded: true, result: JSON.parse(shellResult.stdout.trim()) as T }; + if (shellResult.code === 0) { + return { succeeded: true, result: JSON.parse(shellResult.stdout.trim()) as T }; - } - return { succeeded: false, error: [ shellResult.stderr ] }; + } + return { succeeded: false, error: [shellResult.stderr] }; } \ No newline at end of file diff --git a/extensions/big-data-cluster/src/kubectl/kubectlUtils.ts b/extensions/big-data-cluster/src/kubectl/kubectlUtils.ts index e5c250ea9b..c2bf441860 100644 --- a/extensions/big-data-cluster/src/kubectl/kubectlUtils.ts +++ b/extensions/big-data-cluster/src/kubectl/kubectlUtils.ts @@ -11,126 +11,126 @@ import { Kubectl } from './kubectl'; import { failed, ClusterType } from '../interfaces'; export interface KubectlContext { - readonly clusterName: string; - readonly contextName: string; - readonly userName: string; - readonly active: boolean; + readonly clusterName: string; + readonly contextName: string; + readonly userName: string; + readonly active: boolean; } interface Kubeconfig { - readonly apiVersion: string; - readonly 'current-context': string; - readonly clusters: { - readonly name: string; - readonly cluster: { - readonly server: string; - readonly 'certificate-authority'?: string; - readonly 'certificate-authority-data'?: string; - }; - }[] | undefined; - readonly contexts: { - readonly name: string; - readonly context: { - readonly cluster: string; - readonly user: string; - readonly namespace?: string; - }; - }[] | undefined; - readonly users: { - readonly name: string; - readonly user: {}; - }[] | undefined; + readonly apiVersion: string; + readonly 'current-context': string; + readonly clusters: { + readonly name: string; + readonly cluster: { + readonly server: string; + readonly 'certificate-authority'?: string; + readonly 'certificate-authority-data'?: string; + }; + }[] | undefined; + readonly contexts: { + readonly name: string; + readonly context: { + readonly cluster: string; + readonly user: string; + readonly namespace?: string; + }; + }[] | undefined; + readonly users: { + readonly name: string; + readonly user: {}; + }[] | undefined; } export interface ClusterConfig { - readonly server: string; - readonly certificateAuthority: string | undefined; + readonly server: string; + readonly certificateAuthority: string | undefined; } async function getKubeconfig(kubectl: Kubectl): Promise { - const shellResult = await kubectl.asJson('config view -o json'); - if (failed(shellResult)) { - vscode.window.showErrorMessage(shellResult.error[0]); - return null; - } - return shellResult.result; + const shellResult = await kubectl.asJson('config view -o json'); + if (failed(shellResult)) { + vscode.window.showErrorMessage(shellResult.error[0]); + return null; + } + return shellResult.result; } export async function getCurrentClusterConfig(kubectl: Kubectl): Promise { - const kubeConfig = await getKubeconfig(kubectl); - if (!kubeConfig || !kubeConfig.clusters || !kubeConfig.contexts) { - return undefined; - } - const contextConfig = kubeConfig.contexts.find((context) => context.name === kubeConfig['current-context'])!; - const clusterConfig = kubeConfig.clusters.find((cluster) => cluster.name === contextConfig.context.cluster)!; - return { - server: clusterConfig.cluster.server, - certificateAuthority: clusterConfig.cluster['certificate-authority'] - }; + const kubeConfig = await getKubeconfig(kubectl); + if (!kubeConfig || !kubeConfig.clusters || !kubeConfig.contexts) { + return undefined; + } + const contextConfig = kubeConfig.contexts.find((context) => context.name === kubeConfig['current-context'])!; + const clusterConfig = kubeConfig.clusters.find((cluster) => cluster.name === contextConfig.context.cluster)!; + return { + server: clusterConfig.cluster.server, + certificateAuthority: clusterConfig.cluster['certificate-authority'] + }; } export async function getContexts(kubectl: Kubectl): Promise { - const kubectlConfig = await getKubeconfig(kubectl); - if (!kubectlConfig) { - return []; - } - const currentContext = kubectlConfig['current-context']; - const contexts = kubectlConfig.contexts || []; - return contexts.map((c) => { - return { - clusterName: c.context.cluster, - contextName: c.name, - userName: c.context.user, - active: c.name === currentContext - }; - }); + const kubectlConfig = await getKubeconfig(kubectl); + if (!kubectlConfig) { + return []; + } + const currentContext = kubectlConfig['current-context']; + const contexts = kubectlConfig.contexts || []; + return contexts.map((c) => { + return { + clusterName: c.context.cluster, + contextName: c.name, + userName: c.context.user, + active: c.name === currentContext + }; + }); } export async function setContext(kubectl: Kubectl, targetContext: string): Promise { - const shellResult = await kubectl.invokeAsync(`config use-context ${targetContext}`); - if (!shellResult || shellResult.code !== 0) { - // TODO: Update error handling for now. - let errMsg = shellResult ? shellResult.stderr : localize('runKubectlFailed', 'Unable to run kubectl'); - vscode.window.showErrorMessage(localize('setClusterFailed', 'Failed to set \'{0}\' as current cluster: {1}', targetContext, errMsg)); - } + const shellResult = await kubectl.invokeAsync(`config use-context ${targetContext}`); + if (!shellResult || shellResult.code !== 0) { + // TODO: Update error handling for now. + let errMsg = shellResult ? shellResult.stderr : localize('runKubectlFailed', 'Unable to run kubectl'); + vscode.window.showErrorMessage(localize('setClusterFailed', 'Failed to set \'{0}\' as current cluster: {1}', targetContext, errMsg)); + } } export async function inferCurrentClusterType(kubectl: Kubectl): Promise { - let latestContextName = ''; + let latestContextName = ''; - const ctxsr = await kubectl.invokeAsync('config current-context'); - if (ctxsr && ctxsr.code === 0) { - latestContextName = ctxsr.stdout.trim(); - } else { - return ClusterType.Other; - } + const ctxsr = await kubectl.invokeAsync('config current-context'); + if (ctxsr && ctxsr.code === 0) { + latestContextName = ctxsr.stdout.trim(); + } else { + return ClusterType.Other; + } - const cisr = await kubectl.invokeAsync('cluster-info'); - if (!cisr || cisr.code !== 0) { - return ClusterType.Unknown; - } - const masterInfos = cisr.stdout.split('\n') - .filter((s) => s.indexOf('master is running at') >= 0); + const cisr = await kubectl.invokeAsync('cluster-info'); + if (!cisr || cisr.code !== 0) { + return ClusterType.Unknown; + } + const masterInfos = cisr.stdout.split('\n') + .filter((s) => s.indexOf('master is running at') >= 0); - if (masterInfos.length === 0) { - return ClusterType.Other; - } + if (masterInfos.length === 0) { + return ClusterType.Other; + } - const masterInfo = masterInfos[0]; - if (masterInfo.indexOf('azmk8s.io') >= 0 || masterInfo.indexOf('azure.com') >= 0) { - return ClusterType.AKS; - } + const masterInfo = masterInfos[0]; + if (masterInfo.indexOf('azmk8s.io') >= 0 || masterInfo.indexOf('azure.com') >= 0) { + return ClusterType.AKS; + } - if (latestContextName) { - const gcsr = await kubectl.invokeAsync(`config get-contexts ${latestContextName}`); - if (gcsr && gcsr.code === 0) { - if (gcsr.stdout.indexOf('minikube') >= 0) { - return ClusterType.Minikube; - } - } - } + if (latestContextName) { + const gcsr = await kubectl.invokeAsync(`config get-contexts ${latestContextName}`); + if (gcsr && gcsr.code === 0) { + if (gcsr.stdout.indexOf('minikube') >= 0) { + return ClusterType.Minikube; + } + } + } - return ClusterType.Other; + return ClusterType.Other; } \ No newline at end of file diff --git a/extensions/big-data-cluster/src/kubectl/SqlServerBigDataClusterChannel.ts b/extensions/big-data-cluster/src/kubectl/sqlServerBigDataClusterChannel.ts similarity index 58% rename from extensions/big-data-cluster/src/kubectl/SqlServerBigDataClusterChannel.ts rename to extensions/big-data-cluster/src/kubectl/sqlServerBigDataClusterChannel.ts index 8aeab7e359..dd93751c49 100644 --- a/extensions/big-data-cluster/src/kubectl/SqlServerBigDataClusterChannel.ts +++ b/extensions/big-data-cluster/src/kubectl/sqlServerBigDataClusterChannel.ts @@ -8,22 +8,22 @@ import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); export interface ISqlServerBigDataClusterChannel { - showOutput(message: any, title?: string): void; + showOutput(message: any, title?: string): void; } const outputChannelName = localize('bigDataClusterOutputChannel', 'SQL Server big data cluster'); class SqlServerBigDataCluster implements ISqlServerBigDataClusterChannel { - private readonly channel: vscode.OutputChannel = vscode.window.createOutputChannel(outputChannelName); + private readonly channel: vscode.OutputChannel = vscode.window.createOutputChannel(outputChannelName); - showOutput(message: any, title?: string): void { - if (title) { - const simplifiedTime = (new Date()).toISOString().replace(/z|t/gi, ' ').trim(); // YYYY-MM-DD HH:mm:ss.sss - const hightlightingTitle = `[${title} ${simplifiedTime}]`; - this.channel.appendLine(hightlightingTitle); - } - this.channel.appendLine(message); - this.channel.show(); - } + showOutput(message: any, title?: string): void { + if (title) { + const simplifiedTime = (new Date()).toISOString().replace(/z|t/gi, ' ').trim(); // YYYY-MM-DD HH:mm:ss.sss + const hightlightingTitle = `[${title} ${simplifiedTime}]`; + this.channel.appendLine(hightlightingTitle); + } + this.channel.appendLine(message); + this.channel.show(); + } } export const sqlserverbigdataclusterchannel: ISqlServerBigDataClusterChannel = new SqlServerBigDataCluster(); diff --git a/extensions/big-data-cluster/src/main.ts b/extensions/big-data-cluster/src/main.ts index 0d51cd5e51..4d3a864182 100644 --- a/extensions/big-data-cluster/src/main.ts +++ b/extensions/big-data-cluster/src/main.ts @@ -35,26 +35,26 @@ export function deactivate(): void { } export async function installDependencies() { - const gotKubectl = await kubectl.checkPresent(CheckPresentMessageMode.Silent); + const gotKubectl = await kubectl.checkPresent(CheckPresentMessageMode.Silent); - const installPromises = [ - installDependency('kubectl', gotKubectl, installKubectl) - ]; + const installPromises = [ + installDependency('kubectl', gotKubectl, installKubectl) + ]; - await Promise.all(installPromises); + await Promise.all(installPromises); - sqlserverbigdataclusterchannel.showOutput(localize('done', 'Done')); + sqlserverbigdataclusterchannel.showOutput(localize('done', 'Done')); } async function installDependency(name: string, alreadyGot: boolean, installFunc: (shell: Shell) => Promise>): Promise { - if (alreadyGot) { - sqlserverbigdataclusterchannel.showOutput(localize('dependencyInstalled', '{0} already installed...', name)); - } else { - sqlserverbigdataclusterchannel.showOutput(localize('installingDependency', 'Installing {0}...', name)); - const result = await installFunc(shell); - if (failed(result)) { - sqlserverbigdataclusterchannel.showOutput(localize('installingDependencyFailed', 'Unable to install {0}: {1}', name, result.error[0])); - } - } + if (alreadyGot) { + sqlserverbigdataclusterchannel.showOutput(localize('dependencyInstalled', '{0} already installed...', name)); + } else { + sqlserverbigdataclusterchannel.showOutput(localize('installingDependency', 'Installing {0}...', name)); + const result = await installFunc(shell); + if (failed(result)) { + sqlserverbigdataclusterchannel.showOutput(localize('installingDependencyFailed', 'Unable to install {0}: {1}', name, result.error[0])); + } + } } \ No newline at end of file diff --git a/extensions/big-data-cluster/src/mainController.ts b/extensions/big-data-cluster/src/mainController.ts index 1ba207ba44..02ca5c882c 100644 --- a/extensions/big-data-cluster/src/mainController.ts +++ b/extensions/big-data-cluster/src/mainController.ts @@ -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; diff --git a/extensions/big-data-cluster/src/scripting/scripting.ts b/extensions/big-data-cluster/src/scripting/scripting.ts index 841b8c02e4..c21e39991e 100644 --- a/extensions/big-data-cluster/src/scripting/scripting.ts +++ b/extensions/big-data-cluster/src/scripting/scripting.ts @@ -11,16 +11,16 @@ import mkdirp = require('mkdirp'); import { Kubectl, baseKubectlPath } from '../kubectl/kubectl'; import { KubectlContext } from '../kubectl/kubectlUtils'; - export interface Scriptable { - getScriptProperties(): Promise>; - getTargetKubectlContext() : KubectlContext; - } +export interface Scriptable { + getScriptProperties(): Promise>; + getTargetKubectlContext(): KubectlContext; +} - export interface ScriptingDictionary { +export interface ScriptingDictionary { [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 { + public async generateDeploymentScript(scriptable: Scriptable): Promise { let targetClusterName = scriptable.getTargetKubectlContext().clusterName; let targetContextName = scriptable.getTargetKubectlContext().contextName; @@ -67,7 +67,7 @@ export class ScriptGenerator { } const handleError = (err: NodeJS.ErrnoException) => { - if (err) { - vscode.window.showErrorMessage(err.message); - } + if (err) { + vscode.window.showErrorMessage(err.message); + } }; \ No newline at end of file diff --git a/extensions/big-data-cluster/src/utility/fs.ts b/extensions/big-data-cluster/src/utility/fs.ts index 68326a58f2..9ba7b63fe1 100644 --- a/extensions/big-data-cluster/src/utility/fs.ts +++ b/extensions/big-data-cluster/src/utility/fs.ts @@ -5,61 +5,61 @@ import * as sysfs from 'fs'; export interface FS { - existsSync(path: string): boolean; - readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; - readFileSync(filename: string, encoding: string): string; - readFileToBufferSync(filename: string): Buffer; - writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; - writeFileSync(filename: string, data: any): void; - dirSync(path: string): string[]; - unlinkAsync(path: string): Promise; - existsAsync(path: string): Promise; - openAsync(path: string, flags: string): Promise; - statSync(path: string): sysfs.Stats; + existsSync(path: string): boolean; + readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + readFileSync(filename: string, encoding: string): string; + readFileToBufferSync(filename: string): Buffer; + writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + writeFileSync(filename: string, data: any): void; + dirSync(path: string): string[]; + unlinkAsync(path: string): Promise; + existsAsync(path: string): Promise; + openAsync(path: string, flags: string): Promise; + statSync(path: string): sysfs.Stats; } export const fs: FS = { - existsSync: (path) => sysfs.existsSync(path), - readFile: (filename, encoding, callback) => sysfs.readFile(filename, encoding, callback), - readFileSync: (filename, encoding) => sysfs.readFileSync(filename, encoding), - readFileToBufferSync: (filename) => sysfs.readFileSync(filename), - writeFile: (filename, data, callback) => sysfs.writeFile(filename, data, callback), - writeFileSync: (filename, data) => sysfs.writeFileSync(filename, data), - dirSync: (path) => sysfs.readdirSync(path), + existsSync: (path) => sysfs.existsSync(path), + readFile: (filename, encoding, callback) => sysfs.readFile(filename, encoding, callback), + readFileSync: (filename, encoding) => sysfs.readFileSync(filename, encoding), + readFileToBufferSync: (filename) => sysfs.readFileSync(filename), + writeFile: (filename, data, callback) => sysfs.writeFile(filename, data, callback), + writeFileSync: (filename, data) => sysfs.writeFileSync(filename, data), + dirSync: (path) => sysfs.readdirSync(path), - unlinkAsync: (path) => { - return new Promise((resolve, reject) => { - sysfs.unlink(path, (error) => { - if (error) { - reject(); - return; - } + unlinkAsync: (path) => { + return new Promise((resolve, reject) => { + sysfs.unlink(path, (error) => { + if (error) { + reject(); + return; + } - resolve(); - }); - }); - }, + resolve(); + }); + }); + }, - existsAsync: (path) => { - return new Promise((resolve) => { - sysfs.exists(path, (exists) => { - resolve(exists); - }); - }); - }, + existsAsync: (path) => { + return new Promise((resolve) => { + sysfs.exists(path, (exists) => { + resolve(exists); + }); + }); + }, - openAsync: (path, flags) => { - return new Promise((resolve, reject) => { - sysfs.open(path, flags, (error, _fd) => { - if (error) { - reject(); - return; - } + openAsync: (path, flags) => { + return new Promise((resolve, reject) => { + sysfs.open(path, flags, (error, _fd) => { + if (error) { + reject(); + return; + } - resolve(); - }); - }); - }, + resolve(); + }); + }); + }, - statSync: (path) => sysfs.statSync(path) + statSync: (path) => sysfs.statSync(path) }; diff --git a/extensions/big-data-cluster/src/utility/shell.ts b/extensions/big-data-cluster/src/utility/shell.ts index ce20ccd80d..e27193e2bc 100644 --- a/extensions/big-data-cluster/src/utility/shell.ts +++ b/extensions/big-data-cluster/src/utility/shell.ts @@ -12,193 +12,193 @@ import { getActiveKubeconfig, getToolPath } from '../config/config'; import { host } from '../kubectl/host'; export enum Platform { - Windows, - MacOS, - Linux, - Unsupported, + Windows, + MacOS, + Linux, + Unsupported, } -export interface ExecCallback extends shelljs.ExecCallback {} +export interface ExecCallback extends shelljs.ExecCallback { } export interface Shell { - isWindows(): boolean; - isUnix(): boolean; - platform(): Platform; - home(): string; - combinePath(basePath: string, relativePath: string): string; - fileUri(filePath: string): vscode.Uri; - execOpts(): any; - exec(cmd: string, stdin?: string): Promise; - execCore(cmd: string, opts: any, stdin?: string): Promise; - unquotedPath(path: string): string; - which(bin: string): string | null; - cat(path: string): string; - ls(path: string): string[]; + isWindows(): boolean; + isUnix(): boolean; + platform(): Platform; + home(): string; + combinePath(basePath: string, relativePath: string): string; + fileUri(filePath: string): vscode.Uri; + execOpts(): any; + exec(cmd: string, stdin?: string): Promise; + execCore(cmd: string, opts: any, stdin?: string): Promise; + unquotedPath(path: string): string; + which(bin: string): string | null; + cat(path: string): string; + ls(path: string): string[]; } export const shell: Shell = { - 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, + 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, }; const WINDOWS: string = 'win32'; export interface ShellResult { - readonly code: number; - readonly stdout: string; - readonly stderr: string; + readonly code: number; + readonly stdout: string; + readonly stderr: string; } export type ShellHandler = (code: number, stdout: string, stderr: string) => void; function isWindows(): boolean { - return (process.platform === WINDOWS); + return (process.platform === WINDOWS); } function isUnix(): boolean { - return !isWindows(); + return !isWindows(); } function platform(): Platform { - switch (process.platform) { - case 'win32': return Platform.Windows; - case 'darwin': return Platform.MacOS; - case 'linux': return Platform.Linux; - default: return Platform.Unsupported; - } + switch (process.platform) { + case 'win32': return Platform.Windows; + case 'darwin': return Platform.MacOS; + case 'linux': return Platform.Linux; + default: return Platform.Unsupported; + } } function concatIfBoth(s1: string | undefined, s2: string | undefined): string | undefined { - return s1 && s2 ? s1.concat(s2) : undefined; + return s1 && s2 ? s1.concat(s2) : undefined; } function home(): string { - return process.env['HOME'] || - concatIfBoth(process.env['HOMEDRIVE'], process.env['HOMEPATH']) || - process.env['USERPROFILE'] || - ''; + return process.env['HOME'] || + concatIfBoth(process.env['HOMEDRIVE'], process.env['HOMEPATH']) || + process.env['USERPROFILE'] || + ''; } function combinePath(basePath: string, relativePath: string) { - let separator = '/'; - if (isWindows()) { - relativePath = relativePath.replace(/\//g, '\\'); - separator = '\\'; - } - return basePath + separator + relativePath; + let separator = '/'; + if (isWindows()) { + relativePath = relativePath.replace(/\//g, '\\'); + separator = '\\'; + } + return basePath + separator + relativePath; } function isWindowsFilePath(filePath: string) { - return filePath[1] === ':' && filePath[2] === '\\'; + return filePath[1] === ':' && filePath[2] === '\\'; } function fileUri(filePath: string): vscode.Uri { - if (isWindowsFilePath(filePath)) { - return vscode.Uri.parse('file:///' + filePath.replace(/\\/g, '/')); - } - return vscode.Uri.parse('file://' + filePath); + if (isWindowsFilePath(filePath)) { + return vscode.Uri.parse('file:///' + filePath.replace(/\\/g, '/')); + } + return vscode.Uri.parse('file://' + filePath); } function execOpts(): any { - let env = process.env; - if (isWindows()) { - env = Object.assign({ }, env, { HOME: home() }); - } - env = shellEnvironment(env); - const opts = { - cwd: vscode.workspace.rootPath, - env: env, - async: true - }; - return opts; + let env = process.env; + if (isWindows()) { + env = Object.assign({}, env, { HOME: home() }); + } + env = shellEnvironment(env); + const opts = { + cwd: vscode.workspace.rootPath, + env: env, + async: true + }; + return opts; } async function exec(cmd: string, stdin?: string): Promise { - try { - return await execCore(cmd, execOpts(), stdin); - } catch (ex) { - vscode.window.showErrorMessage(ex); - return undefined; - } + try { + return await execCore(cmd, execOpts(), stdin); + } catch (ex) { + vscode.window.showErrorMessage(ex); + return undefined; + } } function execCore(cmd: string, opts: any, stdin?: string): Promise { - return new Promise((resolve) => { - const proc = shelljs.exec(cmd, opts, (code, stdout, stderr) => resolve({code : code, stdout : stdout, stderr : stderr})); - if (stdin) { - proc.stdin.end(stdin); - } - }); + return new Promise((resolve) => { + const proc = shelljs.exec(cmd, opts, (code, stdout, stderr) => resolve({ code: code, stdout: stdout, stderr: stderr })); + if (stdin) { + proc.stdin.end(stdin); + } + }); } function unquotedPath(path: string): string { - if (isWindows() && path && path.length > 1 && path.startsWith('"') && path.endsWith('"')) { - return path.substring(1, path.length - 1); - } - return path; + if (isWindows() && path && path.length > 1 && path.startsWith('"') && path.endsWith('"')) { + return path.substring(1, path.length - 1); + } + return path; } export function shellEnvironment(baseEnvironment: any): any { - const env = Object.assign({}, baseEnvironment); - const pathVariable = pathVariableName(env); - for (const tool of ['kubectl']) { - const toolPath = getToolPath(host, shell, tool); - if (toolPath) { - const toolDirectory = path.dirname(toolPath); - const currentPath = env[pathVariable]; - env[pathVariable] = toolDirectory + (currentPath ? `${pathEntrySeparator()}${currentPath}` : ''); - } - } + const env = Object.assign({}, baseEnvironment); + const pathVariable = pathVariableName(env); + for (const tool of ['kubectl']) { + const toolPath = getToolPath(host, shell, tool); + if (toolPath) { + const toolDirectory = path.dirname(toolPath); + const currentPath = env[pathVariable]; + env[pathVariable] = toolDirectory + (currentPath ? `${pathEntrySeparator()}${currentPath}` : ''); + } + } - const kubeconfig = getActiveKubeconfig(); - if (kubeconfig) { - env['KUBECONFIG'] = kubeconfig; - } + const kubeconfig = getActiveKubeconfig(); + if (kubeconfig) { + env['KUBECONFIG'] = kubeconfig; + } - return env; + return env; } function pathVariableName(env: any): string { - if (isWindows()) { - for (const v of Object.keys(env)) { - if (v.toLowerCase() === 'path') { - return v; - } - } - } - return 'PATH'; + if (isWindows()) { + for (const v of Object.keys(env)) { + if (v.toLowerCase() === 'path') { + return v; + } + } + } + return 'PATH'; } function pathEntrySeparator() { - return isWindows() ? ';' : ':'; + return isWindows() ? ';' : ':'; } function which(bin: string): string | null { - return shelljs.which(bin); + return shelljs.which(bin); } function cat(path: string): string { - return shelljs.cat(path); + return shelljs.cat(path); } function ls(path: string): string[] { - return shelljs.ls(path); + return shelljs.ls(path); } export function shellMessage(sr: ShellResult | undefined, invocationFailureMessage: string): string { - if (!sr) { - return invocationFailureMessage; - } - return sr.code === 0 ? sr.stdout : sr.stderr; + if (!sr) { + return invocationFailureMessage; + } + return sr.code === 0 ? sr.stdout : sr.stderr; } diff --git a/extensions/big-data-cluster/src/wizards/create-cluster/pages/clusterProfilePage.ts b/extensions/big-data-cluster/src/wizards/create-cluster/pages/clusterProfilePage.ts index f847e05a4b..ae8d384e1f 100644 --- a/extensions/big-data-cluster/src/wizards/create-cluster/pages/clusterProfilePage.ts +++ b/extensions/big-data-cluster/src/wizards/create-cluster/pages/clusterProfilePage.ts @@ -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 { 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 { case ClusterPoolType.Spark: return localize('bdc-create.SparkPoolDescription', 'TODO: Add description'); default: - throw 'unknown pool type'; + throw new Error('unknown pool type'); } } diff --git a/extensions/big-data-cluster/src/wizards/create-cluster/pages/summaryPage.ts b/extensions/big-data-cluster/src/wizards/create-cluster/pages/summaryPage.ts index 48e51a4a84..df1821ac58 100644 --- a/extensions/big-data-cluster/src/wizards/create-cluster/pages/summaryPage.ts +++ b/extensions/big-data-cluster/src/wizards/create-cluster/pages/summaryPage.ts @@ -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'; diff --git a/extensions/dacpac/src/controllers/controllerBase.ts b/extensions/dacpac/src/controllers/controllerBase.ts index fb4a2e8920..eab1571082 100644 --- a/extensions/dacpac/src/controllers/controllerBase.ts +++ b/extensions/dacpac/src/controllers/controllerBase.ts @@ -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. diff --git a/extensions/dacpac/src/wizard/api/basePage.ts b/extensions/dacpac/src/wizard/api/basePage.ts index a9203875d5..3a34ca8329 100644 --- a/extensions/dacpac/src/wizard/api/basePage.ts +++ b/extensions/dacpac/src/wizard/api/basePage.ts @@ -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} */ public async abstract start(): Promise; /** * This method is called when the user is entering the page. - * @returns {Promise} */ public async abstract onPageEnter(): Promise; /** * This method is called when the user is leaving the page. - * @returns {Promise} */ async onPageLeave(): Promise { 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} */ public async cleanup(): Promise { return true; @@ -136,4 +131,3 @@ export abstract class BasePage { return; } } - diff --git a/extensions/import/src/controllers/controllerBase.ts b/extensions/import/src/controllers/controllerBase.ts index fb4a2e8920..eab1571082 100644 --- a/extensions/import/src/controllers/controllerBase.ts +++ b/extensions/import/src/controllers/controllerBase.ts @@ -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. diff --git a/extensions/import/src/services/contracts.ts b/extensions/import/src/services/contracts.ts index 4e85730891..d95bc234f3 100644 --- a/extensions/import/src/services/contracts.ts +++ b/extensions/import/src/services/contracts.ts @@ -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; } diff --git a/extensions/import/src/services/serviceUtils.ts b/extensions/import/src/services/serviceUtils.ts index 1c1d642fe4..cd49aede50 100644 --- a/extensions/import/src/services/serviceUtils.ts +++ b/extensions/import/src/services/serviceUtils.ts @@ -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 { - 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); diff --git a/extensions/import/src/services/telemetry.ts b/extensions/import/src/services/telemetry.ts index c93c89d1ea..1f998e00fb 100644 --- a/extensions/import/src/services/telemetry.ts +++ b/extensions/import/src/services/telemetry.ts @@ -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,22 +18,21 @@ import { IMessage, ITelemetryEventProperties, ITelemetryEventMeasures } from './ /** * Handle Language Service client errors - * @class LanguageClientErrorHandler */ export class LanguageClientErrorHandler { - /** - * Creates an instance of LanguageClientErrorHandler. - * @memberOf LanguageClientErrorHandler - */ + /** + * Creates an instance of LanguageClientErrorHandler. + * @memberOf LanguageClientErrorHandler + */ constructor() { } - /** - * Show an error message prompt with a link to known issues wiki page - * @memberOf LanguageClientErrorHandler - */ + /** + * Show an error message prompt with a link to known issues wiki page + * @memberOf LanguageClientErrorHandler + */ showOnErrorPrompt(): void { // TODO add telemetry // Telemetry.sendTelemetryEvent('SqlToolsServiceCrash'); @@ -50,16 +47,11 @@ export class LanguageClientErrorHandler { }); } - /** - * Callback for language service client error - * - * @param {Error} error - * @param {Message} message - * @param {number} count - * @returns {ErrorAction} - * - * @memberOf LanguageClientErrorHandler - */ + /** + * Callback for language service client error + * + * @memberOf LanguageClientErrorHandler + */ error(error: Error, message: IMessage, count: number): ErrorAction { this.showOnErrorPrompt(); @@ -68,13 +60,11 @@ export class LanguageClientErrorHandler { return ErrorAction.Shutdown; } - /** - * Callback for language service client closed - * - * @returns {CloseAction} - * - * @memberOf LanguageClientErrorHandler - */ + /** + * Callback for language service client closed + * + * @memberOf LanguageClientErrorHandler + */ closed(): CloseAction { this.showOnErrorPrompt(); @@ -134,16 +124,16 @@ export class Telemetry { } } - /** - * Disable telemetry reporting - */ + /** + * Disable telemetry reporting + */ public static disable(): void { this.disabled = true; } - /** - * Initialize the telemetry reporter for use. - */ + /** + * Initialize the telemetry reporter for use. + */ public static initialize(): void { if (typeof this.reporter === 'undefined') { // Check if the user has opted out of telemetry @@ -156,9 +146,9 @@ export class Telemetry { } } - /** - * Send a telemetry event for an exception - */ + /** + * Send a telemetry event for an exception + */ public static sendTelemetryEventForException( err: any, methodName: string, extensionConfigName: string): void { try { @@ -181,9 +171,9 @@ export class Telemetry { } } - /** - * Send a telemetry event using application insights - */ + /** + * Send a telemetry event using application insights + */ public static sendTelemetryEvent( eventName: string, properties?: ITelemetryEventProperties, diff --git a/extensions/import/src/wizard/api/basePage.ts b/extensions/import/src/wizard/api/basePage.ts index 86c6bc0803..d49d52fb48 100644 --- a/extensions/import/src/wizard/api/basePage.ts +++ b/extensions/import/src/wizard/api/basePage.ts @@ -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} */ public async abstract start(): Promise; /** * This method is called when the user is entering the page. - * @returns {Promise} */ public async abstract onPageEnter(): Promise; /** * This method is called when the user is leaving the page. - * @returns {Promise} */ async onPageLeave(): Promise { 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} */ public async cleanup(): Promise { return true; @@ -136,4 +131,3 @@ export abstract class BasePage { return; } } - diff --git a/extensions/import/src/wizard/pages/summaryPage.ts b/extensions/import/src/wizard/pages/summaryPage.ts index f5af66552d..08e184b820 100644 --- a/extensions/import/src/wizard/pages/summaryPage.ts +++ b/extensions/import/src/wizard/pages/summaryPage.ts @@ -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} */ private async getConnectionString(): Promise { let options = this.model.server.options; diff --git a/extensions/import/tsconfig.json b/extensions/import/tsconfig.json index a696aa1763..ded516ea29 100644 --- a/extensions/import/tsconfig.json +++ b/extensions/import/tsconfig.json @@ -1,19 +1,19 @@ { - "compileOnSave": true, - "compilerOptions": { - "module": "commonjs", - "target": "es6", + "compileOnSave": true, + "compilerOptions": { + "module": "commonjs", + "target": "es6", "outDir": "./out", "lib": [ "es6", "es2015.promise" ], - "sourceMap": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "moduleResolution": "node", - "declaration": false - }, - "exclude": [ - "node_modules" - ] + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "moduleResolution": "node", + "declaration": false + }, + "exclude": [ + "node_modules" + ] } diff --git a/extensions/integration-tests/setEnvironmentVariables.js b/extensions/integration-tests/setEnvironmentVariables.js index 213f21989e..4345e458e5 100644 --- a/extensions/integration-tests/setEnvironmentVariables.js +++ b/extensions/integration-tests/setEnvironmentVariables.js @@ -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'); diff --git a/extensions/integration-tests/src/main.ts b/extensions/integration-tests/src/main.ts index 3d268c6089..1d79562352 100644 --- a/extensions/integration-tests/src/main.ts +++ b/extensions/integration-tests/src/main.ts @@ -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); diff --git a/extensions/integration-tests/src/testConfig.ts b/extensions/integration-tests/src/testConfig.ts index ed64d0217c..cbb1fdb6a6 100644 --- a/extensions/integration-tests/src/testConfig.ts +++ b/extensions/integration-tests/src/testConfig.ts @@ -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()}`); } } @@ -146,4 +146,4 @@ export async function getTestingServers(): Promise { }); await promise; return promise; -} \ No newline at end of file +} diff --git a/extensions/integration-tests/src/testContext.ts b/extensions/integration-tests/src/testContext.ts index 2e3293c6e8..ddad231886 100644 --- a/extensions/integration-tests/src/testContext.ts +++ b/extensions/integration-tests/src/testContext.ts @@ -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 -}; \ No newline at end of file +}; diff --git a/extensions/mssql/package.nls.json b/extensions/mssql/package.nls.json index b2286155b8..077ecd71a5 100644 --- a/extensions/mssql/package.nls.json +++ b/extensions/mssql/package.nls.json @@ -18,14 +18,14 @@ "tab.bigDataClusterDescription": "Tasks and information about your SQL Server Big Data Cluster", "title.bigDataCluster": "SQL Server Big Data Cluster", - "title.submitSparkJob": "Submit Spark Job", - "title.newSparkJob": "New Spark Job", - "title.openSparkHistory": "View Spark History", - "title.openYarnHistory": "View Yarn History", - "title.tasks": "Tasks", - "title.installPackages": "Install Packages", + "title.submitSparkJob": "Submit Spark Job", + "title.newSparkJob": "New Spark Job", + "title.openSparkHistory": "View Spark History", + "title.openYarnHistory": "View Yarn History", + "title.tasks": "Tasks", + "title.installPackages": "Install Packages", "title.configurePython": "Configure Python for Notebooks", "title.searchServers": "Search: Servers", "title.clearSearchServerResult": "Search: Clear Search Server Results" -} \ No newline at end of file +} diff --git a/extensions/mssql/src/api/mssqlapis.d.ts b/extensions/mssql/src/api/mssqlapis.d.ts index a32e034bd7..944b502f40 100644 --- a/extensions/mssql/src/api/mssqlapis.d.ts +++ b/extensions/mssql/src/api/mssqlapis.d.ts @@ -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} - * @memberof IMssqlExtensionApi */ getCmsServiceProvider(): Promise; } @@ -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} */ getNode(objectExplorerContext: azdata.ObjectExplorerContext): Promise; } /** * 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; @@ -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} */ createCmsServer(name: string, description:string, connectiondetails: azdata.ConnectionInfo, ownerUri: string): Thenable; /** * gets all Registered Servers inside a CMS on a particular level - * - * @param {string} ownerUri - * @param {string} relativePath - * @returns {Thenable} */ getRegisteredServers(ownerUri: string, relativePath: string): Thenable; /** * 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>} */ addRegisteredServer (ownerUri: string, relativePath: string, registeredServerName: string, registeredServerDescription:string, connectionDetails:azdata.ConnectionInfo): Thenable; /** * Removes a Registered Server inside a CMS on a particular level - * - * @param {string} ownerUri - * @param {string} relativePath - * @param {string} registeredServerName - * @returns {Thenable} */ removeRegisteredServer (ownerUri: string, relativePath: string, registeredServerName: string): Thenable; /** * 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; /** * 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; } @@ -162,4 +109,3 @@ export interface ListRegisteredServersResult { registeredServersList: Array; registeredServerGroups: Array; } - diff --git a/extensions/mssql/src/apiWrapper.ts b/extensions/mssql/src/apiWrapper.ts index 537d99d05c..b984f5712c 100644 --- a/extensions/mssql/src/apiWrapper.ts +++ b/extensions/mssql/src/apiWrapper.ts @@ -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 diff --git a/extensions/mssql/src/cms/cmsService.ts b/extensions/mssql/src/cms/cmsService.ts index 0bab9fa730..8b732be461 100644 --- a/extensions/mssql/src/cms/cmsService.ts +++ b/extensions/mssql/src/cms/cmsService.ts @@ -20,9 +20,9 @@ export class CmsService { this.appContext.registerService(constants.CmsService, this); } - createCmsServer(name: string, description:string, connectiondetails: azdata.ConnectionInfo, ownerUri: string): Thenable { + createCmsServer(name: string, description: string, connectiondetails: azdata.ConnectionInfo, ownerUri: string): Thenable { 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 => { @@ -35,7 +35,7 @@ export class CmsService { ); } - getRegisteredServers(ownerUri: string, relativePath: string): Thenable { + getRegisteredServers(ownerUri: string, relativePath: string): Thenable { let params: contracts.ListRegisteredServersParams = { parentOwnerUri: ownerUri, relativePath: relativePath }; return this.client.sendRequest(contracts.ListRegisteredServersRequest.type, params).then( r => { @@ -48,7 +48,7 @@ export class CmsService { ); } - addRegisteredServer (ownerUri: string, relativePath: string, registeredServerName: string, registeredServerDescription:string, connectionDetails:azdata.ConnectionInfo): Thenable { + addRegisteredServer(ownerUri: string, relativePath: string, registeredServerName: string, registeredServerDescription: string, connectionDetails: azdata.ConnectionInfo): Thenable { 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 { + removeRegisteredServer(ownerUri: string, relativePath: string, registeredServerName: string): Thenable { 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 { + addServerGroup(ownerUri: string, relativePath: string, groupName: string, groupDescription: string): Thenable { 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 { + removeServerGroup(ownerUri: string, relativePath: string, groupName: string): Thenable { let params: contracts.RemoveServerGroupParams = { parentOwnerUri: ownerUri, relativePath: relativePath, groupName: groupName }; return this.client.sendRequest(contracts.RemoveServerGroupRequest.type, params).then( r => { diff --git a/extensions/mssql/src/contracts.ts b/extensions/mssql/src/contracts.ts index 0b5437aaa9..5c7c8104b1 100644 --- a/extensions/mssql/src/contracts.ts +++ b/extensions/mssql/src/contracts.ts @@ -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'; @@ -377,37 +376,37 @@ export namespace GenerateDeployPlanRequest { export interface CreateCentralManagementServerParams { - registeredServerName: string; - registeredServerDescription : string; - connectParams: ConnectParams; + registeredServerName: string; + registeredServerDescription: string; + connectParams: ConnectParams; } export interface ListRegisteredServersParams extends RegisteredServerParamsBase { - // same as base + // same as base } export interface AddRegisteredServerParams extends RegisteredServerParamsBase { - registeredServerName: string; - registeredServerDescription : string; - registeredServerConnectionDetails: azdata.ConnectionInfo; + registeredServerName: string; + registeredServerDescription: string; + registeredServerConnectionDetails: azdata.ConnectionInfo; } export interface RemoveRegisteredServerParams extends RegisteredServerParamsBase { - registeredServerName: string; + registeredServerName: string; } export interface AddServerGroupParams extends RegisteredServerParamsBase { - groupName: string; + groupName: string; groupDescription: string; } export interface RemoveServerGroupParams extends RegisteredServerParamsBase { - groupName: string; + groupName: string; } export interface RegisteredServerParamsBase { - parentOwnerUri: string; - relativePath: string; + parentOwnerUri: string; + relativePath: string; } export namespace CreateCentralManagementServerRequest { @@ -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('schemaCompare/compare'); } - export namespace SchemaCompareGenerateScriptRequest { +export namespace SchemaCompareGenerateScriptRequest { export const type = new RequestType('schemaCompare/generateScript'); } // ------------------------------- ----------------------------- diff --git a/extensions/mssql/src/escapeException.ts b/extensions/mssql/src/escapeException.ts index e405084cbe..1614a9bcce 100644 --- a/extensions/mssql/src/escapeException.ts +++ b/extensions/mssql/src/escapeException.ts @@ -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'); diff --git a/extensions/mssql/src/features.ts b/extensions/mssql/src/features.ts index 4f19c416bf..b8f76db0c1 100644 --- a/extensions/mssql/src/features.ts +++ b/extensions/mssql/src/features.ts @@ -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 { let self = this; let schemaCompare = (sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable => { - 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; @@ -182,8 +180,8 @@ export class SchemaCompareServicesFeature extends SqlOpsFeature { ); }; - let schemaCompareGenerateScript = (operationId: string, targetDatabaseName: string, scriptFilePath: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable => { - let params: contracts.SchemaCompareGenerateScriptParams = {operationId: operationId, targetDatabaseName: targetDatabaseName, scriptFilePath: scriptFilePath, taskExecutionMode: taskExecutionMode}; + let schemaCompareGenerateScript = (operationId: string, targetDatabaseName: string, scriptFilePath: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable => { + let params: contracts.SchemaCompareGenerateScriptParams = { operationId: operationId, targetDatabaseName: targetDatabaseName, scriptFilePath: scriptFilePath, taskExecutionMode: taskExecutionMode }; return client.sendRequest(contracts.SchemaCompareGenerateScriptRequest.type, params).then( r => { return r; diff --git a/extensions/mssql/src/localizedConstants.ts b/extensions/mssql/src/localizedConstants.ts index 01d7fcb1a0..345a3c0ffa 100644 --- a/extensions/mssql/src/localizedConstants.ts +++ b/extensions/mssql/src/localizedConstants.ts @@ -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.'); diff --git a/extensions/mssql/src/objectExplorerNodeProvider/command.ts b/extensions/mssql/src/objectExplorerNodeProvider/command.ts index 01b3ed92b7..cbc5741177 100644 --- a/extensions/mssql/src/objectExplorerNodeProvider/command.ts +++ b/extensions/mssql/src/objectExplorerNodeProvider/command.ts @@ -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 { diff --git a/extensions/mssql/src/objectExplorerNodeProvider/connection.ts b/extensions/mssql/src/objectExplorerNodeProvider/connection.ts index 8eaacfe83c..73322237c7 100644 --- a/extensions/mssql/src/objectExplorerNodeProvider/connection.ts +++ b/extensions/mssql/src/objectExplorerNodeProvider/connection.ts @@ -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; } } diff --git a/extensions/mssql/src/objectExplorerNodeProvider/fileSources.ts b/extensions/mssql/src/objectExplorerNodeProvider/fileSources.ts index 289b183888..f200c3b362 100644 --- a/extensions/mssql/src/objectExplorerNodeProvider/fileSources.ts +++ b/extensions/mssql/src/objectExplorerNodeProvider/fileSources.ts @@ -153,7 +153,7 @@ export class HdfsFileSource implements IFileSource { reject(error); } else { let hdfsFiles: IFile[] = files.map(file => { - let hdfsFile = file; + let hdfsFile = file; return new File(File.createPath(path, hdfsFile.pathSuffix), hdfsFile.type === 'DIRECTORY'); }); resolve(hdfsFiles); @@ -195,9 +195,9 @@ export class HdfsFileSource implements IFileSource { error = 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' + - '#################################################################################################################### \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))); resolve(Buffer.concat(data)); @@ -236,15 +236,15 @@ export class HdfsFileSource implements IFileSource { lineReader.close(); } }) - .on('error', (err) => { - error = err; - reject(error); - }) - .on('close', () => { - if (!error) { - resolve(Buffer.from(lineData.join(os.EOL))); - } - }); + .on('error', (err) => { + error = err; + reject(error); + }) + .on('close', () => { + if (!error) { + resolve(Buffer.from(lineData.join(os.EOL))); + } + }); }); } diff --git a/extensions/mssql/src/objectExplorerNodeProvider/hdfsProvider.ts b/extensions/mssql/src/objectExplorerNodeProvider/hdfsProvider.ts index a4ce114356..4307028212 100644 --- a/extensions/mssql/src/objectExplorerNodeProvider/hdfsProvider.ts +++ b/extensions/mssql/src/objectExplorerNodeProvider/hdfsProvider.ts @@ -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; diff --git a/extensions/mssql/src/objectExplorerNodeProvider/objectExplorerNodeProvider.ts b/extensions/mssql/src/objectExplorerNodeProvider/objectExplorerNodeProvider.ts index 730f8f9174..24449f4386 100644 --- a/extensions/mssql/src/objectExplorerNodeProvider/objectExplorerNodeProvider.ts +++ b/extensions/mssql/src/objectExplorerNodeProvider/objectExplorerNodeProvider.ts @@ -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; diff --git a/extensions/mssql/src/objectExplorerNodeProvider/providerBase.ts b/extensions/mssql/src/objectExplorerNodeProvider/providerBase.ts index 7dd137c3c9..530cefb103 100644 --- a/extensions/mssql/src/objectExplorerNodeProvider/providerBase.ts +++ b/extensions/mssql/src/objectExplorerNodeProvider/providerBase.ts @@ -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. diff --git a/extensions/mssql/src/objectExplorerNodeProvider/treeNodes.ts b/extensions/mssql/src/objectExplorerNodeProvider/treeNodes.ts index 25d8f55ef3..b62a5f5e20 100644 --- a/extensions/mssql/src/objectExplorerNodeProvider/treeNodes.ts +++ b/extensions/mssql/src/objectExplorerNodeProvider/treeNodes.ts @@ -68,7 +68,7 @@ export abstract class TreeNode implements ITreeNode { if (children) { for (let child of children) { if (filter && filter(child)) { - let childNode = await this.findNode(child, condition, filter, expandIfNeeded); + let childNode = await this.findNode(child, condition, filter, expandIfNeeded); if (childNode) { return childNode; } @@ -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(); } /** diff --git a/extensions/mssql/src/objectExplorerNodeProvider/types.d.ts b/extensions/mssql/src/objectExplorerNodeProvider/types.d.ts index 47caa95397..87218a84fc 100644 --- a/extensions/mssql/src/objectExplorerNodeProvider/types.d.ts +++ b/extensions/mssql/src/objectExplorerNodeProvider/types.d.ts @@ -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,9 +21,8 @@ export interface ITreeNode { * can be queried * * @export - * @interface IFileNode * @extends {ITreeNode} */ export interface IFileNode extends ITreeNode { getFileContentsAsString(maxBytes?: number): Promise; -} \ No newline at end of file +} diff --git a/extensions/mssql/src/objectExplorerNodeProvider/webhdfs.ts b/extensions/mssql/src/objectExplorerNodeProvider/webhdfs.ts index ec5a453b7c..02da36a98b 100644 --- a/extensions/mssql/src/objectExplorerNodeProvider/webhdfs.ts +++ b/extensions/mssql/src/objectExplorerNodeProvider/webhdfs.ts @@ -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; @@ -140,16 +136,16 @@ export class WebHDFS { return statusMessage && remoteExceptionMessage ? `${statusMessage} (${remoteExceptionMessage})` : statusMessage || remoteExceptionMessage || messageFromError || - localize('webhdfs.unknownError', 'Unknown Error'); + localize('webhdfs.unknownError', 'Unknown Error'); } /** * 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 { diff --git a/extensions/mssql/src/prompts/progressIndicator.ts b/extensions/mssql/src/prompts/progressIndicator.ts index 4346d00da8..94fa5c7b15 100644 --- a/extensions/mssql/src/prompts/progressIndicator.ts +++ b/extensions/mssql/src/prompts/progressIndicator.ts @@ -11,7 +11,7 @@ export default class ProgressIndicator { constructor() { this._statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left); - } + } private _tasks: string[] = []; public beginTask(task: string): void { diff --git a/extensions/mssql/src/prompts/question.ts b/extensions/mssql/src/prompts/question.ts index e570d89568..af187c066b 100644 --- a/extensions/mssql/src/prompts/question.ts +++ b/extensions/mssql/src/prompts/question.ts @@ -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(questions: IQuestion[], ignoreFocusOut?: boolean): Promise<{ [questionId: string]: any }>; diff --git a/extensions/mssql/src/sparkFeature/historyTask.ts b/extensions/mssql/src/sparkFeature/historyTask.ts index 1b094f7191..9ff6382d65 100644 --- a/extensions/mssql/src/sparkFeature/historyTask.ts +++ b/extensions/mssql/src/sparkFeature/historyTask.ts @@ -18,9 +18,8 @@ export class OpenSparkYarnHistoryTask { async execute(sqlConnProfile: azdata.IConnectionProfile, isSpark: boolean): Promise { 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; } diff --git a/extensions/mssql/src/sparkFeature/sparkUtils.ts b/extensions/mssql/src/sparkFeature/sparkUtils.ts index 02db13c641..fdc3ab7b84 100644 --- a/extensions/mssql/src/sparkFeature/sparkUtils.ts +++ b/extensions/mssql/src/sparkFeature/sparkUtils.ts @@ -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 dropdownValue; } else { return dropdownValue ? (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'; diff --git a/extensions/mssql/src/sqlClusterLookUp.ts b/extensions/mssql/src/sqlClusterLookUp.ts index f8131417a8..69aa11f37b 100644 --- a/extensions/mssql/src/sqlClusterLookUp.ts +++ b/extensions/mssql/src/sqlClusterLookUp.ts @@ -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; } @@ -45,7 +45,7 @@ function findSqlClusterConnectionBySqlConnProfile(sqlConnProfile: azdata.IConnec let sqlClusterSession = sqlOeNodeProvider.findSqlClusterSessionBySqlConnProfile(sqlConnProfile); if (!sqlClusterSession) { return undefined; } - return sqlClusterSession.sqlClusterConnection; + return sqlClusterSession.sqlClusterConnection; } export async function getSqlClusterConnection( @@ -123,8 +123,7 @@ function connToConnectionParam(connection: azdata.connection.Connection): Connec return 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; diff --git a/extensions/mssql/src/telemetry.ts b/extensions/mssql/src/telemetry.ts index 99e555a42e..68a772b7bd 100644 --- a/extensions/mssql/src/telemetry.ts +++ b/extensions/mssql/src/telemetry.ts @@ -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 { diff --git a/extensions/mssql/src/utils.ts b/extensions/mssql/src/utils.ts index a1b3c54f3f..1b68a788eb 100644 --- a/extensions/mssql/src/utils.ts +++ b/extensions/mssql/src/utils.ts @@ -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 { - 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); diff --git a/extensions/notebook/src/common/apiWrapper.ts b/extensions/notebook/src/common/apiWrapper.ts index e4ab5e4140..3705ebece1 100644 --- a/extensions/notebook/src/common/apiWrapper.ts +++ b/extensions/notebook/src/common/apiWrapper.ts @@ -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 { diff --git a/extensions/notebook/src/common/constants.ts b/extensions/notebook/src/common/constants.ts index 97dd185cb2..85147c6f90 100644 --- a/extensions/notebook/src/common/constants.ts +++ b/extensions/notebook/src/common/constants.ts @@ -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 /////////////////////////////////////////////////////////// diff --git a/extensions/notebook/src/common/ports.ts b/extensions/notebook/src/common/ports.ts index 535a7a58eb..1297c35eab 100644 --- a/extensions/notebook/src/common/ports.ts +++ b/extensions/notebook/src/common/ports.ts @@ -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); diff --git a/extensions/notebook/src/common/utils.ts b/extensions/notebook/src/common/utils.ts index 1678ca5edd..18f8b86ca0 100644 --- a/extensions/notebook/src/common/utils.ts +++ b/extensions/notebook/src/common/utils.ts @@ -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'; diff --git a/extensions/notebook/src/extension.ts b/extensions/notebook/src/extension.ts index 4db3fab3ae..d7afaf2456 100644 --- a/extensions/notebook/src/extension.ts +++ b/extensions/notebook/src/extension.ts @@ -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 { extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.new', (context?: azdata.ConnectedContext) => { diff --git a/extensions/notebook/src/intellisense/text.ts b/extensions/notebook/src/intellisense/text.ts index 11b4301f52..3e8d5c9657 100644 --- a/extensions/notebook/src/intellisense/text.ts +++ b/extensions/notebook/src/intellisense/text.ts @@ -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++; } diff --git a/extensions/notebook/src/jupyter/jupyterKernel.ts b/extensions/notebook/src/jupyter/jupyterKernel.ts index d45f053b9c..6e5ea701dd 100644 --- a/extensions/notebook/src/jupyter/jupyterKernel.ts +++ b/extensions/notebook/src/jupyter/jupyterKernel.ts @@ -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'; diff --git a/extensions/notebook/src/jupyter/serverInstance.ts b/extensions/notebook/src/jupyter/serverInstance.ts index cdf7f73e65..06a1720389 100644 --- a/extensions/notebook/src/jupyter/serverInstance.ts +++ b/extensions/notebook/src/jupyter/serverInstance.ts @@ -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} */ protected async startInternal(): Promise { if (this.isStarted) { diff --git a/extensions/notebook/src/prompts/question.ts b/extensions/notebook/src/prompts/question.ts index e570d89568..af187c066b 100644 --- a/extensions/notebook/src/prompts/question.ts +++ b/extensions/notebook/src/prompts/question.ts @@ -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(questions: IQuestion[], ignoreFocusOut?: boolean): Promise<{ [questionId: string]: any }>; diff --git a/extensions/notebook/src/test/common/port.test.ts b/extensions/notebook/src/test/common/port.test.ts index 137dfd3717..21927aa04c 100644 --- a/extensions/notebook/src/test/common/port.test.ts +++ b/extensions/notebook/src/test/common/port.test.ts @@ -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. diff --git a/extensions/notebook/src/test/common/stubs.ts b/extensions/notebook/src/test/common/stubs.ts index 25b6d0fd53..da897c6dee 100644 --- a/extensions/notebook/src/test/common/stubs.ts +++ b/extensions/notebook/src/test/common/stubs.ts @@ -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'; diff --git a/extensions/notebook/src/test/common/testUtils.ts b/extensions/notebook/src/test/common/testUtils.ts index b9220a75c8..5d224d9297 100644 --- a/extensions/notebook/src/test/common/testUtils.ts +++ b/extensions/notebook/src/test/common/testUtils.ts @@ -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. diff --git a/extensions/profiler/client/src/apiWrapper.ts b/extensions/profiler/client/src/apiWrapper.ts index 926912ce30..8cec9d980b 100644 --- a/extensions/profiler/client/src/apiWrapper.ts +++ b/extensions/profiler/client/src/apiWrapper.ts @@ -3,61 +3,57 @@ * 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 + // Data APIs - public registerWebviewProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void { - return data.dashboard.registerWebviewProvider(widgetId, handler); - } + public registerWebviewProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void { + return data.dashboard.registerWebviewProvider(widgetId, handler); + } - public registerControlHostProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void { - return data.dashboard.registerWebviewProvider(widgetId, handler); - } + public registerControlHostProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void { + return data.dashboard.registerWebviewProvider(widgetId, handler); + } - /** - * Get the configuration for a extensionName - * @param extensionName The string name of the extension to get the configuration for - * @param resource The optional URI, as a URI object or a string, to use to get resource-scoped configurations - */ - public getConfiguration(extensionName: string, resource?: vscode.Uri | string): vscode.WorkspaceConfiguration { - if (typeof resource === 'string') { - try { - resource = this.parseUri(resource); - } catch (e) { - resource = undefined; - } - } - return vscode.workspace.getConfiguration(extensionName, resource as vscode.Uri); - } + /** + * Get the configuration for a extensionName + * @param extensionName The string name of the extension to get the configuration for + * @param resource The optional URI, as a URI object or a string, to use to get resource-scoped configurations + */ + public getConfiguration(extensionName: string, resource?: vscode.Uri | string): vscode.WorkspaceConfiguration { + if (typeof resource === 'string') { + try { + resource = this.parseUri(resource); + } catch (e) { + resource = undefined; + } + } + return vscode.workspace.getConfiguration(extensionName, resource as vscode.Uri); + } - /** - * Parse uri - */ - public parseUri(uri: string): vscode.Uri { - return vscode.Uri.parse(uri); - } + /** + * Parse uri + */ + public parseUri(uri: string): vscode.Uri { + return vscode.Uri.parse(uri); + } - public showOpenDialog(options: vscode.OpenDialogOptions): Thenable { - return vscode.window.showOpenDialog(options); - } + public showOpenDialog(options: vscode.OpenDialogOptions): Thenable { + return vscode.window.showOpenDialog(options); + } - public showErrorMessage(message: string, ...items: string[]): Thenable { - return vscode.window.showErrorMessage(message, ...items); - } + public showErrorMessage(message: string, ...items: string[]): Thenable { + return vscode.window.showErrorMessage(message, ...items); + } - public get workspaceRootPath(): string { - return vscode.workspace.rootPath; - } + public get workspaceRootPath(): string { + return vscode.workspace.rootPath; + } } diff --git a/extensions/profiler/client/src/mainController.ts b/extensions/profiler/client/src/mainController.ts index c583029e1a..93ae68c047 100644 --- a/extensions/profiler/client/src/mainController.ts +++ b/extensions/profiler/client/src/mainController.ts @@ -22,9 +22,9 @@ export class MainController { this._context = context; } - /** - * Deactivates the extension - */ + /** + * Deactivates the extension + */ public deactivate(): void { } diff --git a/extensions/profiler/client/tsconfig.json b/extensions/profiler/client/tsconfig.json index e6baa6d40d..9bf2e497f7 100644 --- a/extensions/profiler/client/tsconfig.json +++ b/extensions/profiler/client/tsconfig.json @@ -1,19 +1,18 @@ { - "compileOnSave": true, - "compilerOptions": { - "module": "commonjs", - "target": "es6", + "compileOnSave": true, + "compilerOptions": { + "module": "commonjs", + "target": "es6", "outDir": "./out", "lib": [ "es6", "es2015.promise" ], - "sourceMap": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "moduleResolution": "node", - "declaration": true - }, - "exclude": [ - "node_modules" - ] + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "moduleResolution": "node" + }, + "exclude": [ + "node_modules" + ] } diff --git a/extensions/schema-compare/src/schemaCompareResult.ts b/extensions/schema-compare/src/schemaCompareResult.ts index c2f740dfac..d2f2af8eea 100644 --- a/extensions/schema-compare/src/schemaCompareResult.ts +++ b/extensions/schema-compare/src/schemaCompareResult.ts @@ -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') diff --git a/extensions/schema-compare/tsconfig.json b/extensions/schema-compare/tsconfig.json index 76b02da52f..eb1bf3a22b 100644 --- a/extensions/schema-compare/tsconfig.json +++ b/extensions/schema-compare/tsconfig.json @@ -1,20 +1,20 @@ { - "compileOnSave": true, - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "outDir": "./out", - "lib": [ - "es6", - "es2015.promise" - ], - "sourceMap": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "moduleResolution": "node", - "declaration": false - }, - "exclude": [ - "node_modules" - ] + "compileOnSave": true, + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "outDir": "./out", + "lib": [ + "es6", + "es2015.promise" + ], + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "moduleResolution": "node", + "declaration": false + }, + "exclude": [ + "node_modules" + ] } \ No newline at end of file diff --git a/extensions/typescript-language-features/src/features/smartSelect.ts b/extensions/typescript-language-features/src/features/smartSelect.ts deleted file mode 100644 index a9a0370bee..0000000000 --- a/extensions/typescript-language-features/src/features/smartSelect.ts +++ /dev/null @@ -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 { - 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))); -} \ No newline at end of file diff --git a/extensions/typescript-language-features/src/test/onEnter.test.ts b/extensions/typescript-language-features/src/test/onEnter.test.ts deleted file mode 100644 index c7d6c3a45d..0000000000 --- a/extensions/typescript-language-features/src/test/onEnter.test.ts +++ /dev/null @@ -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 => { - return new Promise(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 => { - 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 =
${CURSOR}`, 'jsx', async (_editor, document) => { - await type(document, '\nx'); - assert.strictEqual(document.getText(), `const a =
\n x`); - }); - }); - - test('should indent after simple jsx tag with attributes', () => { - return withRandomFileEditor(`const a =
${CURSOR}`, 'jsx', async (_editor, document) => { - await type(document, '\nx'); - assert.strictEqual(document.getText(), `const a =
\n x`); - }); - }); -}); \ No newline at end of file diff --git a/extensions/typescript-language-features/src/test/testUtils.ts b/extensions/typescript-language-features/src/test/testUtils.ts deleted file mode 100644 index d8efdc3f9c..0000000000 --- a/extensions/typescript-language-features/src/test/testUtils.ts +++ /dev/null @@ -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 { - 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 { - 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 -): Thenable { - 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); - } - }); - }); - }); - }); -} \ No newline at end of file diff --git a/src/paths.js b/src/paths.js index 51cfa3caa6..b49f0db52e 100644 --- a/src/paths.js +++ b/src/paths.js @@ -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'); diff --git a/src/sql/azdata.proposed.d.ts b/src/sql/azdata.proposed.d.ts index 15a0158363..21205b7129 100644 --- a/src/sql/azdata.proposed.d.ts +++ b/src/sql/azdata.proposed.d.ts @@ -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} 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; } @@ -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; @@ -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; /** * 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; /** * 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; /** * 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; @@ -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; @@ -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} Promise to return the accounts + * @returns Promise to return the accounts */ export function getAllAccounts(): Thenable; /** * 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 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; /** * 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; @@ -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, 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} 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; /** * Sends an updated property of the component to the UI * - * @returns {Thenable} 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; @@ -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, 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; } @@ -2834,8 +2826,8 @@ declare module 'azdata' { export interface DivContainer extends Container, DivContainerProperties { /** - * An event called when the div is clicked - */ + * An event called when the div is clicked + */ onDidClick: vscode.Event; } @@ -3371,9 +3363,8 @@ declare module 'azdata' { export namespace window { /** - * creates a web view dialog - * @param title - */ + * creates a web view dialog + */ 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; /** * 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): 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; @@ -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; @@ -3974,8 +3964,6 @@ declare module 'azdata' { export namespace nb { /** * All notebook documents currently known to the system. - * - * @readonly */ export let notebookDocuments: NotebookDocument[]; diff --git a/src/sql/base/browser/ui/checkbox/media/checkbox.css b/src/sql/base/browser/ui/checkbox/media/checkbox.css index cf594a8188..5485dc8982 100644 --- a/src/sql/base/browser/ui/checkbox/media/checkbox.css +++ b/src/sql/base/browser/ui/checkbox/media/checkbox.css @@ -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; diff --git a/src/sql/base/browser/ui/editableDropdown/dropdown.ts b/src/sql/base/browser/ui/editableDropdown/dropdown.ts index 9f73a0b3f2..7ae3e4851c 100644 --- a/src/sql/base/browser/ui/editableDropdown/dropdown.ts +++ b/src/sql/base/browser/ui/editableDropdown/dropdown.ts @@ -107,7 +107,7 @@ export class Dropdown extends Disposable { super(); this._contextView = new ContextView(layoutService.container); this._options = opt || Object.create(null); - mixin(this._options, defaults, false) as IDropdownOptions; + mixin(this._options, defaults, false); this._el = DOM.append(container, DOM.$('.monaco-dropdown')); this._el.style.width = '100%'; diff --git a/src/sql/base/browser/ui/selectBox/media/selectBox.css b/src/sql/base/browser/ui/selectBox/media/selectBox.css index 8e46769a9a..3c2a8bfbc1 100644 --- a/src/sql/base/browser/ui/selectBox/media/selectBox.css +++ b/src/sql/base/browser/ui/selectBox/media/selectBox.css @@ -1,10 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + .labelOnTopContainer { - display: flex; - flex-direction: column; + display: flex; + flex-direction: column; } .labelOnLeftContainer { - display: flex; - flex-direction: row; - margin-right: 5px; + display: flex; + flex-direction: row; + margin-right: 5px; } diff --git a/src/sql/base/browser/ui/table/media/slick.grid.css b/src/sql/base/browser/ui/table/media/slick.grid.css index 8daf25d409..ef18056012 100644 --- a/src/sql/base/browser/ui/table/media/slick.grid.css +++ b/src/sql/base/browser/ui/table/media/slick.grid.css @@ -1,9 +1,7 @@ -/* -IMPORTANT: -In order to preserve the uniform grid appearance, all cell styles need to have padding, margin and border sizes. -No built-in (selected, editable, highlight, flashing, invalid, loading, :focus) or user-specified CSS -classes should alter those! -*/ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ .slick-header.ui-state-default, .slick-headerrow.ui-state-default, .slick-footerrow.ui-state-default { width: 100%; diff --git a/src/sql/base/browser/ui/table/media/slickColorTheme.css b/src/sql/base/browser/ui/table/media/slickColorTheme.css index 24e7b8d966..f6b0953f2e 100644 --- a/src/sql/base/browser/ui/table/media/slickColorTheme.css +++ b/src/sql/base/browser/ui/table/media/slickColorTheme.css @@ -71,7 +71,7 @@ /* grid styling */ .vs slick-grid.active .grid .slick-cell.active { - border-color: var(--color-cell-border-active); + border-color: var(--color-cell-border-active); } .vs slick-grid.active .grid .slick-cell.selected { @@ -202,7 +202,7 @@ /* grid styling */ .vs-dark slick-grid.active .grid .slick-cell.active { - border-color: var(--color-cell-border-active); + border-color: var(--color-cell-border-active); } .vs-dark slick-grid.active .grid .slick-cell.selected { @@ -348,7 +348,7 @@ /* grid styling */ .hc-black slick-grid.active .grid .slick-cell.active { - border-color: var(--color-cell-border-active); + border-color: var(--color-cell-border-active); } .hc-black slick-grid.active .grid .slick-cell.selected { diff --git a/src/sql/base/browser/ui/table/media/table.css b/src/sql/base/browser/ui/table/media/table.css index 48762b35d8..a61d33821a 100644 --- a/src/sql/base/browser/ui/table/media/table.css +++ b/src/sql/base/browser/ui/table/media/table.css @@ -35,129 +35,129 @@ } .slick-header-menubutton { - background-position: center center; - background-repeat: no-repeat; - bottom: 0; - cursor: pointer; - display: inline-block; - position: absolute; - right: 10px; - top: 0; - width: 18px; - background-image: url('down.svg'); + background-position: center center; + background-repeat: no-repeat; + bottom: 0; + cursor: pointer; + display: inline-block; + position: absolute; + right: 10px; + top: 0; + width: 18px; + background-image: url('down.svg'); } .vs-dark .slick-header-menubutton, .hc-black .slick-header-menubutton { - background-image: url('down-inverse.svg'); + background-image: url('down-inverse.svg'); } .slick-header-menubutton.filtered { - background-image: url('filter.svg'); + background-image: url('filter.svg'); } .vs-dark .slick-header-menubutton.filtered, .hc-black .slick-header-menubutton.filtered { - background-image: url('filter_inverse.svg'); + background-image: url('filter_inverse.svg'); } .slick-header-menu { - background: none repeat scroll 0 0 white; - border: 1px solid #BFBDBD; - min-width: 175px; - padding: 4px; - z-index: 100000; - cursor: default; - display: inline-block; - margin: 0; - position: absolute; + background: none repeat scroll 0 0 white; + border: 1px solid #BFBDBD; + min-width: 175px; + padding: 4px; + z-index: 100000; + cursor: default; + display: inline-block; + margin: 0; + position: absolute; } .vs-dark .slick-header-menu { - background: none repeat scroll 0 0 #333333; + background: none repeat scroll 0 0 #333333; } .hc-black .slick-header-menu { - background: none repeat scroll 0 0 #000000; + background: none repeat scroll 0 0 #000000; } .slick-header-menu a.monaco-button.monaco-text-button { - width: 60px; - margin: 6px 6px 6px 6px; - padding: 4px; + width: 60px; + margin: 6px 6px 6px 6px; + padding: 4px; } .slick-header-menu .filter { - border: 1px solid #BFBDBD; - font-size: 8pt; - height: 250px; - margin-top: 6px; - overflow: scroll; - padding: 4px; - white-space: nowrap; - width: 200px; + border: 1px solid #BFBDBD; + font-size: 8pt; + height: 250px; + margin-top: 6px; + overflow: scroll; + padding: 4px; + white-space: nowrap; + width: 200px; } .monaco-table label { - display: block; - margin-bottom: 5px; + display: block; + margin-bottom: 5px; } .slick-header-menuitem { - border: 1px solid transparent; - padding: 2px 4px; - cursor: pointer; - list-style: none outside none; - margin: 0; + border: 1px solid transparent; + padding: 2px 4px; + cursor: pointer; + list-style: none outside none; + margin: 0; } .slick-header-menuicon { - display: inline-block; - height: 16px; - margin-right: 4px; - vertical-align: middle; - width: 16px; + display: inline-block; + height: 16px; + margin-right: 4px; + vertical-align: middle; + width: 16px; } .slick-header-menuicon.ascending { - background: url('sort-asc.gif'); - background-position: center center; - background-repeat: no-repeat; + background: url('sort-asc.gif'); + background-position: center center; + background-repeat: no-repeat; } .slick-header-menuicon.descending { - background: url('sort-desc.gif'); - background-position: center center; - background-repeat: no-repeat; + background: url('sort-desc.gif'); + background-position: center center; + background-repeat: no-repeat; } .slick-header-menucontent { - display: inline-block; - vertical-align: middle; + display: inline-block; + vertical-align: middle; } .slick-header-menuitem:hover { - border-color: #BFBDBD; + border-color: #BFBDBD; } .header-overlay, .cell-overlay, .selection-cell-overlay { - display: block; - position: absolute; - z-index: 999; + display: block; + position: absolute; + z-index: 999; } .vs-dark .slick-header-menu > input.input { - color: #4a4a4a; + color: #4a4a4a; } .hc-black .slick-header-menu > input.input { - color: #000000; + color: #000000; } .vs-dark .slick-header-menu, .hc-black .slick-header-menu { - color: #FFFFFF; -} \ No newline at end of file + color: #FFFFFF; +} diff --git a/src/sql/base/browser/ui/table/plugins/cellRangeSelector.ts b/src/sql/base/browser/ui/table/plugins/cellRangeSelector.ts index b2128e60bf..b8ce4bcb5d 100644 --- a/src/sql/base/browser/ui/table/plugins/cellRangeSelector.ts +++ b/src/sql/base/browser/ui/table/plugins/cellRangeSelector.ts @@ -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. + *--------------------------------------------------------------------------------------------*/ + import { mixin } from 'vs/base/common/objects'; const defaultOptions: ICellRangeSelectorOptions = { diff --git a/src/sql/base/browser/ui/taskbar/media/taskbar.css b/src/sql/base/browser/ui/taskbar/media/taskbar.css index 2164b1316e..2e7d53c00e 100644 --- a/src/sql/base/browser/ui/taskbar/media/taskbar.css +++ b/src/sql/base/browser/ui/taskbar/media/taskbar.css @@ -48,12 +48,12 @@ background-repeat: no-repeat; background-position: 0% 50%; padding-left: 15px; - } +} - .carbon-taskbar .action-item-label { +.carbon-taskbar .action-item-label { display: flex; padding-right: 5px; - } +} .listDatabasesSelectBox { padding-left: 2px; @@ -64,7 +64,7 @@ .configuration.select-container .select-box { margin-top: 4px; margin-top: 3px; - } +} .taskbarSeparator { width: 1px; diff --git a/src/sql/base/common/log.ts b/src/sql/base/common/log.ts index d110164a97..d9c4558bc4 100644 --- a/src/sql/base/common/log.ts +++ b/src/sql/base/common/log.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ export function log(...args: any[]): void { console.log(`\x1b[90m[main ${new Date().toLocaleTimeString()}]\x1b[0m`, ...args); diff --git a/src/sql/editor/browser/diffEditorHelper.ts b/src/sql/editor/browser/diffEditorHelper.ts index 6cf3088346..ddbd4682a5 100644 --- a/src/sql/editor/browser/diffEditorHelper.ts +++ b/src/sql/editor/browser/diffEditorHelper.ts @@ -10,26 +10,26 @@ import * as editorCommon from 'vs/editor/common/editorCommon'; * @param lineChanges The line changes to be reversed */ export function reverseLineChanges(lineChanges: editorCommon.ILineChange[]): editorCommon.ILineChange[] { - let reversedLineChanges = lineChanges.map(linechange => { - return { - modifiedStartLineNumber: linechange.originalStartLineNumber, - modifiedEndLineNumber: linechange.originalEndLineNumber, - originalStartLineNumber: linechange.modifiedStartLineNumber, - originalEndLineNumber: linechange.modifiedEndLineNumber, - charChanges: (linechange.charChanges) ? - linechange.charChanges.map(charchange => { - return { - originalStartColumn: charchange.modifiedStartColumn, - originalEndColumn: charchange.modifiedEndColumn, - modifiedStartColumn: charchange.originalStartColumn, - modifiedEndColumn: charchange.originalEndColumn, - modifiedStartLineNumber: charchange.originalStartLineNumber, - modifiedEndLineNumber: charchange.originalEndLineNumber, - originalStartLineNumber: charchange.modifiedStartLineNumber, - originalEndLineNumber: charchange.modifiedEndLineNumber, - }; - }) : undefined - }; - }); - return reversedLineChanges; - } + let reversedLineChanges = lineChanges.map(linechange => { + return { + modifiedStartLineNumber: linechange.originalStartLineNumber, + modifiedEndLineNumber: linechange.originalEndLineNumber, + originalStartLineNumber: linechange.modifiedStartLineNumber, + originalEndLineNumber: linechange.modifiedEndLineNumber, + charChanges: (linechange.charChanges) ? + linechange.charChanges.map(charchange => { + return { + originalStartColumn: charchange.modifiedStartColumn, + originalEndColumn: charchange.modifiedEndColumn, + modifiedStartColumn: charchange.originalStartColumn, + modifiedEndColumn: charchange.originalEndColumn, + modifiedStartLineNumber: charchange.originalStartLineNumber, + modifiedEndLineNumber: charchange.originalEndLineNumber, + originalStartLineNumber: charchange.modifiedStartLineNumber, + originalEndLineNumber: charchange.modifiedEndLineNumber, + }; + }) : undefined + }; + }); + return reversedLineChanges; +} diff --git a/src/sql/media/actionBarLabel.css b/src/sql/media/actionBarLabel.css index 1fbdad6eb1..caf4409f50 100644 --- a/src/sql/media/actionBarLabel.css +++ b/src/sql/media/actionBarLabel.css @@ -11,7 +11,7 @@ /* Activity Bar - explore */ .monaco-workbench > .activitybar > .content .monaco-action-bar .action-label.explore { - -webkit-mask: url('icons/file_inverse.svg') no-repeat 50% 50%; + -webkit-mask: url('icons/file_inverse.svg') no-repeat 50% 50%; -webkit-mask-size: 25px 25px; } @@ -23,7 +23,7 @@ /* Activity Bar - search */ .monaco-workbench > .activitybar > .content .monaco-action-bar .action-label.search { - -webkit-mask: url('icons/search_inverse.svg') no-repeat 50% 50%; + -webkit-mask: url('icons/search_inverse.svg') no-repeat 50% 50%; -webkit-mask-size: 25px 25px; } diff --git a/src/sql/media/icons/common-icons.css b/src/sql/media/icons/common-icons.css index 2960f0d6fe..808ec64099 100644 --- a/src/sql/media/icons/common-icons.css +++ b/src/sql/media/icons/common-icons.css @@ -33,7 +33,7 @@ .vs .icon.error, .vs-dark .icon.error, .hc-black .icon.error { - background: url("globalerror_red.svg") center center no-repeat; + background: url("globalerror_red.svg") center center no-repeat; } .vs .icon.file { diff --git a/src/sql/media/objectTypes/objecttypes.css b/src/sql/media/objectTypes/objecttypes.css index dbc9212b43..fcf9d9c498 100644 --- a/src/sql/media/objectTypes/objecttypes.css +++ b/src/sql/media/objectTypes/objecttypes.css @@ -24,634 +24,634 @@ .vs .icon.aggregatefunction, .vs-dark .icon.aggregatefunction, .hc-black .icon.aggregatefunction { - background: url("AggregateFunction.svg") center center no-repeat; + background: url("AggregateFunction.svg") center center no-repeat; } .vs .icon.aggregatefunctionparameter_input, .vs-dark .icon.aggregatefunctionparameter_input, .hc-black .icon.aggregatefunctionparameter_input { - background: url("AggregateFunctionParameter_Input.svg") center center no-repeat; + background: url("AggregateFunctionParameter_Input.svg") center center no-repeat; } .vs .icon.aggregatefunctionparameter_output, .vs-dark .icon.aggregatefunctionparameter_output, .hc-black .icon.aggregatefunctionparameter_output { - background: url("AggregateFunctionParameter_Output.svg") center center no-repeat; + background: url("AggregateFunctionParameter_Output.svg") center center no-repeat; } .vs .icon.aggregatefunctionparameter_return, .vs-dark .icon.aggregatefunctionparameter_return, .hc-black .icon.aggregatefunctionparameter_return { - background: url("AggregateFunctionParameter_Return.svg") center center no-repeat; + background: url("AggregateFunctionParameter_Return.svg") center center no-repeat; } .vs .icon.applicationrole, .vs-dark .icon.applicationrole, .hc-black .icon.applicationrole { - background: url("ApplicationRole.svg") center center no-repeat; + background: url("ApplicationRole.svg") center center no-repeat; } .vs .icon.assembly, .vs-dark .icon.assembly, .hc-black .icon.assembly { - background: url("Assembly.svg") center center no-repeat; + background: url("Assembly.svg") center center no-repeat; } .vs .icon.asymmetrickey, .vs-dark .icon.asymmetrickey, .hc-black .icon.asymmetrickey { - background: url("AsymmetricKey.svg") center center no-repeat; + background: url("AsymmetricKey.svg") center center no-repeat; } .vs .icon.brokerpriority, .vs-dark .icon.brokerpriority, .hc-black .icon.brokerpriority { - background: url("BrokerPriority.svg") center center no-repeat; + background: url("BrokerPriority.svg") center center no-repeat; } .vs .icon.certificate, .vs-dark .icon.certificate, .hc-black .icon.certificate { - background: url("Certificate.svg") center center no-repeat; + background: url("Certificate.svg") center center no-repeat; } .vs .icon.column, .vs-dark .icon.column, .hc-black .icon.column { - background: url("Column.svg") center center no-repeat; + background: url("Column.svg") center center no-repeat; } .vs .icon.columnencryptionkey, .vs-dark .icon.columnencryptionkey, .hc-black .icon.columnencryptionkey { - background: url("ColumnEncryptionKey.svg") center center no-repeat; + background: url("ColumnEncryptionKey.svg") center center no-repeat; } .vs .icon.columnmasterkey, .vs-dark .icon.columnmasterkey, .hc-black .icon.columnmasterkey { - background: url("ColumnMasterKey.svg") center center no-repeat; + background: url("ColumnMasterKey.svg") center center no-repeat; } .vs .icon.constraint, .vs-dark .icon.constraint, .hc-black .icon.constraint { - background: url("Constraint.svg") center center no-repeat; + background: url("Constraint.svg") center center no-repeat; } .vs .icon.contract, .vs-dark .icon.contract, .hc-black .icon.contract { - background: url("Contract.svg") center center no-repeat; + background: url("Contract.svg") center center no-repeat; } .vs .icon.database, .vs-dark .icon.database, .hc-black .icon.database { - background: url("Database.svg") center center no-repeat; + background: url("Database.svg") center center no-repeat; } .vs .icon.database_unavailable, .vs-dark .icon.database_unavailable, .hc-black .icon.database_unavailable { - background: url("Database_Unavailable.svg") center center no-repeat; + background: url("Database_Unavailable.svg") center center no-repeat; } .vs .icon.databaseandqueueeventnotification, .vs-dark .icon.databaseandqueueeventnotification, .hc-black .icon.databaseandqueueeventnotification { - background: url("DatabaseAndQueueEventNotification.svg") center center no-repeat; + background: url("DatabaseAndQueueEventNotification.svg") center center no-repeat; } .vs .icon.databaseauditspecification, .vs-dark .icon.databaseauditspecification, .hc-black .icon.databaseauditspecification { - background: url("DatabaseAuditSpecification.svg") center center no-repeat; + background: url("DatabaseAuditSpecification.svg") center center no-repeat; } .vs .icon.databaseencryptionkey, .vs-dark .icon.databaseencryptionkey, .hc-black .icon.databaseencryptionkey { - background: url("DatabaseEncryptionKey.svg") center center no-repeat; + background: url("DatabaseEncryptionKey.svg") center center no-repeat; } .vs .icon.databaserole, .vs-dark .icon.databaserole, .hc-black .icon.databaserole { - background: url("DatabaseRole.svg") center center no-repeat; + background: url("DatabaseRole.svg") center center no-repeat; } .vs .icon.databasescopedcredential, .vs-dark .icon.databasescopedcredential, .hc-black .icon.databasescopedcredential { - background: url("DatabaseScopedCredential.svg") center center no-repeat; + background: url("DatabaseScopedCredential.svg") center center no-repeat; } .vs .icon.databasetrigger, .vs-dark .icon.databasetrigger, .hc-black .icon.databasetrigger { - background: url("DatabaseTrigger.svg") center center no-repeat; + background: url("DatabaseTrigger.svg") center center no-repeat; } .vs .icon.defaulticon, .vs-dark .icon.defaulticon, .hc-black .icon.defaulticon { - background: url("DefaultIcon.svg") center center no-repeat; + background: url("DefaultIcon.svg") center center no-repeat; } .vs .icon.externaldatasource, .vs-dark .icon.externaldatasource, .hc-black .icon.externaldatasource { - background: url("ExternalDataSource.svg") center center no-repeat; + background: url("ExternalDataSource.svg") center center no-repeat; } .vs .icon.externalfileformat, .vs-dark .icon.externalfileformat, .hc-black .icon.externalfileformat { - background: url("ExternalFileFormat.svg") center center no-repeat; + background: url("ExternalFileFormat.svg") center center no-repeat; } .vs .icon.filegroupfile, .vs-dark .icon.filegroupfile, .hc-black .icon.filegroupfile { - background: url("FileGroupFile.svg") center center no-repeat; + background: url("FileGroupFile.svg") center center no-repeat; } .vs .icon.folder, .vs-dark .icon.folder, .hc-black .icon.folder { - background: url("Folder.svg") center center no-repeat; + background: url("Folder.svg") center center no-repeat; } .vs .icon.fulltextcatalog, .vs-dark .icon.fulltextcatalog, .hc-black .icon.fulltextcatalog { - background: url("FullTextCatalog.svg") center center no-repeat; + background: url("FullTextCatalog.svg") center center no-repeat; } .vs .icon.fulltextstoplist, .vs-dark .icon.fulltextstoplist, .hc-black .icon.fulltextstoplist { - background: url("FullTextStopList.svg") center center no-repeat; + background: url("FullTextStopList.svg") center center no-repeat; } .vs .icon.hdfsfolder, .vs-dark .icon.hdfsfolder, .hc-black .icon.hdfsfolder { - background: url("HDFSFolder.svg") center center no-repeat; + background: url("HDFSFolder.svg") center center no-repeat; } .vs .icon.index, .vs-dark .icon.index, .hc-black .icon.index { - background: url("Index.svg") center center no-repeat; + background: url("Index.svg") center center no-repeat; } .vs .icon.key_foreignkey, .vs-dark .icon.key_foreignkey, .hc-black .icon.key_foreignkey { - background: url("Key_ForeignKey.svg") center center no-repeat; + background: url("Key_ForeignKey.svg") center center no-repeat; } .vs .icon.key_primarykey, .vs-dark .icon.key_primarykey, .hc-black .icon.key_primarykey { - background: url("Key_PrimaryKey.svg") center center no-repeat; + background: url("Key_PrimaryKey.svg") center center no-repeat; } .vs .icon.index_primarykey, .vs-dark .icon.index_primarykey, .hc-black .icon.index_primarykey { - background: url("Key_PrimaryKey.svg") center center no-repeat; + background: url("Key_PrimaryKey.svg") center center no-repeat; } .vs .icon.key_uniquekey, .vs-dark .icon.key_uniquekey, .hc-black .icon.key_uniquekey { - background: url("Key_UniqueKey.svg") center center no-repeat; + background: url("Key_UniqueKey.svg") center center no-repeat; } .vs .icon.index_uniquekey, .vs-dark .icon.index_uniquekey, .hc-black .icon.index_uniquekey { - background: url("Key_UniqueKey.svg") center center no-repeat; + background: url("Key_UniqueKey.svg") center center no-repeat; } .vs .icon.masterkey, .vs-dark .icon.masterkey, .hc-black .icon.masterkey { - background: url("MasterKey.svg") center center no-repeat; + background: url("MasterKey.svg") center center no-repeat; } .vs .icon.messagetype, .vs-dark .icon.messagetype, .hc-black .icon.messagetype { - background: url("MessageType.svg") center center no-repeat; + background: url("MessageType.svg") center center no-repeat; } .vs .icon.objecttypes.css, .vs-dark .icon.objecttypes.css, .hc-black .icon.objecttypes.css { - background: url("objecttypes.css") center center no-repeat; + background: url("objecttypes.css") center center no-repeat; } .vs .icon.partitionfunction, .vs-dark .icon.partitionfunction, .hc-black .icon.partitionfunction { - background: url("PartitionFunction.svg") center center no-repeat; + background: url("PartitionFunction.svg") center center no-repeat; } .vs .icon.partitionscheme, .vs-dark .icon.partitionscheme, .hc-black .icon.partitionscheme { - background: url("PartitionScheme.svg") center center no-repeat; + background: url("PartitionScheme.svg") center center no-repeat; } .vs .icon.queue, .vs-dark .icon.queue, .hc-black .icon.queue { - background: url("Queue.svg") center center no-repeat; + background: url("Queue.svg") center center no-repeat; } .vs .icon.remoteservicebinding, .vs-dark .icon.remoteservicebinding, .hc-black .icon.remoteservicebinding { - background: url("RemoteServiceBinding.svg") center center no-repeat; + background: url("RemoteServiceBinding.svg") center center no-repeat; } .vs .icon.route, .vs-dark .icon.route, .hc-black .icon.route { - background: url("Route.svg") center center no-repeat; + background: url("Route.svg") center center no-repeat; } .vs .icon.scalarvaluedfunction, .vs-dark .icon.scalarvaluedfunction, .hc-black .icon.scalarvaluedfunction { - background: url("ScalarValuedFunction.svg") center center no-repeat; + background: url("ScalarValuedFunction.svg") center center no-repeat; } .vs .icon.scalarvaluedfunctionparameter_input, .vs-dark .icon.scalarvaluedfunctionparameter_input, .hc-black .icon.scalarvaluedfunctionparameter_input { - background: url("ScalarValuedFunctionParameter_Input.svg") center center no-repeat; + background: url("ScalarValuedFunctionParameter_Input.svg") center center no-repeat; } .vs .icon.scalarvaluedfunctionparameter_output, .vs-dark .icon.scalarvaluedfunctionparameter_output, .hc-black .icon.scalarvaluedfunctionparameter_output { - background: url("ScalarValuedFunctionParameter_Output.svg") center center no-repeat; + background: url("ScalarValuedFunctionParameter_Output.svg") center center no-repeat; } .vs .icon.scalarvaluedfunctionparameter_return, .vs-dark .icon.scalarvaluedfunctionparameter_return, .hc-black .icon.scalarvaluedfunctionparameter_return { - background: url("ScalarValuedFunctionParameter_Return.svg") center center no-repeat; + background: url("ScalarValuedFunctionParameter_Return.svg") center center no-repeat; } .vs .icon.schema, .vs-dark .icon.schema, .hc-black .icon.schema { - background: url("Schema.svg") center center no-repeat; + background: url("Schema.svg") center center no-repeat; } .vs .icon.searchpropertylist, .vs-dark .icon.searchpropertylist, .hc-black .icon.searchpropertylist { - background: url("SearchPropertyList.svg") center center no-repeat; + background: url("SearchPropertyList.svg") center center no-repeat; } .vs .icon.securitypolicy, .vs-dark .icon.securitypolicy, .hc-black .icon.securitypolicy { - background: url("SecurityPolicy.svg") center center no-repeat; + background: url("SecurityPolicy.svg") center center no-repeat; } .vs .icon.sequence, .vs-dark .icon.sequence, .hc-black .icon.sequence { - background: url("Sequence.svg") center center no-repeat; + background: url("Sequence.svg") center center no-repeat; } .vs .icon.server, .vs-dark .icon.server, .hc-black .icon.server { - background: url("Server.svg") center center no-repeat; + background: url("Server.svg") center center no-repeat; } .vs .icon.serverlevelcredential, .vs-dark .icon.serverlevelcredential, .hc-black .icon.serverlevelcredential { - background: url("ServerLevelCredential.svg") center center no-repeat; + background: url("ServerLevelCredential.svg") center center no-repeat; } .vs .icon.serverlevelcryptographicprovider, .vs-dark .icon.serverlevelcryptographicprovider, .hc-black .icon.serverlevelcryptographicprovider { - background: url("ServerLevelCryptographicProvider.svg") center center no-repeat; + background: url("ServerLevelCryptographicProvider.svg") center center no-repeat; } .vs .icon.serverlevelendpoint, .vs-dark .icon.serverlevelendpoint, .hc-black .icon.serverlevelendpoint { - background: url("ServerLevelEndpoint.svg") center center no-repeat; + background: url("ServerLevelEndpoint.svg") center center no-repeat; } .vs .icon.serverlevellinkedserver, .vs-dark .icon.serverlevellinkedserver, .hc-black .icon.serverlevellinkedserver { - background: url("ServerLevelLinkedServer.svg") center center no-repeat; + background: url("ServerLevelLinkedServer.svg") center center no-repeat; } .vs .icon.serverlevellinkedserverlogin, .vs-dark .icon.serverlevellinkedserverlogin, .hc-black .icon.serverlevellinkedserverlogin { - background: url("ServerLevelLinkedServerLogin.svg") center center no-repeat; + background: url("ServerLevelLinkedServerLogin.svg") center center no-repeat; } .vs .icon.serverlevellinkedserverlogin_disabled, .vs-dark .icon.serverlevellinkedserverlogin_disabled, .hc-black .icon.serverlevellinkedserverlogin_disabled { - background: url("ServerLevelLinkedServerLogin_Disabled.svg") center center no-repeat; + background: url("ServerLevelLinkedServerLogin_Disabled.svg") center center no-repeat; } .vs .icon.serverlevellogin, .vs-dark .icon.serverlevellogin, .hc-black .icon.serverlevellogin { - background: url("ServerLevelLogin.svg") center center no-repeat; + background: url("ServerLevelLogin.svg") center center no-repeat; } .vs .icon.serverlevellogin_disabled, .vs-dark .icon.serverlevellogin_disabled, .hc-black .icon.serverlevellogin_disabled { - background: url("ServerLevelLogin_Disabled.svg") center center no-repeat; + background: url("ServerLevelLogin_Disabled.svg") center center no-repeat; } .vs .icon.serverlevelserveraudit, .vs-dark .icon.serverlevelserveraudit, .hc-black .icon.serverlevelserveraudit { - background: url("ServerLevelServerAudit.svg") center center no-repeat; + background: url("ServerLevelServerAudit.svg") center center no-repeat; } .vs .icon.serverlevelserverauditspecification, .vs-dark .icon.serverlevelserverauditspecification, .hc-black .icon.serverlevelserverauditspecification { - background: url("ServerLevelServerAuditSpecification.svg") center center no-repeat; + background: url("ServerLevelServerAuditSpecification.svg") center center no-repeat; } .vs .icon.serverlevelserverrole, .vs-dark .icon.serverlevelserverrole, .hc-black .icon.serverlevelserverrole { - background: url("ServerLevelServerRole.svg") center center no-repeat; + background: url("ServerLevelServerRole.svg") center center no-repeat; } .vs .icon.serverlevelservertrigger, .vs-dark .icon.serverlevelservertrigger, .hc-black .icon.serverlevelservertrigger { - background: url("ServerLevelServerTrigger.svg") center center no-repeat; + background: url("ServerLevelServerTrigger.svg") center center no-repeat; } .vs .icon.service, .vs-dark .icon.service, .hc-black .icon.service { - background: url("Service.svg") center center no-repeat; + background: url("Service.svg") center center no-repeat; } .vs .icon.sqllogfile, .vs-dark .icon.sqllogfile, .hc-black .icon.sqllogfile { - background: url("SqlLogFile.svg") center center no-repeat; + background: url("SqlLogFile.svg") center center no-repeat; } .vs .icon.statistic, .vs-dark .icon.statistic, .hc-black .icon.statistic { - background: url("Statistic.svg") center center no-repeat; + background: url("Statistic.svg") center center no-repeat; } .vs .icon.storedprocedure, .vs-dark .icon.storedprocedure, .hc-black .icon.storedprocedure { - background: url("StoredProcedure.svg") center center no-repeat; + background: url("StoredProcedure.svg") center center no-repeat; } .vs .icon.storedprocedureparameter_input, .vs-dark .icon.storedprocedureparameter_input, .hc-black .icon.storedprocedureparameter_input { - background: url("StoredProcedureParameter_Input.svg") center center no-repeat; + background: url("StoredProcedureParameter_Input.svg") center center no-repeat; } .vs .icon.storedprocedureparameter_output, .vs-dark .icon.storedprocedureparameter_output, .hc-black .icon.storedprocedureparameter_output { - background: url("StoredProcedureParameter_Output.svg") center center no-repeat; + background: url("StoredProcedureParameter_Output.svg") center center no-repeat; } .vs .icon.storedprocedureparameter_return, .vs-dark .icon.storedprocedureparameter_return, .hc-black .icon.storedprocedureparameter_return { - background: url("StoredProcedureParameter_Return.svg") center center no-repeat; + background: url("StoredProcedureParameter_Return.svg") center center no-repeat; } .vs .icon.symmetrickey, .vs-dark .icon.symmetrickey, .hc-black .icon.symmetrickey { - background: url("SymmetricKey.svg") center center no-repeat; + background: url("SymmetricKey.svg") center center no-repeat; } .vs .icon.synonym, .vs-dark .icon.synonym, .hc-black .icon.synonym { - background: url("Synonym.svg") center center no-repeat; + background: url("Synonym.svg") center center no-repeat; } .vs .icon.systemapproximatenumeric, .vs-dark .icon.systemapproximatenumeric, .hc-black .icon.systemapproximatenumeric { - background: url("SystemApproximateNumeric.svg") center center no-repeat; + background: url("SystemApproximateNumeric.svg") center center no-repeat; } .vs .icon.systembinarystring, .vs-dark .icon.systembinarystring, .hc-black .icon.systembinarystring { - background: url("SystemBinaryString.svg") center center no-repeat; + background: url("SystemBinaryString.svg") center center no-repeat; } .vs .icon.systemcharacterstring, .vs-dark .icon.systemcharacterstring, .hc-black .icon.systemcharacterstring { - background: url("SystemCharacterString.svg") center center no-repeat; + background: url("SystemCharacterString.svg") center center no-repeat; } .vs .icon.systemclrdatatype, .vs-dark .icon.systemclrdatatype, .hc-black .icon.systemclrdatatype { - background: url("SystemClrDataType.svg") center center no-repeat; + background: url("SystemClrDataType.svg") center center no-repeat; } .vs .icon.systemcontract, .vs-dark .icon.systemcontract, .hc-black .icon.systemcontract { - background: url("SystemContract.svg") center center no-repeat; + background: url("SystemContract.svg") center center no-repeat; } .vs .icon.systemdateandtime, .vs-dark .icon.systemdateandtime, .hc-black .icon.systemdateandtime { - background: url("SystemDateAndTime.svg") center center no-repeat; + background: url("SystemDateAndTime.svg") center center no-repeat; } .vs .icon.systemexactnumeric, .vs-dark .icon.systemexactnumeric, .hc-black .icon.systemexactnumeric { - background: url("SystemExactNumeric.svg") center center no-repeat; + background: url("SystemExactNumeric.svg") center center no-repeat; } .vs .icon.systemmessagetype, .vs-dark .icon.systemmessagetype, .hc-black .icon.systemmessagetype { - background: url("SystemMessageType.svg") center center no-repeat; + background: url("SystemMessageType.svg") center center no-repeat; } .vs .icon.systemotherdatatype, .vs-dark .icon.systemotherdatatype, .hc-black .icon.systemotherdatatype { - background: url("SystemOtherDataType.svg") center center no-repeat; + background: url("SystemOtherDataType.svg") center center no-repeat; } .vs .icon.systemqueue, .vs-dark .icon.systemqueue, .hc-black .icon.systemqueue { - background: url("SystemQueue.svg") center center no-repeat; + background: url("SystemQueue.svg") center center no-repeat; } .vs .icon.systemservice, .vs-dark .icon.systemservice, .hc-black .icon.systemservice { - background: url("SystemService.svg") center center no-repeat; + background: url("SystemService.svg") center center no-repeat; } .vs .icon.systemspatialdatatype, .vs-dark .icon.systemspatialdatatype, .hc-black .icon.systemspatialdatatype { - background: url("SystemSpatialDataType.svg") center center no-repeat; + background: url("SystemSpatialDataType.svg") center center no-repeat; } .vs .icon.systemunicodecharacterstring, .vs-dark .icon.systemunicodecharacterstring, .hc-black .icon.systemunicodecharacterstring { - background: url("SystemUnicodeCharacterString.svg") center center no-repeat; + background: url("SystemUnicodeCharacterString.svg") center center no-repeat; } .vs .icon.tablevaluedfunction, .vs-dark .icon.tablevaluedfunction, .hc-black .icon.tablevaluedfunction { - background: url("TableValuedFunction.svg") center center no-repeat; + background: url("TableValuedFunction.svg") center center no-repeat; } .vs .icon.tablevaluedfunctionparameter_input, .vs-dark .icon.tablevaluedfunctionparameter_input, .hc-black .icon.tablevaluedfunctionparameter_input { - background: url("TableValuedFunctionParameter_Input.svg") center center no-repeat; + background: url("TableValuedFunctionParameter_Input.svg") center center no-repeat; } .vs .icon.tablevaluedfunctionparameter_output, .vs-dark .icon.tablevaluedfunctionparameter_output, .hc-black .icon.tablevaluedfunctionparameter_output { - background: url("TableValuedFunctionParameter_Output.svg") center center no-repeat; + background: url("TableValuedFunctionParameter_Output.svg") center center no-repeat; } .vs .icon.tablevaluedfunctionparameter_return, .vs-dark .icon.tablevaluedfunctionparameter_return, .hc-black .icon.tablevaluedfunctionparameter_return { - background: url("TableValuedFunctionParameter_Return.svg") center center no-repeat; + background: url("TableValuedFunctionParameter_Return.svg") center center no-repeat; } .vs .icon.table_temporal, .vs-dark .icon.table_temporal, .hc-black .icon.table_temporal { - background: url("Table_Temporal.svg") center center no-repeat; + background: url("Table_Temporal.svg") center center no-repeat; } .vs .icon.trigger, .vs-dark .icon.trigger, .hc-black .icon.trigger { - background: url("Trigger.svg") center center no-repeat; + background: url("Trigger.svg") center center no-repeat; } .vs .icon.trigger_disabled, .vs-dark .icon.trigger_disabled, .hc-black .icon.trigger_disabled { - background: url("Trigger_Disabled.svg") center center no-repeat; + background: url("Trigger_Disabled.svg") center center no-repeat; } .vs .icon.user, .vs-dark .icon.user, .hc-black .icon.user { - background: url("User.svg") center center no-repeat; + background: url("User.svg") center center no-repeat; } .vs .icon.user_disabled, .vs-dark .icon.user_disabled, .hc-black .icon.user_disabled { - background: url("User_Disabled.svg") center center no-repeat; + background: url("User_Disabled.svg") center center no-repeat; } .vs .icon.userdefineddatatype, .vs-dark .icon.userdefineddatatype, .hc-black .icon.userdefineddatatype { - background: url("UserDefinedDataType.svg") center center no-repeat; + background: url("UserDefinedDataType.svg") center center no-repeat; } .vs .icon.userdefinedtabletype, .vs-dark .icon.userdefinedtabletype, .hc-black .icon.userdefinedtabletype { - background: url("UserDefinedTableType.svg") center center no-repeat; + background: url("UserDefinedTableType.svg") center center no-repeat; } .vs .icon.userdefinedtabletypecolumn, .vs-dark .icon.userdefinedtabletypecolumn, .hc-black .icon.userdefinedtabletypecolumn { - background: url("UserDefinedTableTypeColumn.svg") center center no-repeat; + background: url("UserDefinedTableTypeColumn.svg") center center no-repeat; } .vs .icon.userdefinedtabletypeconstraint, .vs-dark .icon.userdefinedtabletypeconstraint, .hc-black .icon.userdefinedtabletypeconstraint { - background: url("UserDefinedTableTypeConstraint.svg") center center no-repeat; + background: url("UserDefinedTableTypeConstraint.svg") center center no-repeat; } .vs .icon.userdefinedtype, .vs-dark .icon.userdefinedtype, .hc-black .icon.userdefinedtype { - background: url("UserDefinedType.svg") center center no-repeat; + background: url("UserDefinedType.svg") center center no-repeat; } .vs .icon.view, .vs-dark .icon.view, .hc-black .icon.view { - background: url("View.svg") center center no-repeat; + background: url("View.svg") center center no-repeat; } .vs .icon.xmlschemacollection, .vs-dark .icon.xmlschemacollection, .hc-black .icon.xmlschemacollection { - background: url("XmlSchemaCollection.svg") center center no-repeat; + background: url("XmlSchemaCollection.svg") center center no-repeat; } .vs .icon.filegroup, .vs-dark .icon.filegroup, .hc-black .icon.filegroup { - background: url("DefaultIcon.svg") center center no-repeat; + background: url("DefaultIcon.svg") center center no-repeat; } .vs .icon.securitypolicie, .vs-dark .icon.securitypolicie, .hc-black .icon.securitypolicie { - background: url("DefaultIcon.svg") center center no-repeat; + background: url("DefaultIcon.svg") center center no-repeat; } .vs .icon.historytable, .vs-dark .icon.historytable, .hc-black .icon.historytable { - background: url("DefaultIcon.svg") center center no-repeat; + background: url("DefaultIcon.svg") center center no-repeat; } \ No newline at end of file diff --git a/src/sql/parts/disasterRecovery/backup/backup.component.ts b/src/sql/parts/disasterRecovery/backup/backup.component.ts index 0313748493..0e1d745c12 100644 --- a/src/sql/parts/disasterRecovery/backup/backup.component.ts +++ b/src/sql/parts/disasterRecovery/backup/backup.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!sql/parts/disasterRecovery/backup/media/backupDialog'; diff --git a/src/sql/parts/disasterRecovery/backup/backup.module.ts b/src/sql/parts/disasterRecovery/backup/backup.module.ts index c8416de958..b1d081fb9c 100644 --- a/src/sql/parts/disasterRecovery/backup/backup.module.ts +++ b/src/sql/parts/disasterRecovery/backup/backup.module.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import { ApplicationRef, ComponentFactoryResolver, NgModule, diff --git a/src/sql/parts/disasterRecovery/backup/media/backupDialog.css b/src/sql/parts/disasterRecovery/backup/media/backupDialog.css index e338fcec04..9e28f0e147 100644 --- a/src/sql/parts/disasterRecovery/backup/media/backupDialog.css +++ b/src/sql/parts/disasterRecovery/backup/media/backupDialog.css @@ -2,6 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ + .backup-path-list { overflow-x: auto; } @@ -34,8 +35,8 @@ } .backup-dialog input[type="radio"] { - margin-top: -2px; - vertical-align: middle; + margin-top: -2px; + vertical-align: middle; } .backup-dialog .indent { diff --git a/src/sql/parts/disasterRecovery/restore/restoreDialog.ts b/src/sql/parts/disasterRecovery/restore/restoreDialog.ts index d535a0a1eb..3c73daf600 100644 --- a/src/sql/parts/disasterRecovery/restore/restoreDialog.ts +++ b/src/sql/parts/disasterRecovery/restore/restoreDialog.ts @@ -715,8 +715,8 @@ export class RestoreDialog extends Modal { public dispose(): void { super.dispose(); - for (var key in this._optionsMap) { - var widget: Widget = this._optionsMap[key]; + for (let key in this._optionsMap) { + let widget: Widget = this._optionsMap[key]; widget.dispose(); delete this._optionsMap[key]; } diff --git a/src/sql/parts/disasterRecovery/restore/restoreViewModel.ts b/src/sql/parts/disasterRecovery/restore/restoreViewModel.ts index d364e718b8..18a5fe9edf 100644 --- a/src/sql/parts/disasterRecovery/restore/restoreViewModel.ts +++ b/src/sql/parts/disasterRecovery/restore/restoreViewModel.ts @@ -3,7 +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 DialogHelper from 'sql/workbench/browser/modal/dialogHelper'; import * as types from 'vs/base/common/types'; @@ -189,7 +188,7 @@ export class RestoreViewModel { */ public updateOptionWithPlanDetail(planDetails: { [key: string]: azdata.RestorePlanDetailInfo }): void { if (planDetails) { - for (var key in planDetails) { + for (let key in planDetails) { let optionElement = this._optionsMap[key]; if (optionElement) { let planDetailInfo = planDetails[key]; @@ -219,7 +218,7 @@ export class RestoreViewModel { this.defaultBackupFolder = configInfo['defaultBackupFolder']; } - for (var key in configInfo) { + for (let key in configInfo) { let optionElement = this._optionsMap[key]; if (optionElement) { let planDetailInfo = configInfo[key]; @@ -258,7 +257,7 @@ export class RestoreViewModel { this.updateLastBackupTaken(''); this.databaseList = []; this.selectedBackupSets = null; - for (var key in this._optionsMap) { + for (let key in this._optionsMap) { this._optionsMap[key].defaultValue = this.getDisplayValue(this._optionsMap[key].optionMetadata, this._optionsMap[key].optionMetadata.defaultValue); this._optionsMap[key].currentValue = this._optionsMap[key].defaultValue; this._onSetRestoreOption.fire({ optionName: key, value: this._optionsMap[key].defaultValue, isReadOnly: false }); @@ -296,4 +295,4 @@ export class RestoreViewModel { this.targetDatabaseName = value; this._onSetTargetDatabaseName.fire(value); } -} \ No newline at end of file +} diff --git a/src/sql/parts/editData/editor/editDataResultsEditor.ts b/src/sql/parts/editData/editor/editDataResultsEditor.ts index 49bbf96c9d..c0d53d9280 100644 --- a/src/sql/parts/editData/editor/editDataResultsEditor.ts +++ b/src/sql/parts/editData/editor/editDataResultsEditor.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import * as DOM from 'vs/base/browser/dom'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/sql/parts/jobManagement/common/media/detailview.css b/src/sql/parts/jobManagement/common/media/detailview.css index bc2c1d80ca..115724e0c6 100644 --- a/src/sql/parts/jobManagement/common/media/detailview.css +++ b/src/sql/parts/jobManagement/common/media/detailview.css @@ -1,39 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + .detailView-toggle { - display: inline-block; - cursor: pointer; + display: inline-block; + cursor: pointer; } .detailView-toggle.expand { - height: 20px; - width: 20px; - background: url(../images/arrow-right.gif) no-repeat center center; + height: 20px; + width: 20px; + background: url(../images/arrow-right.gif) no-repeat center center; } .detailView-toggle.collapse { - height: 20px; - width: 20px; - background: url(../images/sort-desc.gif) no-repeat center center; + height: 20px; + width: 20px; + background: url(../images/sort-desc.gif) no-repeat center center; } .dynamic-cell-detail { - z-index: 10000; - position: absolute; - background-color: #dae5e8; - margin: 0; - padding: 0; - width: 100%; - overflow: auto; + z-index: 10000; + position: absolute; + background-color: #dae5e8; + margin: 0; + padding: 0; + width: 100%; + overflow: auto; } .dynamic-cell-detail > :first-child { - vertical-align: middle; - line-height: 13px; + vertical-align: middle; + line-height: 13px; } .dynamic-cell-detail > .detail-container { - overflow: auto; - display: block !important; + overflow: auto; + display: block !important; } diff --git a/src/sql/parts/jobManagement/common/media/jobs.css b/src/sql/parts/jobManagement/common/media/jobs.css index 27162b976d..ef31240415 100644 --- a/src/sql/parts/jobManagement/common/media/jobs.css +++ b/src/sql/parts/jobManagement/common/media/jobs.css @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - agentview-component { +agentview-component { height: 100%; width : 100%; display: block; @@ -22,23 +22,23 @@ jobhistory-component { } .job-heading-container { - height: 50px; - border-bottom: 3px solid #f4f4f4; - display: -webkit-box; + height: 50px; + border-bottom: 3px solid #f4f4f4; + display: -webkit-box; } .vs-dark .job-heading-container { - border-bottom: 3px solid #444444; + border-bottom: 3px solid #444444; } .hc-black .job-heading-container { - border-bottom: 3px solid #2b56f2; + border-bottom: 3px solid #2b56f2; } .jobview-grid { - height: calc(100% - 75px); + height: calc(100% - 75px); width : 100%; - display: block; + display: block; } .vs-dark #agentViewDiv .slick-header-column { @@ -47,134 +47,134 @@ jobhistory-component { #agentViewDiv .slick-header-column { background-color: transparent !important; - border: 0px !important; - font-weight: bold; + border: 0px !important; + font-weight: bold; } .hc-black #jobsDiv jobsview-component .jobview-grid .grid-canvas .ui-widget-content.slick-row .slick-cell { - border: 1px solid #2b56f2; + border: 1px solid #2b56f2; } #jobsDiv jobsview-component .jobview-grid .grid-canvas .ui-widget-content.slick-row .slick-cell { - border-right: transparent !important; - border-left: transparent !important; - line-height: 33px !important; + border-right: transparent !important; + border-left: transparent !important; + line-height: 33px !important; } #jobsDiv .jobview-joblist { - height: 100%; - width: 100%; + height: 100%; + width: 100%; } #jobsDiv .jobview-jobnametable { - border: 0px; - width: 100%; - height: 100%; + border: 0px; + width: 100%; + height: 100%; } #jobsDiv .jobview-jobnameindicatorsuccess { - width: 5px; - background: green; + width: 5px; + background: green; } #jobsDiv .slick-cell.l1.r1 .jobview-jobnameindicatorfailure { - width: 5px; - background: red; + width: 5px; + background: red; } #jobsDiv .jobview-jobnameindicatorcancel { - width: 5px; - background: orange; + width: 5px; + background: orange; } #jobsDiv .jobview-grid .jobview-jobnameindicatorunknown { - width: 5px; - background: grey; + width: 5px; + background: grey; } #jobsDiv .jobview-grid .slick-cell.l1.r1.error-row .jobview-jobnametext { - width: 100%; + width: 100%; } #jobsDiv .jobview-grid .slick-cell.l1.r1 .jobview-jobnametext { - text-overflow: ellipsis; - width: 250px; - overflow: hidden; - white-space: nowrap; - display: inline-block; + text-overflow: ellipsis; + width: 250px; + overflow: hidden; + white-space: nowrap; + display: inline-block; } #operatorsDiv .joboperatorsview-grid .slick-cell.l1.r1 .operatorview-operatornametext, #alertsDiv .jobalertsview-grid .slick-cell.l1.r1 .alertview-alertnametext, #proxiesDiv .jobproxiesview-grid .slick-cell.l1.r1 .proxyview-proxynametext { - text-overflow: ellipsis; - width: 100%; - overflow: hidden; - white-space: nowrap; - display: inline-block; + text-overflow: ellipsis; + width: 100%; + overflow: hidden; + white-space: nowrap; + display: inline-block; } #jobsDiv .job-with-error { - border-bottom: none; + border-bottom: none; } .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row .slick-cell.l1.r1.error-row { - width: 100%; - opacity: 1; - font-weight: 700; - color: orangered; + width: 100%; + opacity: 1; + font-weight: 700; + color: orangered; } .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row .slick-cell._detail_selector.error-row { - opacity: 1; + opacity: 1; } #jobsDiv .jobview-splitter { - height: 1px; - width: 100%; - background-color: gray; + height: 1px; + width: 100%; + background-color: gray; } #jobsDiv .jobview-jobitem { - display: flex; - flex-direction: row; - flex-wrap: nowrap; - flex-flow: row wrap; - white-space: nowrap; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + flex-flow: row wrap; + white-space: nowrap; } #jobsDiv .jobview-label { - padding-bottom: 10px; - padding-top: 10px; + padding-bottom: 10px; + padding-top: 10px; } #jobsDiv .jobview-highlight-none { - width: 5px; - margin-right: 10px; + width: 5px; + margin-right: 10px; } #jobsDiv .detail-container { - max-height: 100px !important; - line-height: 20px; + max-height: 100px !important; + line-height: 20px; } #jobsDiv .detail { - padding: 5px + padding: 5px } #jobsDiv .preload { - font-size: 13px; + font-size: 13px; } #jobsDiv .dynamic-cell-detail > :first-child { - vertical-align: middle; - line-height: 13px; - padding: 10px; - margin-left: 20px; + vertical-align: middle; + line-height: 13px; + padding: 10px; + margin-left: 20px; } .jobsview-icon { - background-image: url('./job.svg'); + background-image: url('./job.svg'); } .vs-dark .jobsview-icon, @@ -183,7 +183,7 @@ jobhistory-component { } .alertsview-icon { - background-image: url('./alert.svg'); + background-image: url('./alert.svg'); } .vs-dark .alertsview-icon, @@ -192,7 +192,7 @@ jobhistory-component { } .proxiesview-icon { - background-image: url('./proxy.svg'); + background-image: url('./proxy.svg'); } .vs-dark .proxiesview-icon, @@ -201,7 +201,7 @@ jobhistory-component { } .operatorsview-icon { - background-image: url('./operator.svg'); + background-image: url('./operator.svg'); } .vs-dark .operatorsview-icon, @@ -211,88 +211,88 @@ jobhistory-component { agentview-component .jobview-grid .grid-canvas > .ui-widget-content.slick-row.even > .slick-cell, agentview-component .jobview-grid .grid-canvas > .ui-widget-content.slick-row.odd > .slick-cell { - cursor: pointer; + cursor: pointer; } .vs-dark .jobview-grid > .monaco-table .slick-header-columns .slick-resizable-handle { - border-left: 1px dotted white; + border-left: 1px dotted white; } .hc-black .jobview-grid > .monaco-table .slick-header-columns .slick-resizable-handle { - border-left: 1px dotted #2b56f2; + border-left: 1px dotted #2b56f2; } .jobview-grid > .monaco-table .slick-header-columns .slick-resizable-handle { - border-left: 1px dotted #444444; + border-left: 1px dotted #444444; } .job-heading-container > .icon.in-progress { - height: 20px; - width: 20px; - padding-top: 16px; - padding-left: 15px; + height: 20px; + width: 20px; + padding-top: 16px; + padding-left: 15px; } #jobsDiv jobsview-component .jobview-grid .slick-cell.l1.r1.error-row td.jobview-jobnameindicatorfailure { - width: 0; - background: none; + width: 0; + background: none; } #jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row:hover > .slick-cell, #jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row.hovered > .slick-cell, #jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row> .slick-cell.hovered { - background: #dcdcdc !important; + background: #dcdcdc !important; } .vs-dark #jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row:hover > .slick-cell, .vs-dark #jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row > .slick-cell.hovered, .vs-dark #jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row.hovered > .slick-cell { - background: #444444 !important; + background: #444444 !important; } .hc-black #jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row:hover > .slick-cell, .hc-black #jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row > .slick-cell.hovered, .hc-black #jobsDiv .jobview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row.hovered > .slick-cell { - background: none !important; + background: none !important; } table.jobprevruns div.bar0, table.jobprevruns div.bar1, table.jobprevruns div.bar2, table.jobprevruns div.bar3, table.jobprevruns div.bar4, table.jobprevruns div.bar5 { - padding-top: 3px; - padding-left: 5px; + padding-top: 3px; + padding-left: 5px; width: 10px; } .jobview-grid .slick-cell.l10.r10 { - text-align: center; - display: inline-flex; + text-align: center; + display: inline-flex; } table.jobprevruns { - height: 100%; + height: 100%; } table.jobprevruns > tbody { - vertical-align: bottom; + vertical-align: bottom; } #alertsDiv .jobalertsview-grid { - height: calc(100% - 75px); + height: calc(100% - 75px); width : 100%; - display: block; + display: block; } #operatorsDiv .joboperatorsview-grid { - height: calc(100% - 75px); + height: calc(100% - 75px); width : 100%; - display: block; - overflow: scroll; + display: block; + overflow: scroll; } #proxiesDiv .jobproxiesview-grid { - height: calc(100% - 75px); + height: calc(100% - 75px); width : 100%; - display: block; + display: block; } .vs .action-label.icon.refreshIcon { @@ -309,108 +309,108 @@ table.jobprevruns > tbody { } jobsview-component .jobview-grid .slick-cell.error-row { - opacity: 0; + opacity: 0; } #alertsDiv jobalertsview-component .jobalertsview-grid .grid-canvas .ui-widget-content.slick-row .slick-cell { - border-right: transparent !important; - border-left: transparent !important; - line-height: 33px !important; + border-right: transparent !important; + border-left: transparent !important; + line-height: 33px !important; } #alertsDiv .jobalertsview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row:hover > .slick-cell, #alertsDiv .jobalertsview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row.hovered > .slick-cell, #alertsDiv .jobalertsview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row> .slick-cell.hovered { - background: #dcdcdc !important; + background: #dcdcdc !important; } .vs-dark #alertsDiv .jobalertsview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row:hover > .slick-cell, .vs-dark #alertsDiv .jobalertsview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row > .slick-cell.hovered, .vs-dark #alertsDiv .jobalertsview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row.hovered > .slick-cell { - background: #444444 !important; + background: #444444 !important; } .vs-dark .jobalertsview-grid > .monaco-table .slick-header-columns .slick-resizable-handle { - border-left: 1px dotted white; + border-left: 1px dotted white; } .jobalertsview-grid > .monaco-table .slick-header-columns .slick-resizable-handle { - border-left: 1px dotted #444444; + border-left: 1px dotted #444444; } #operatorsDiv joboperatorsview-component .joboperatorsview-grid .grid-canvas .ui-widget-content.slick-row .slick-cell { - border-right: transparent !important; - border-left: transparent !important; - line-height: 33px !important; + border-right: transparent !important; + border-left: transparent !important; + line-height: 33px !important; } #operatorsDiv .joboperatorsview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row:hover > .slick-cell, #operatorsDiv .joboperatorsview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row.hovered > .slick-cell, #operatorsDiv .joboperatorsview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row> .slick-cell.hovered { - background: #dcdcdc !important; + background: #dcdcdc !important; } .vs-dark #operatorsDiv .joboperatorsview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row:hover > .slick-cell, .vs-dark #operatorsDiv .joboperatorsview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row > .slick-cell.hovered, .vs-dark #operatorsDiv .joboperatorsview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row.hovered > .slick-cell { - background: #444444 !important; + background: #444444 !important; } .vs-dark .joboperatorsview-grid > .monaco-table .slick-header-columns .slick-resizable-handle { - border-left: 1px dotted white; + border-left: 1px dotted white; } .joboperatorsview-grid > .monaco-table .slick-header-columns .slick-resizable-handle { - border-left: 1px dotted #444444; + border-left: 1px dotted #444444; } #proxiesDiv jobproxiesview-component .jobproxiesview-grid .grid-canvas .ui-widget-content.slick-row .slick-cell { - border-right: transparent !important; - border-left: transparent !important; - line-height: 33px !important; + border-right: transparent !important; + border-left: transparent !important; + line-height: 33px !important; } #proxiesDiv .jobproxiesview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row:hover > .slick-cell, #proxiesDiv .jobproxiesview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row.hovered > .slick-cell, #proxiesDiv .jobproxiesview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row> .slick-cell.hovered { - background: #dcdcdc !important; + background: #dcdcdc !important; } .vs-dark #proxiesDiv .jobproxiesview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row:hover > .slick-cell, .vs-dark #proxiesDiv .jobproxiesview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row > .slick-cell.hovered, .vs-dark #proxiesDiv .jobproxiesview-grid > .monaco-table .slick-viewport > .grid-canvas > .ui-widget-content.slick-row.hovered > .slick-cell { - background: #444444 !important; + background: #444444 !important; } .vs-dark .jobproxiesview-grid > .monaco-table .slick-header-columns .slick-resizable-handle { - border-left: 1px dotted white; + border-left: 1px dotted white; } .jobproxiesview-grid > .monaco-table .slick-header-columns .slick-resizable-handle { - border-left: 1px dotted #444444; + border-left: 1px dotted #444444; } .overview-container > .overview-tab > label { - margin-bottom: 0px; + margin-bottom: 0px; } #operatorsDiv .operatorview-operatornameindicatorenabled, #alertsDiv .alertview-alertnameindicatorenabled, #proxiesDiv .proxyview-proxynameindicatorenabled { - width: 5px; - background: green; + width: 5px; + background: green; } #operatorsDiv .operatorview-operatornameindicatordisabled, #alertsDiv .alertview-alertnameindicatordisabled, #proxiesDiv .proxyview-proxynameindicatordisabled { - width: 5px; - background: red; + width: 5px; + background: red; } #jobsDiv jobsview-component .monaco-toolbar.carbon-taskbar, #operatorsDiv joboperatorsview-component .monaco-toolbar.carbon-taskbar, #alertsDiv jobalertsview-component .monaco-toolbar.carbon-taskbar, #proxiesDiv jobproxiesview-component .monaco-toolbar.carbon-taskbar { - margin: 10px 0px 10px 0px; + margin: 10px 0px 10px 0px; } \ No newline at end of file diff --git a/src/sql/parts/jobManagement/views/jobHistory.component.html b/src/sql/parts/jobManagement/views/jobHistory.component.html index cecebd7964..d47a2986bc 100644 --- a/src/sql/parts/jobManagement/views/jobHistory.component.html +++ b/src/sql/parts/jobManagement/views/jobHistory.component.html @@ -5,28 +5,28 @@ *--------------------------------------------------------------------------------------------*/ -->
-

Jobs | {{this._agentJobInfo?.name}}

-
+

Jobs | {{this._agentJobInfo?.name}}

+
- -
+ +
All Jobs -
+
-
-
- - -
- +
+
+ + +
+
-
Category: @@ -69,9 +69,9 @@ {{this._agentJobInfo?.nextRun}}
-
-
+ +
+
@@ -161,4 +161,4 @@

No Steps Available

- + \ No newline at end of file diff --git a/src/sql/parts/jobManagement/views/jobManagementView.ts b/src/sql/parts/jobManagement/views/jobManagementView.ts index efb7bd2de4..0b0d7f6420 100644 --- a/src/sql/parts/jobManagement/views/jobManagementView.ts +++ b/src/sql/parts/jobManagement/views/jobManagementView.ts @@ -96,7 +96,7 @@ export abstract class JobManagementView extends TabChild implements AfterContent } protected _keybindingFor(action: IAction): ResolvedKeybinding { - var [kb] = this._keybindingService.lookupKeybindings(action.id); + let [kb] = this._keybindingService.lookupKeybindings(action.id); return kb; } diff --git a/src/sql/parts/modelComponents/card.css b/src/sql/parts/modelComponents/card.css index c69b9e705b..379e524ce8 100644 --- a/src/sql/parts/modelComponents/card.css +++ b/src/sql/parts/modelComponents/card.css @@ -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. + *--------------------------------------------------------------------------------------------*/ + .model-card { position: relative; display: inline-block; diff --git a/src/sql/parts/modelComponents/componentBase.ts b/src/sql/parts/modelComponents/componentBase.ts index 2b90319169..d5029895c3 100644 --- a/src/sql/parts/modelComponents/componentBase.ts +++ b/src/sql/parts/modelComponents/componentBase.ts @@ -72,7 +72,7 @@ export abstract class ComponentBase extends Disposable implements IComponent, On abstract setLayout(layout: any): void; - getHtml(): any{ + getHtml(): any { return this._el.nativeElement; } diff --git a/src/sql/parts/modelComponents/declarativeTable.css b/src/sql/parts/modelComponents/declarativeTable.css index a09223aa17..7c1069e80d 100644 --- a/src/sql/parts/modelComponents/declarativeTable.css +++ b/src/sql/parts/modelComponents/declarativeTable.css @@ -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. + *--------------------------------------------------------------------------------------------*/ .declarative-table { padding: 5px 30px 0px 30px; @@ -5,9 +9,6 @@ border-collapse: collapse; } -.declarative-table-row { -} - .declarative-table-header { padding: 5px; border: 1px solid gray; diff --git a/src/sql/parts/modelComponents/divContainer.css b/src/sql/parts/modelComponents/divContainer.css index 16f0d4ffa0..fa60cfdcb4 100644 --- a/src/sql/parts/modelComponents/divContainer.css +++ b/src/sql/parts/modelComponents/divContainer.css @@ -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. + *--------------------------------------------------------------------------------------------*/ .divContainer { display: block; diff --git a/src/sql/parts/modelComponents/editor.css b/src/sql/parts/modelComponents/editor.css index 250ab7314d..2e2b8ae6db 100644 --- a/src/sql/parts/modelComponents/editor.css +++ b/src/sql/parts/modelComponents/editor.css @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - modelview-editor-component { +modelview-editor-component { height: 100%; width : 100%; display: block; diff --git a/src/sql/parts/modelComponents/flexContainer.css b/src/sql/parts/modelComponents/flexContainer.css index 3a74541fee..2efe1eff75 100644 --- a/src/sql/parts/modelComponents/flexContainer.css +++ b/src/sql/parts/modelComponents/flexContainer.css @@ -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. + *--------------------------------------------------------------------------------------------*/ .flexContainer { display: flex; diff --git a/src/sql/parts/modelComponents/formLayout.css b/src/sql/parts/modelComponents/formLayout.css index c4a4d216fb..18a63079bb 100644 --- a/src/sql/parts/modelComponents/formLayout.css +++ b/src/sql/parts/modelComponents/formLayout.css @@ -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. + *--------------------------------------------------------------------------------------------*/ .form-table { display: table; diff --git a/src/sql/parts/modelComponents/groupLayout.css b/src/sql/parts/modelComponents/groupLayout.css index 7ee9dedbf4..a4727ad631 100644 --- a/src/sql/parts/modelComponents/groupLayout.css +++ b/src/sql/parts/modelComponents/groupLayout.css @@ -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. + *--------------------------------------------------------------------------------------------*/ .modelview-group-container { display: table; diff --git a/src/sql/parts/modelComponents/interfaces.ts b/src/sql/parts/modelComponents/interfaces.ts index 1931bbcef6..ea99f6a621 100644 --- a/src/sql/parts/modelComponents/interfaces.ts +++ b/src/sql/parts/modelComponents/interfaces.ts @@ -12,7 +12,6 @@ import { IDisposable } from 'vs/base/common/lifecycle'; * An instance of a model-backed component. This will be a UI element * * @export - * @interface IComponent */ export interface IComponent extends IDisposable { descriptor: IComponentDescriptor; @@ -44,7 +43,6 @@ export interface IComponentConfig { * world to the frontend UI; * * @export - * @interface IComponentDescriptor */ export interface IComponentDescriptor { /** @@ -91,9 +89,8 @@ export interface IModelStore { * Runs on a component immediately if the component exists, or runs on * registration of the component otherwise * - * @param {string} componentId unique identifier of the component - * @param {(component: IComponent) => void} action some action to perform - * @memberof IModelStore + * @param componentId unique identifier of the component + * @param action some action to perform */ eventuallyRunOnComponent(componentId: string, action: (component: IComponent) => T): Promise; /** diff --git a/src/sql/parts/modelComponents/loadingComponent.css b/src/sql/parts/modelComponents/loadingComponent.css index a3e44083f9..7eff7a778a 100644 --- a/src/sql/parts/modelComponents/loadingComponent.css +++ b/src/sql/parts/modelComponents/loadingComponent.css @@ -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. + *--------------------------------------------------------------------------------------------*/ + .modelview-loadingComponent-container { display: flex; flex-direction: row; diff --git a/src/sql/parts/modelComponents/markdown.css b/src/sql/parts/modelComponents/markdown.css index 42d02e5c18..186bf93c5b 100644 --- a/src/sql/parts/modelComponents/markdown.css +++ b/src/sql/parts/modelComponents/markdown.css @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - modelview-dom-component { +modelview-dom-component { font-family: "Segoe WPC", "Segoe UI", "SFUIText-Light", "HelveticaNeue-Light", sans-serif, "Droid Sans Fallback"; font-size: 14px; padding: 0 26px; diff --git a/src/sql/parts/modelComponents/modelStore.ts b/src/sql/parts/modelComponents/modelStore.ts index 739391aae2..57ca5d0a40 100644 --- a/src/sql/parts/modelComponents/modelStore.ts +++ b/src/sql/parts/modelComponents/modelStore.ts @@ -1,21 +1,12 @@ - /*--------------------------------------------------------------------------------------------- * 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 { Registry } from 'vs/platform/registry/common/platform'; - -import * as azdata from 'azdata'; import { IModelStore, IComponentDescriptor, IComponent } from './interfaces'; -import { Extensions, IComponentRegistry } from 'sql/platform/dashboard/common/modelComponentRegistry'; import { Deferred } from 'sql/base/common/promise'; import { entries } from 'sql/base/common/objects'; -const componentRegistry = Registry.as(Extensions.ComponentContribution); - - class ComponentDescriptor implements IComponentDescriptor { constructor(public readonly id: string, public readonly type: string) { diff --git a/src/sql/parts/modelComponents/modelViewContent.component.ts b/src/sql/parts/modelComponents/modelViewContent.component.ts index c02c42ad60..643de0adb6 100644 --- a/src/sql/parts/modelComponents/modelViewContent.component.ts +++ b/src/sql/parts/modelComponents/modelViewContent.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ // import 'vs/css!./modelViewContent'; import { Component, forwardRef, Input, OnInit, Inject, ChangeDetectorRef } from '@angular/core'; diff --git a/src/sql/parts/modelComponents/queryTextEditor.ts b/src/sql/parts/modelComponents/queryTextEditor.ts index 39ddfc39d7..016ed0e257 100644 --- a/src/sql/parts/modelComponents/queryTextEditor.ts +++ b/src/sql/parts/modelComponents/queryTextEditor.ts @@ -104,7 +104,7 @@ export class QueryTextEditor extends BaseTextEditor { return nls.localize('queryTextEditorAriaLabel', 'modelview code editor for view model.'); } - public layout(dimension?: DOM.Dimension){ + public layout(dimension?: DOM.Dimension) { if (dimension) { this._dimension = dimension; } @@ -175,11 +175,11 @@ export class QueryTextEditor extends BaseTextEditor { this.setHeight(editorHeightUsingMinHeight); } - public setMinimumHeight(height: number) : void { + public setMinimumHeight(height: number): void { this._minHeight = height; } - public setMaximumHeight(height: number) : void { + public setMaximumHeight(height: number): void { this._maxHeight = height; } diff --git a/src/sql/parts/modelComponents/radioButton.css b/src/sql/parts/modelComponents/radioButton.css index 249838444d..759c362e22 100644 --- a/src/sql/parts/modelComponents/radioButton.css +++ b/src/sql/parts/modelComponents/radioButton.css @@ -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. + *--------------------------------------------------------------------------------------------*/ + .modelview-radiobutton-container { align-items: flex-start; } @@ -5,7 +10,3 @@ .modelview-radiobutton-item { align-self: flex-start ; } - -.modelview-radiobutton-title { - -} \ No newline at end of file diff --git a/src/sql/parts/modelComponents/splitviewContainer.component.ts b/src/sql/parts/modelComponents/splitviewContainer.component.ts index 45d12852ad..c2830efe24 100644 --- a/src/sql/parts/modelComponents/splitviewContainer.component.ts +++ b/src/sql/parts/modelComponents/splitviewContainer.component.ts @@ -5,15 +5,14 @@ import 'vs/css!./flexContainer'; import { - Component, Input, Inject, ChangeDetectorRef, forwardRef, ComponentFactoryResolver, - ViewChild, ViewChildren, ElementRef, Injector, OnDestroy, QueryList, + Component, Input, Inject, ChangeDetectorRef, forwardRef, ElementRef, OnDestroy, } from '@angular/core'; import { IComponent, IComponentDescriptor, IModelStore } from 'sql/parts/modelComponents/interfaces'; import { FlexItemLayout, SplitViewLayout } from 'azdata'; import { FlexItem } from './flexContainer.component'; import { ContainerBase, ComponentBase } from 'sql/parts/modelComponents/componentBase'; -import { Event, Emitter } from 'vs/base/common/event'; +import { Event } from 'vs/base/common/event'; import { SplitView, Orientation, Sizing, IView } from 'vs/base/browser/ui/splitview/splitview'; class SplitPane implements IView { @@ -91,7 +90,7 @@ export default class SplitViewContainer extends ContainerBase im let basicView: SplitPane = new SplitPane(); basicView.orientation = orientation; basicView.element = c.getHtml(), - basicView.component = c; + basicView.component = c; basicView.minimumSize = 50; basicView.maximumSize = Number.MAX_VALUE; return basicView; @@ -113,7 +112,7 @@ export default class SplitViewContainer extends ContainerBase im if (this._componentWrappers) { this._componentWrappers.forEach(item => { - var component = item.modelStore.getComponent(item.descriptor.id); + let component = item.modelStore.getComponent(item.descriptor.id); item.modelStore.validate(component).then(value => { if (value === true) { let view = this.GetCorrespondingView(component, this._orientation); diff --git a/src/sql/parts/modelComponents/tree/treeComponent.css b/src/sql/parts/modelComponents/tree/treeComponent.css index f6efa2011c..a6785ee824 100644 --- a/src/sql/parts/modelComponents/tree/treeComponent.css +++ b/src/sql/parts/modelComponents/tree/treeComponent.css @@ -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. + *--------------------------------------------------------------------------------------------*/ + .tree-component-node-tile { display: flex; } diff --git a/src/sql/parts/modelComponents/viewBase.ts b/src/sql/parts/modelComponents/viewBase.ts index b59faad4e2..ccb091b76f 100644 --- a/src/sql/parts/modelComponents/viewBase.ts +++ b/src/sql/parts/modelComponents/viewBase.ts @@ -1,9 +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 { ChangeDetectorRef } from '@angular/core'; import { Registry } from 'vs/platform/registry/common/platform'; diff --git a/src/sql/parts/modelComponents/webview.css b/src/sql/parts/modelComponents/webview.css index ecdd297dc5..c7e5ed01f7 100644 --- a/src/sql/parts/modelComponents/webview.css +++ b/src/sql/parts/modelComponents/webview.css @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - modelview-webview-component { +modelview-webview-component { height: 100%; width : 100%; display: block; diff --git a/src/sql/parts/profiler/dialog/media/profilerFilterDialog.css b/src/sql/parts/profiler/dialog/media/profilerFilterDialog.css index fd75b3c2b4..566d115bc6 100644 --- a/src/sql/parts/profiler/dialog/media/profilerFilterDialog.css +++ b/src/sql/parts/profiler/dialog/media/profilerFilterDialog.css @@ -2,7 +2,8 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - .profiler-filter-dialog { + +.profiler-filter-dialog { height: 300px; padding: 10px; overflow-y: scroll; diff --git a/src/sql/parts/profiler/dialog/profilerFilterDialog.ts b/src/sql/parts/profiler/dialog/profilerFilterDialog.ts index 489ad10345..d8bb9f28ca 100644 --- a/src/sql/parts/profiler/dialog/profilerFilterDialog.ts +++ b/src/sql/parts/profiler/dialog/profilerFilterDialog.ts @@ -263,7 +263,7 @@ export class ProfilerFilterDialog extends Modal { case NotStartsWith: return ProfilerFilterClauseOperator.NotStartsWith; default: - throw `Not a valid operator: ${operator}`; + throw new Error(`Not a valid operator: ${operator}`); } } @@ -294,7 +294,7 @@ export class ProfilerFilterDialog extends Modal { case ProfilerFilterClauseOperator.NotStartsWith: return NotStartsWith; default: - throw `Not a valid operator: ${operator}`; + throw new Error(`Not a valid operator: ${operator}`); } } } diff --git a/src/sql/parts/profiler/service/profilerFilter.ts b/src/sql/parts/profiler/service/profilerFilter.ts index ff821dd595..4c63a7d2fb 100644 --- a/src/sql/parts/profiler/service/profilerFilter.ts +++ b/src/sql/parts/profiler/service/profilerFilter.ts @@ -27,8 +27,8 @@ function matches(item: any, clauses: ProfilerFilterClause[]): boolean { let expectedValueString: string = expectedValue === undefined ? undefined : expectedValue.toLocaleLowerCase(); let actualValueDate = new Date(actualValue).valueOf(); let expectedValueDate = new Date(expectedValue).valueOf(); - let actualValueNumber = new Number(actualValue).valueOf(); - let expectedValueNumber = new Number(expectedValue).valueOf(); + let actualValueNumber = Number(actualValue).valueOf(); + let expectedValueNumber = Number(expectedValue).valueOf(); if (isValidNumber(actualValue) && isValidNumber(expectedValue)) { actualValue = actualValueNumber; @@ -79,7 +79,7 @@ function matches(item: any, clauses: ProfilerFilterClause[]): boolean { match = !actualValueString || !actualValueString.startsWith(expectedValueString); break; default: - throw `Not a valid operator: ${clause.operator}`; + throw new Error(`Not a valid operator: ${clause.operator}`); } } @@ -93,7 +93,7 @@ function matches(item: any, clauses: ProfilerFilterClause[]): boolean { } function isValidNumber(value: string): boolean { - let num = new Number(value); + let num = Number(value); return value !== undefined && !isNaN(num.valueOf()) && value.replace(' ', '') !== ''; } diff --git a/src/sql/parts/query/common/queryInput.ts b/src/sql/parts/query/common/queryInput.ts index 6b25bfa961..d5ea518648 100644 --- a/src/sql/parts/query/common/queryInput.ts +++ b/src/sql/parts/query/common/queryInput.ts @@ -173,7 +173,7 @@ export class QueryInput extends EditorInput implements IEncodingSupport, IConnec let profile = this._connectionManagementService.getConnectionProfile(this.uri); let title = ''; if (this._description && this._description !== '') { - title = this._description + ' '; + title = this._description + ' '; } if (profile) { if (profile.userName) { @@ -184,7 +184,7 @@ export class QueryInput extends EditorInput implements IEncodingSupport, IConnec } else { title += localize('disconnected', 'disconnected'); } - return this._sql.getName() + (longForm ? (' - ' + title) : ` - ${trimTitle(title)}`); + return this._sql.getName() + (longForm ? (' - ' + title) : ` - ${trimTitle(title)}`); } else { return this._sql.getName(); } diff --git a/src/sql/parts/query/editor/actions.ts b/src/sql/parts/query/editor/actions.ts index a41ef11d80..53f371e12b 100644 --- a/src/sql/parts/query/editor/actions.ts +++ b/src/sql/parts/query/editor/actions.ts @@ -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 { Action } from 'vs/base/common/actions'; import { localize } from 'vs/nls'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; @@ -150,8 +147,7 @@ export class CopyAllMessagesAction extends Action { constructor( private tree: ITree, - @IClipboardService private clipboardService: IClipboardService) - { + @IClipboardService private clipboardService: IClipboardService) { super(CopyAllMessagesAction.ID, CopyAllMessagesAction.LABEL); } diff --git a/src/sql/parts/query/editor/charting/chartTab.ts b/src/sql/parts/query/editor/charting/chartTab.ts index 25e31c80da..d2ff3321af 100644 --- a/src/sql/parts/query/editor/charting/chartTab.ts +++ b/src/sql/parts/query/editor/charting/chartTab.ts @@ -3,14 +3,11 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { IPanelTab } from 'sql/base/browser/ui/panel/panel'; import { ChartView } from './chartView'; import QueryRunner from 'sql/platform/query/common/queryRunner'; import { localize } from 'vs/nls'; -import { generateUuid } from 'vs/base/common/uuid'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; export class ChartTab implements IPanelTab { @@ -18,7 +15,7 @@ export class ChartTab implements IPanelTab { public readonly identifier = 'ChartTab'; public readonly view: ChartView; - constructor( @IInstantiationService instantiationService: IInstantiationService) { + constructor(@IInstantiationService instantiationService: IInstantiationService) { this.view = instantiationService.createInstance(ChartView); } diff --git a/src/sql/parts/query/editor/charting/insights/graphInsight.ts b/src/sql/parts/query/editor/charting/insights/graphInsight.ts index 398e7ee9fd..582527beec 100644 --- a/src/sql/parts/query/editor/charting/insights/graphInsight.ts +++ b/src/sql/parts/query/editor/charting/insights/graphInsight.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { Chart as ChartJs } from 'chart.js'; import { mixin } from 'sql/base/common/objects'; @@ -303,7 +301,7 @@ export class Graph implements IInsight { * color functionality */ -const defaultColors = [ +const defaultColors: Array = [ [255, 99, 132], [54, 162, 235], [255, 206, 86], @@ -318,42 +316,71 @@ const defaultColors = [ [77, 83, 96] ]; +type Color = [number, number, number]; -function rgba(colour, alpha) { +interface ILineColor { + backgroundColor: string; + borderColor: string; + pointBackgroundColor: string; + pointBorderColor: string; + pointHoverBackgroundColor: string; + pointHoverBorderColor: string; +} + +interface IBarColor { + backgroundColor: string; + borderColor: string; + hoverBackgroundColor: string; + hoverBorderColor: string; +} + +interface IPieColors { + backgroundColor: Array; + borderColor: Array; + pointBackgroundColor: Array; + pointBorderColor: Array; + pointHoverBackgroundColor: Array; + pointHoverBorderColor: Array; +} + +interface IPolarAreaColors { + backgroundColor: Array; + borderColor: Array; + hoverBackgroundColor: Array; + hoverBorderColor: Array; +} + +function rgba(colour: Color, alpha: number): string { return 'rgba(' + colour.concat(alpha).join(',') + ')'; } -function getRandomInt(min, max) { +function getRandomInt(min: number, max: number): number { return Math.floor(Math.random() * (max - min + 1)) + min; } -function getRandomColor() { +function getRandomColor(): Color { return [getRandomInt(0, 255), getRandomInt(0, 255), getRandomInt(0, 255)]; } /** * Generate colors for line|bar charts - * @param index - * @returns {number[]|Color} */ -function generateColor(index) { +function generateColor(index: number): Color { return defaultColors[index] || getRandomColor(); } /** * Generate colors for pie|doughnut charts - * @param count - * @returns {Colors} */ -function generateColors(count) { - var colorsArr = new Array(count); - for (var i = 0; i < count; i++) { +function generateColors(count: number): Array { + const colorsArr = new Array(count); + for (let i = 0; i < count; i++) { colorsArr[i] = defaultColors[i] || getRandomColor(); } return colorsArr; } -function formatLineColor(colors) { +function formatLineColor(colors: Color): ILineColor { return { backgroundColor: rgba(colors, 0.4), borderColor: rgba(colors, 1), @@ -364,7 +391,7 @@ function formatLineColor(colors) { }; } -function formatBarColor(colors) { +function formatBarColor(colors: Color): IBarColor { return { backgroundColor: rgba(colors, 0.6), borderColor: rgba(colors, 1), @@ -373,34 +400,30 @@ function formatBarColor(colors) { }; } -function formatPieColors(colors) { +function formatPieColors(colors: Array): IPieColors { return { - backgroundColor: colors.map(function (color) { return rgba(color, 0.6); }), - borderColor: colors.map(function () { return '#fff'; }), - pointBackgroundColor: colors.map(function (color) { return rgba(color, 1); }), - pointBorderColor: colors.map(function () { return '#fff'; }), - pointHoverBackgroundColor: colors.map(function (color) { return rgba(color, 1); }), - pointHoverBorderColor: colors.map(function (color) { return rgba(color, 1); }) + backgroundColor: colors.map(color => rgba(color, 0.6)), + borderColor: colors.map(() => '#fff'), + pointBackgroundColor: colors.map(color => rgba(color, 1)), + pointBorderColor: colors.map(() => '#fff'), + pointHoverBackgroundColor: colors.map(color => rgba(color, 1)), + pointHoverBorderColor: colors.map(color => rgba(color, 1)) }; } -function formatPolarAreaColors(colors) { +function formatPolarAreaColors(colors: Array): IPolarAreaColors { return { - backgroundColor: colors.map(function (color) { return rgba(color, 0.6); }), - borderColor: colors.map(function (color) { return rgba(color, 1); }), - hoverBackgroundColor: colors.map(function (color) { return rgba(color, 0.8); }), - hoverBorderColor: colors.map(function (color) { return rgba(color, 1); }) + backgroundColor: colors.map(color => rgba(color, 0.6)), + borderColor: colors.map(color => rgba(color, 1)), + hoverBackgroundColor: colors.map(color => rgba(color, 0.8)), + hoverBorderColor: colors.map(color => rgba(color, 1)) }; } /** * Generate colors by chart type - * @param chartType - * @param index - * @param count - * @returns {Color} */ -function getColors(chartType, index, count) { +function getColors(chartType: string, index: number, count: number): Color | ILineColor | IBarColor | IPieColors | IPolarAreaColors { if (chartType === 'pie' || chartType === 'doughnut') { return formatPieColors(generateColors(count)); } diff --git a/src/sql/parts/query/editor/charting/insights/interfaces.ts b/src/sql/parts/query/editor/charting/insights/interfaces.ts index d4229faa4a..43e61f5dc4 100644 --- a/src/sql/parts/query/editor/charting/insights/interfaces.ts +++ b/src/sql/parts/query/editor/charting/insights/interfaces.ts @@ -3,7 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; import { Dimension } from 'vs/base/browser/dom'; import { IInsightData } from 'sql/workbench/parts/dashboard/widgets/insights/interfaces'; @@ -35,7 +34,7 @@ export interface IInsight { } export interface IInsightCtor { - new (container: HTMLElement, options: IInsightOptions, ...services: { _serviceBrand: any; }[]): IInsight; + new(container: HTMLElement, options: IInsightOptions, ...services: { _serviceBrand: any; }[]): IInsight; readonly types: Array; } diff --git a/src/sql/parts/query/editor/media/messagePanel.css b/src/sql/parts/query/editor/media/messagePanel.css index 77dfdcbcfb..91ab8c21f8 100644 --- a/src/sql/parts/query/editor/media/messagePanel.css +++ b/src/sql/parts/query/editor/media/messagePanel.css @@ -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. + *--------------------------------------------------------------------------------------------*/ /* Disable repl hover highlight in tree. */ .monaco-workbench .message-tree .monaco-tree .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) { @@ -7,10 +11,10 @@ /* Disable repl hover highlight in tree. */ .monaco-workbench .message-tree .monaco-tree .monaco-tree-row > .content { line-height: 18px; - user-select: text; - word-wrap: break-word; - /* white-space: pre-wrap; */ - word-break: break-all; + user-select: text; + word-wrap: break-word; + /* white-space: pre-wrap; */ + word-break: break-all; } .monaco-workbench .message-tree .monaco-tree .monaco-tree-rows>.monaco-tree-row { diff --git a/src/sql/parts/query/editor/media/queryActions.css b/src/sql/parts/query/editor/media/queryActions.css index 520b6b0941..8e61b70aea 100644 --- a/src/sql/parts/query/editor/media/queryActions.css +++ b/src/sql/parts/query/editor/media/queryActions.css @@ -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. + *--------------------------------------------------------------------------------------------*/ + .databaseListDropdown { min-width: 150px; } \ No newline at end of file diff --git a/src/sql/parts/query/editor/queryEditor.ts b/src/sql/parts/query/editor/queryEditor.ts index ada03a5936..2bea2eef4d 100644 --- a/src/sql/parts/query/editor/queryEditor.ts +++ b/src/sql/parts/query/editor/queryEditor.ts @@ -121,7 +121,7 @@ export class QueryEditor extends BaseEditor { // PROPERTIES ////////////////////////////////////////////////////////// /** * Returns the URI of this editor if it is connected. - * @returns {string} URI of the editor if connected, undefined otherwise + * @returns URI of the editor if connected, undefined otherwise */ public get connectedUri(): string { return this._connectionManagementService.isConnected(this.uri) @@ -131,7 +131,7 @@ export class QueryEditor extends BaseEditor { /** * Returns the URI of this editor if an input is associated with it - * @return {string} URI of this if input is associated, undefined otherwise + * @return URI of this if input is associated, undefined otherwise */ get uri(): string { let input: QueryInput = this.input; diff --git a/src/sql/parts/query/editor/queryResultsView.ts b/src/sql/parts/query/editor/queryResultsView.ts index 230c58764d..eab92ae507 100644 --- a/src/sql/parts/query/editor/queryResultsView.ts +++ b/src/sql/parts/query/editor/queryResultsView.ts @@ -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 { QueryResultsInput, ResultsViewState } from 'sql/parts/query/common/queryResultsInput'; import { TabbedPanel, IPanelTab, IPanelView } from 'sql/base/browser/ui/panel/panel'; @@ -55,7 +54,7 @@ class ResultsView extends Disposable implements IPanelView { if (this.state && this.state.gridPanelSize) { panelSize = this.state.gridPanelSize; } else if (this.currentDimension) { - panelSize = Math.round(this.currentDimension.height * .7); + panelSize = Math.round(this.currentDimension.height * 0.7); } else { panelSize = 200; this.needsGridResize = true; @@ -68,7 +67,7 @@ class ResultsView extends Disposable implements IPanelView { if (this.state && this.state.gridPanelSize) { panelSize = this.state.gridPanelSize; } else if (this.currentDimension) { - panelSize = Math.round(this.currentDimension.height * .7); + panelSize = Math.round(this.currentDimension.height * 0.7); } else { panelSize = 200; this.needsGridResize = true; @@ -108,7 +107,7 @@ class ResultsView extends Disposable implements IPanelView { } this.currentDimension = dimension; if (this.needsGridResize) { - this.panelViewlet.resizePanel(this.gridPanel, this.state.gridPanelSize || Math.round(this.currentDimension.height * .7)); + this.panelViewlet.resizePanel(this.gridPanel, this.state.gridPanelSize || Math.round(this.currentDimension.height * 0.7)); // we have the right scroll position saved as part of gridPanel state, use this to re-position scrollbar this.gridPanel.resetScrollPosition(); } diff --git a/src/sql/parts/query/execution/keyboardQueryActions.ts b/src/sql/parts/query/execution/keyboardQueryActions.ts index 6f132eda50..792441a48e 100644 --- a/src/sql/parts/query/execution/keyboardQueryActions.ts +++ b/src/sql/parts/query/execution/keyboardQueryActions.ts @@ -266,9 +266,7 @@ export class RunQueryShortcutAction extends Action { * Runs one of the optionally registered query shortcuts. This will lookup the shortcut's stored procedure * reference from the settings, and if found will execute it plus any * - * @param {QueryEditor} editor - * @param {number} shortcutIndex which shortcut should be run? - * @memberof RunQueryShortcutAction + * @param shortcutIndex which shortcut should be run? */ public runQueryShortcut(editor: QueryEditor, shortcutIndex: number): Thenable { if (!editor) { diff --git a/src/sql/parts/query/modelViewTab/media/dialogModal.css b/src/sql/parts/query/modelViewTab/media/dialogModal.css index d0954903a7..0795e69539 100644 --- a/src/sql/parts/query/modelViewTab/media/dialogModal.css +++ b/src/sql/parts/query/modelViewTab/media/dialogModal.css @@ -75,5 +75,5 @@ display: flex; flex-direction: column; height: 100%; - width: 100%; + width: 100%; } diff --git a/src/sql/parts/query/modelViewTab/queryModelViewTab.module.ts b/src/sql/parts/query/modelViewTab/queryModelViewTab.module.ts index e0d2ec56dc..39ac271fbf 100644 --- a/src/sql/parts/query/modelViewTab/queryModelViewTab.module.ts +++ b/src/sql/parts/query/modelViewTab/queryModelViewTab.module.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ 'use strict'; diff --git a/src/sql/parts/query/modelViewTab/queryModelViewTabContainer.component.ts b/src/sql/parts/query/modelViewTab/queryModelViewTabContainer.component.ts index 6affba46eb..0eed1f58d3 100644 --- a/src/sql/parts/query/modelViewTab/queryModelViewTabContainer.component.ts +++ b/src/sql/parts/query/modelViewTab/queryModelViewTabContainer.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ 'use strict'; diff --git a/src/sql/parts/query/views/flexibleSash.ts b/src/sql/parts/query/views/flexibleSash.ts index 68d33f8521..506c49bce5 100644 --- a/src/sql/parts/query/views/flexibleSash.ts +++ b/src/sql/parts/query/views/flexibleSash.ts @@ -3,13 +3,13 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { Dimension } from 'vs/base/browser/dom'; import { Disposable } from 'vs/base/common/lifecycle'; import { Event, Emitter } from 'vs/base/common/event'; -import { IHorizontalSashLayoutProvider, IVerticalSashLayoutProvider, - ISashEvent, Orientation, Sash } from 'vs/base/browser/ui/sash/sash'; +import { + IHorizontalSashLayoutProvider, IVerticalSashLayoutProvider, + ISashEvent, Orientation, Sash +} from 'vs/base/browser/ui/sash/sash'; // There is no need to import the sash CSS - 'vs/base/browser/ui/sash/sash' already includes it /** diff --git a/src/sql/platform/accounts/browser/accountListRenderer.ts b/src/sql/platform/accounts/browser/accountListRenderer.ts index f35523e078..b951169dd0 100644 --- a/src/sql/platform/accounts/browser/accountListRenderer.ts +++ b/src/sql/platform/accounts/browser/accountListRenderer.ts @@ -74,7 +74,7 @@ export class AccountPickerListRenderer implements IListRenderer} Promise to return the list of accounts + * @return Promise to return the list of accounts */ public initialize(): Thenable { // Load a baseline of the accounts for the provider diff --git a/src/sql/platform/accounts/common/accountStore.ts b/src/sql/platform/accounts/common/accountStore.ts index 91c3bddf64..9e7b2aeedf 100644 --- a/src/sql/platform/accounts/common/accountStore.ts +++ b/src/sql/platform/accounts/common/accountStore.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import * as azdata from 'azdata'; import { AccountAdditionResult } from 'sql/platform/accounts/common/eventTypes'; diff --git a/src/sql/platform/accounts/common/interfaces.ts b/src/sql/platform/accounts/common/interfaces.ts index e151f6f799..72f4532e83 100644 --- a/src/sql/platform/accounts/common/interfaces.ts +++ b/src/sql/platform/accounts/common/interfaces.ts @@ -50,21 +50,21 @@ export enum AzureResource { export interface IAccountStore { /** * Adds the provided account if the account doesn't exist. Updates the account if it already exists - * @param {Account} account Account to add/update - * @return {Thenable} Results of the add/update operation + * @param account Account to add/update + * @return Results of the add/update operation */ addOrUpdate(account: azdata.Account): Thenable; /** * Retrieves all accounts, filtered by provider ID - * @param {string} providerId ID of the provider to filter by - * @return {Thenable} Promise to return all accounts that belong to the provided provider + * @param providerId ID of the provider to filter by + * @return Promise to return all accounts that belong to the provided provider */ getAccountsByProvider(providerId: string): Thenable; /** * Retrieves all accounts in the store. Returns empty array if store is not initialized - * @return {Thenable} Promise to return all accounts + * @return Promise to return all accounts */ getAllAccounts(): Thenable; diff --git a/src/sql/platform/angularEventing/common/angularEventingService.ts b/src/sql/platform/angularEventing/common/angularEventingService.ts index d7732b0662..25590b298d 100644 --- a/src/sql/platform/angularEventing/common/angularEventingService.ts +++ b/src/sql/platform/angularEventing/common/angularEventingService.ts @@ -34,7 +34,6 @@ export interface IAngularEventingService { * Adds a listener for the dashboard to send events, should only be called once for each dashboard by the dashboard itself * @param uri Uri of the dashboard * @param cb Listening function - * @returns */ onAngularEvent(uri: string, cb: (event: IAngularEvent) => void): Subscription; diff --git a/src/sql/platform/capabilities/common/capabilitiesServiceImpl.ts b/src/sql/platform/capabilities/common/capabilitiesServiceImpl.ts index c70831a34d..95323a0c46 100644 --- a/src/sql/platform/capabilities/common/capabilitiesServiceImpl.ts +++ b/src/sql/platform/capabilities/common/capabilitiesServiceImpl.ts @@ -143,7 +143,6 @@ export class CapabilitiesService extends Disposable implements ICapabilitiesServ /** * Register the capabilities provider and query the provider for its capabilities - * @param provider */ public registerProvider(provider: azdata.CapabilitiesProvider): void { // request the capabilities from server diff --git a/src/sql/platform/connection/common/connectionConfig.ts b/src/sql/platform/connection/common/connectionConfig.ts index 83022d304a..1fc4425736 100644 --- a/src/sql/platform/connection/common/connectionConfig.ts +++ b/src/sql/platform/connection/common/connectionConfig.ts @@ -3,7 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import { ConnectionProfileGroup, IConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup'; @@ -69,7 +68,7 @@ export class ConnectionConfig implements IConnectionConfig { let newProfile = ConnectionProfile.convertToProfileStore(this._capabilitiesService, connectionProfile); // Remove the profile if already set - var sameProfileInList = profiles.find(value => { + let sameProfileInList = profiles.find(value => { let providerConnectionProfile = ConnectionProfile.createFromStoredProfile(value, this._capabilitiesService); return providerConnectionProfile.matches(connectionProfile); }); @@ -100,7 +99,6 @@ export class ConnectionConfig implements IConnectionConfig { /** *Returns group id - * @param groupName */ public addGroupFromProfile(profile: IConnectionProfile): Promise { if (profile.groupId && profile.groupId !== Utils.defaultGroupId) { @@ -116,7 +114,6 @@ export class ConnectionConfig implements IConnectionConfig { /** *Returns group id - * @param groupName */ public addGroup(profileGroup: IConnectionProfileGroup): Promise { if (profileGroup.id) { @@ -159,13 +156,12 @@ export class ConnectionConfig implements IConnectionConfig { /** * Replace duplicate ids with new ones. Sets id for the profiles without id - * @param profiles */ private fixConnectionIds(profiles: IConnectionProfileStore[]): boolean { let idsCache: { [label: string]: boolean } = {}; let changed: boolean = false; - for (var index = 0; index < profiles.length; index++) { - var profile = profiles[index]; + for (let index = 0; index < profiles.length; index++) { + let profile = profiles[index]; if (!profile.id) { profile.id = generateUuid(); changed = true; diff --git a/src/sql/platform/connection/common/connectionInfo.ts b/src/sql/platform/connection/common/connectionInfo.ts index cb21a58da9..93117ccb23 100644 --- a/src/sql/platform/connection/common/connectionInfo.ts +++ b/src/sql/platform/connection/common/connectionInfo.ts @@ -3,17 +3,14 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as interfaces from 'sql/platform/connection/common/interfaces'; /** * Sets sensible defaults for key connection properties, especially * if connection to Azure * - * @export connectionInfo/fixupConnectionCredentials - * @param {interfaces.IConnectionCredentials} connCreds connection to be fixed up - * @returns {interfaces.IConnectionCredentials} the updated connection + * @param connCreds connection to be fixed up + * @returns the updated connection */ export function fixupConnectionCredentials(connCreds: interfaces.IConnectionProfile): interfaces.IConnectionProfile { if (!connCreds.serverName) { diff --git a/src/sql/platform/connection/common/connectionManagement.ts b/src/sql/platform/connection/common/connectionManagement.ts index 3632cbb31c..b328ded687 100644 --- a/src/sql/platform/connection/common/connectionManagement.ts +++ b/src/sql/platform/connection/common/connectionManagement.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { Event } from 'vs/base/common/event'; import * as azdata from 'azdata'; @@ -221,18 +219,15 @@ export interface IConnectionManagementService { * Sends a notification that the language flavor for a given URI has changed. * For SQL, this would be the specific SQL implementation being used. * - * @param {string} uri the URI of the resource whose language has changed - * @param {string} language the base language - * @param {string} flavor the specific language flavor that's been set - * - * @memberof IConnectionManagementService + * @param uri the URI of the resource whose language has changed + * @param language the base language + * @param flavor the specific language flavor that's been set */ doChangeLanguageFlavor(uri: string, language: string, flavor: string): void; /** * Ensures that a default language flavor is set for a URI, if none has already been defined. - * @param {string} uri document identifier - * @memberof ConnectionManagementService + * @param uri document identifier */ ensureDefaultLanguageFlavor(uri: string): void; @@ -243,22 +238,22 @@ export interface IConnectionManagementService { /** * Get a copy of the connection profile with its passwords removed - * @param {IConnectionProfile} profile The connection profile to remove passwords from - * @returns {IConnectionProfile} A copy of the connection profile with passwords removed + * @param profile The connection profile to remove passwords from + * @returns A copy of the connection profile with passwords removed */ removeConnectionProfileCredentials(profile: IConnectionProfile): IConnectionProfile; /** * Get the credentials for a connected connection profile, as they would appear in the options dictionary - * @param {string} profileId The id of the connection profile to get the password for - * @returns {{ [name: string]: string }} A dictionary containing the credentials as they would be included + * @param profileId The id of the connection profile to get the password for + * @returns A dictionary containing the credentials as they would be included * in the connection profile's options dictionary, or undefined if the profile is not connected */ getActiveConnectionCredentials(profileId: string): { [name: string]: string }; /** * Get the ServerInfo for a connected connection profile - * @param {string} profileId The id of the connection profile to get the password for + * @param profileId The id of the connection profile to get the password for * @returns ServerInfo */ getServerInfo(profileId: string): azdata.ServerInfo; diff --git a/src/sql/platform/connection/common/connectionManagementInfo.ts b/src/sql/platform/connection/common/connectionManagementInfo.ts index 131d0c51d3..31fa22212d 100644 --- a/src/sql/platform/connection/common/connectionManagementInfo.ts +++ b/src/sql/platform/connection/common/connectionManagementInfo.ts @@ -1,9 +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'; + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import * as azdata from 'azdata'; diff --git a/src/sql/platform/connection/common/connectionManagementService.ts b/src/sql/platform/connection/common/connectionManagementService.ts index 23be36890d..2016661756 100644 --- a/src/sql/platform/connection/common/connectionManagementService.ts +++ b/src/sql/platform/connection/common/connectionManagementService.ts @@ -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 { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import * as WorkbenchUtils from 'sql/workbench/common/sqlWorkbenchUtils'; @@ -703,8 +702,6 @@ export class ConnectionManagementService extends Disposable implements IConnecti /** * Returns a formatted URI in case the database field is empty for the original * URI, which happens when the connected database is master or the default database - * @param uri - * @param connectionProfile */ public getFormattedUri(uri: string, connectionProfile: IConnectionProfile): string { if (this._connectionStatusManager.isDefaultTypeUri(uri)) { @@ -718,11 +715,10 @@ export class ConnectionManagementService extends Disposable implements IConnecti * Sends a notification that the language flavor for a given URI has changed. * For SQL, this would be the specific SQL implementation being used. * - * @param {string} uri the URI of the resource whose language has changed - * @param {string} language the base language - * @param {string} flavor the specific language flavor that's been set + * @param uri the URI of the resource whose language has changed + * @param language the base language + * @param flavor the specific language flavor that's been set * @throws {Error} if the provider is not in the list of registered providers - * @memberof ConnectionManagementService */ public doChangeLanguageFlavor(uri: string, language: string, provider: string): void { if (this._providers.has(provider)) { @@ -738,8 +734,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti /** * Ensures that a default language flavor is set for a URI, if none has already been defined. - * @param {string} uri document identifier - * @memberof ConnectionManagementService + * @param uri document identifier */ public ensureDefaultLanguageFlavor(uri: string): void { if (!this.getProviderIdFromUri(uri)) { @@ -973,7 +968,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti return new Promise((resolve, reject) => { // If the URI is connected, disconnect it and the editor if (self.isConnected(owner.uri)) { - var connection = self.getConnectionProfile(owner.uri); + let connection = self.getConnectionProfile(owner.uri); owner.onDisconnect(); resolve(self.doDisconnect(owner.uri, connection)); diff --git a/src/sql/platform/connection/common/connectionStatusManager.ts b/src/sql/platform/connection/common/connectionStatusManager.ts index 7e51e0e349..ef3967a2e8 100644 --- a/src/sql/platform/connection/common/connectionStatusManager.ts +++ b/src/sql/platform/connection/common/connectionStatusManager.ts @@ -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 { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo'; import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService'; @@ -16,7 +15,7 @@ export class ConnectionStatusManager { private _connections: { [id: string]: ConnectionManagementInfo }; - constructor( @ICapabilitiesService private _capabilitiesService: ICapabilitiesService) { + constructor(@ICapabilitiesService private _capabilitiesService: ICapabilitiesService) { this._connections = {}; } diff --git a/src/sql/platform/connection/common/connectionStore.ts b/src/sql/platform/connection/common/connectionStore.ts index f1e627daec..606d669c6b 100644 --- a/src/sql/platform/connection/common/connectionStore.ts +++ b/src/sql/platform/connection/common/connectionStore.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as Constants from 'sql/platform/connection/common/constants'; import * as ConnInfo from 'sql/platform/connection/common/connectionInfo'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; @@ -24,7 +22,6 @@ const MAX_CONNECTIONS_DEFAULT = 25; * Manages the connections list including saved profiles and the most recently used connections * * @export - * @class ConnectionStore */ export class ConnectionStore { private _memento: any; @@ -65,10 +62,9 @@ export class ConnectionStore { /** * Creates a formatted credential usable for uniquely identifying a SQL Connection. * This string can be decoded but is not optimized for this. - * @static - * @param {IConnectionProfile} connectionProfile connection profile - require - * @param {string} itemType type of the item (MRU or Profile) - optional - * @returns {string} formatted string with server, DB and username + * @param connectionProfile connection profile - require + * @param itemType type of the item (MRU or Profile) - optional + * @returns formatted string with server, DB and username */ public formatCredentialId(connectionProfile: IConnectionProfile, itemType?: string): string { let connectionProfileInstance: ConnectionProfile = ConnectionProfile.fromIConnectionProfile( @@ -120,9 +116,9 @@ export class ConnectionStore { } resolve({ profile: credentialsItem, savedCred: !!savedCred }); }, - reason => { - reject(reason); - }); + reason => { + reject(reason); + }); } else { // No need to look up the password resolve({ profile: credentialsItem, savedCred: credentialsItem.savePassword }); @@ -134,9 +130,9 @@ export class ConnectionStore { * Saves a connection profile to the user settings. * Password values are stored to a separate credential store if the "savePassword" option is true * - * @param {IConnectionProfile} profile the profile to save - * @param {forceWritePlaintextPassword} whether the plaintext password should be written to the settings file - * @returns {Promise} a Promise that returns the original profile, for help in chaining calls + * @param profile the profile to save + * @param whether the plaintext password should be written to the settings file + * @returns a Promise that returns the original profile, for help in chaining calls */ public saveProfile(profile: IConnectionProfile, forceWritePlaintextPassword?: boolean): Promise { const self = this; @@ -172,8 +168,8 @@ export class ConnectionStore { /** * Saves a connection profile group to the user settings. * - * @param {IConnectionProfileGroup} profile the profile group to save - * @returns {Promise} a Promise that returns the id of connection group + * @param profile the profile group to save + * @returns a Promise that returns the id of connection group */ public saveProfileGroup(profile: IConnectionProfileGroup): Promise { const self = this; @@ -205,7 +201,7 @@ export class ConnectionStore { * Gets the list of recently used connections. These will not include the password - a separate call to * {addSavedPassword} is needed to fill that before connecting * - * @returns {azdata.ConnectionInfo} the array of connections, empty if none are found + * @returns the array of connections, empty if none are found */ public getRecentlyUsedConnections(providers?: string[]): ConnectionProfile[] { let configValues: IConnectionProfile[] = this._memento[Constants.recentConnections]; @@ -245,7 +241,7 @@ export class ConnectionStore { * Gets the list of active connections. These will not include the password - a separate call to * {addSavedPassword} is needed to fill that before connecting * - * @returns {azdata.ConnectionInfo} the array of connections, empty if none are found + * @returns the array of connections, empty if none are found */ public getActiveConnections(): ConnectionProfile[] { let configValues: IConnectionProfile[] = this._memento[Constants.activeConnections]; @@ -272,9 +268,9 @@ export class ConnectionStore { * Connection is only added if there are no other connections with the same connection ID in the list. * Password values are stored to a separate credential store if the "savePassword" option is true * - * @param {IConnectionCredentials} conn the connection to add - * @param {boolean} addToMru Whether to add this connection to the MRU - * @returns {Promise} a Promise that returns when the connection was saved + * @param conn the connection to add + * @param addToMru Whether to add this connection to the MRU + * @returns a Promise that returns when the connection was saved */ public async addActiveConnection(conn: IConnectionProfile, addToMru: boolean): Promise { if (addToMru) { @@ -459,7 +455,7 @@ export class ConnectionStore { this.addGroupFullNameToMap(group.id, connectionGroup.fullName); if (connections) { let connectionsForGroup = connections.filter(conn => conn.groupId === connectionGroup.id); - var conns = []; + let conns = []; connectionsForGroup.forEach((conn) => { conn.groupFullName = connectionGroup.fullName; conns.push(conn); diff --git a/src/sql/platform/connection/common/iconnectionConfig.ts b/src/sql/platform/connection/common/iconnectionConfig.ts index 7e14127817..d63bac8c4d 100644 --- a/src/sql/platform/connection/common/iconnectionConfig.ts +++ b/src/sql/platform/connection/common/iconnectionConfig.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; import { IConnectionProfileGroup, ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; @@ -13,7 +11,6 @@ import { ConnectionProfile } from 'sql/platform/connection/common/connectionProf * Interface for a configuration file that stores connection profiles. * * @export - * @interface IConnectionConfig */ export interface IConnectionConfig { addConnection(profile: IConnectionProfile): Promise; diff --git a/src/sql/platform/connection/common/providerConnectionInfo.ts b/src/sql/platform/connection/common/providerConnectionInfo.ts index 92e4ddd3cf..67df5770a1 100644 --- a/src/sql/platform/connection/common/providerConnectionInfo.ts +++ b/src/sql/platform/connection/common/providerConnectionInfo.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { Disposable } from 'vs/base/common/lifecycle'; import { isString } from 'vs/base/common/types'; @@ -228,7 +226,7 @@ export class ProviderConnectionInfo extends Disposable implements azdata.Connect idNames.sort(); let idValues: string[] = []; - for (var index = 0; index < idNames.length; index++) { + for (let index = 0; index < idNames.length; index++) { let value = this.options[idNames[index]]; value = value ? value : ''; idValues.push(`${idNames[index]}${ProviderConnectionInfo.nameValueSeparator}${value}`); diff --git a/src/sql/platform/dialog/customDialogService.ts b/src/sql/platform/dialog/customDialogService.ts index 6b441e53c5..481e498de4 100644 --- a/src/sql/platform/dialog/customDialogService.ts +++ b/src/sql/platform/dialog/customDialogService.ts @@ -3,12 +3,9 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import { OptionsDialog } from 'sql/workbench/browser/modal/optionsDialog'; import { DialogModal } from 'sql/platform/dialog/dialogModal'; import { WizardModal } from 'sql/platform/dialog/wizardModal'; -import { Dialog, Wizard, DialogTab } from 'sql/platform/dialog/dialogTypes'; +import { Dialog, Wizard } from 'sql/platform/dialog/dialogTypes'; import { IModalOptions } from 'sql/workbench/browser/modal/modal'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -19,7 +16,7 @@ export class CustomDialogService { private _dialogModals = new Map(); private _wizardModals = new Map(); - constructor( @IInstantiationService private _instantiationService: IInstantiationService) { } + constructor(@IInstantiationService private _instantiationService: IInstantiationService) { } public showDialog(dialog: Dialog, dialogName?: string, options?: IModalOptions): void { let name = dialogName ? dialogName : 'CustomDialog'; diff --git a/src/sql/platform/dialog/dialog.module.ts b/src/sql/platform/dialog/dialog.module.ts index c31a824bdf..1920c29f9d 100644 --- a/src/sql/platform/dialog/dialog.module.ts +++ b/src/sql/platform/dialog/dialog.module.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ 'use strict'; diff --git a/src/sql/platform/dialog/dialogContainer.component.ts b/src/sql/platform/dialog/dialogContainer.component.ts index 33b5b0a3b4..ca0dc590fb 100644 --- a/src/sql/platform/dialog/dialogContainer.component.ts +++ b/src/sql/platform/dialog/dialogContainer.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ 'use strict'; diff --git a/src/sql/platform/dialog/media/dialogModal.css b/src/sql/platform/dialog/media/dialogModal.css index 2530d8fd6a..8d4b9b5b7b 100644 --- a/src/sql/platform/dialog/media/dialogModal.css +++ b/src/sql/platform/dialog/media/dialogModal.css @@ -75,5 +75,5 @@ display: flex; flex-direction: column; height: 100%; - width: 100%; + width: 100%; } diff --git a/src/sql/platform/dialog/wizardNavigation.component.ts b/src/sql/platform/dialog/wizardNavigation.component.ts index b319d319f7..fe54aa6076 100644 --- a/src/sql/platform/dialog/wizardNavigation.component.ts +++ b/src/sql/platform/dialog/wizardNavigation.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ 'use strict'; diff --git a/src/sql/platform/fileBrowser/common/fileBrowserService.ts b/src/sql/platform/fileBrowser/common/fileBrowserService.ts index 3692244f80..911f038433 100644 --- a/src/sql/platform/fileBrowser/common/fileBrowserService.ts +++ b/src/sql/platform/fileBrowser/common/fileBrowserService.ts @@ -67,7 +67,7 @@ export class FileBrowserService implements IFileBrowserService { && fileBrowserOpenedParams.fileTree.rootNode && fileBrowserOpenedParams.fileTree.selectedNode ) { - var fileTree = this.convertFileTree(null, fileBrowserOpenedParams.fileTree.rootNode, fileBrowserOpenedParams.fileTree.selectedNode.fullPath, fileBrowserOpenedParams.ownerUri); + let fileTree = this.convertFileTree(null, fileBrowserOpenedParams.fileTree.rootNode, fileBrowserOpenedParams.fileTree.selectedNode.fullPath, fileBrowserOpenedParams.ownerUri); this._onAddFileTree.fire({ rootNode: fileTree.rootNode, selectedNode: fileTree.selectedNode, expandedNodes: fileTree.expandedNodes }); } else { let genericErrorMessage = localize('fileBrowserErrorMessage', 'An error occured while loading the file browser.'); @@ -84,7 +84,7 @@ export class FileBrowserService implements IFileBrowserService { const provider = this.getProvider(fileNode.ownerUri); if (provider) { provider.expandFolderNode(fileNode.ownerUri, fileNode.fullPath).then(result => { - var mapKey = self.generateResolveMapKey(fileNode.ownerUri, fileNode.fullPath); + let mapKey = self.generateResolveMapKey(fileNode.ownerUri, fileNode.fullPath); self._expandResolveMap[mapKey] = resolve; }, error => { reject(error); @@ -96,12 +96,12 @@ export class FileBrowserService implements IFileBrowserService { } public onFolderNodeExpanded(handle: number, fileBrowserExpandedParams: azdata.FileBrowserExpandedParams) { - var mapKey = this.generateResolveMapKey(fileBrowserExpandedParams.ownerUri, fileBrowserExpandedParams.expandPath); - var expandResolve = this._expandResolveMap[mapKey]; + let mapKey = this.generateResolveMapKey(fileBrowserExpandedParams.ownerUri, fileBrowserExpandedParams.expandPath); + let expandResolve = this._expandResolveMap[mapKey]; if (expandResolve) { if (fileBrowserExpandedParams.succeeded === true) { // get the expanded folder node - var expandedNode = this._pathToFileNodeMap[fileBrowserExpandedParams.expandPath]; + let expandedNode = this._pathToFileNodeMap[fileBrowserExpandedParams.expandPath]; if (expandedNode) { if (fileBrowserExpandedParams.children && fileBrowserExpandedParams.children.length > 0) { expandedNode.children = this.convertChildren(expandedNode, fileBrowserExpandedParams.children, fileBrowserExpandedParams.ownerUri); @@ -158,9 +158,9 @@ export class FileBrowserService implements IFileBrowserService { private convertFileTree(parentNode: FileNode, fileTreeNode: azdata.FileTreeNode, expandPath: string, ownerUri: string): FileBrowserTree { FileBrowserService.fileNodeId += 1; - var expandedNodes: FileNode[] = []; - var selectedNode: FileNode; - var fileNode = new FileNode(FileBrowserService.fileNodeId.toString(), + let expandedNodes: FileNode[] = []; + let selectedNode: FileNode; + let fileNode = new FileNode(FileBrowserService.fileNodeId.toString(), fileTreeNode.name, fileTreeNode.fullPath, fileTreeNode.isFile, @@ -174,9 +174,9 @@ export class FileBrowserService implements IFileBrowserService { } if (fileTreeNode.children) { - var convertedChildren = []; - for (var i = 0; i < fileTreeNode.children.length; i++) { - var convertedFileTree: FileBrowserTree = this.convertFileTree(fileNode, fileTreeNode.children[i], expandPath, ownerUri); + let convertedChildren = []; + for (let i = 0; i < fileTreeNode.children.length; i++) { + let convertedFileTree: FileBrowserTree = this.convertFileTree(fileNode, fileTreeNode.children[i], expandPath, ownerUri); convertedChildren.push(convertedFileTree.rootNode); if (convertedFileTree.expandedNodes.length > 0) { @@ -206,11 +206,11 @@ export class FileBrowserService implements IFileBrowserService { } private convertChildren(expandedNode: FileNode, childrenToConvert: azdata.FileTreeNode[], ownerUri: string): FileNode[] { - var childrenNodes = []; + let childrenNodes = []; - for (var i = 0; i < childrenToConvert.length; i++) { + for (let i = 0; i < childrenToConvert.length; i++) { FileBrowserService.fileNodeId += 1; - var childNode = new FileNode(FileBrowserService.fileNodeId.toString(), + let childNode = new FileNode(FileBrowserService.fileNodeId.toString(), childrenToConvert[i].name, childrenToConvert[i].fullPath, childrenToConvert[i].isFile, diff --git a/src/sql/platform/jobManagement/common/jobActions.ts b/src/sql/platform/jobManagement/common/jobActions.ts index bd3febcb98..73674afd94 100644 --- a/src/sql/platform/jobManagement/common/jobActions.ts +++ b/src/sql/platform/jobManagement/common/jobActions.ts @@ -104,7 +104,7 @@ export class RunJobAction extends Action { return new Promise((resolve, reject) => { this.jobManagementService.jobAction(ownerUri, jobName, JobActions.Run).then(result => { if (result.success) { - var startMsg = nls.localize('jobSuccessfullyStarted', ': The job was successfully started.'); + let startMsg = nls.localize('jobSuccessfullyStarted', ': The job was successfully started.'); this.notificationService.info(jobName + startMsg); refreshAction.run(context); resolve(true); @@ -140,7 +140,7 @@ export class StopJobAction extends Action { this.jobManagementService.jobAction(ownerUri, jobName, JobActions.Stop).then(result => { if (result.success) { refreshAction.run(context); - var stopMsg = nls.localize('jobSuccessfullyStopped', ': The job was successfully stopped.'); + let stopMsg = nls.localize('jobSuccessfullyStopped', ': The job was successfully stopped.'); this.notificationService.info(jobName + stopMsg); resolve(true); } else { diff --git a/src/sql/platform/metadata/common/metadataService.ts b/src/sql/platform/metadata/common/metadataService.ts index 35b1ad82d1..e6286d2794 100644 --- a/src/sql/platform/metadata/common/metadataService.ts +++ b/src/sql/platform/metadata/common/metadataService.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; @@ -39,7 +37,7 @@ export class MetadataService implements IMetadataService { private _providers: { [handle: string]: azdata.MetadataProvider; } = Object.create(null); - constructor( @IConnectionManagementService private _connectionService: IConnectionManagementService) { + constructor(@IConnectionManagementService private _connectionService: IConnectionManagementService) { } public getMetadata(connectionUri: string): Thenable { diff --git a/src/sql/platform/node/resultSerializer.ts b/src/sql/platform/node/resultSerializer.ts index d85803bda9..3fc453d3a3 100644 --- a/src/sql/platform/node/resultSerializer.ts +++ b/src/sql/platform/node/resultSerializer.ts @@ -396,14 +396,14 @@ export class ResultSerializer { this._editorService.openEditor(input, { pinned: true }) .then( - (success) => { - }, - (error: any) => { - this._notificationService.notify({ - severity: Severity.Error, - message: error - }); - } + (success) => { + }, + (error: any) => { + this._notificationService.notify({ + severity: Severity.Error, + message: error + }); + } ); } } diff --git a/src/sql/platform/oAuth/common/sqlOAuthService.ts b/src/sql/platform/oAuth/common/sqlOAuthService.ts index e39290429f..ce8321560b 100644 --- a/src/sql/platform/oAuth/common/sqlOAuthService.ts +++ b/src/sql/platform/oAuth/common/sqlOAuthService.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; export const ISqlOAuthService = createDecorator('sqlOAuthService'); @@ -19,16 +17,16 @@ export interface ISqlOAuthService { /** * Sends request to main thread to handle OAuth request - * @param {string} eventId Unique ID of the request to return upon completion - * @param {string} url URL to load to do OAuth - * @param {boolean} silent Whether or not to show the OAuth window - * @return {Thenable} Promise to return an authorization code + * @param eventId Unique ID of the request to return upon completion + * @param url URL to load to do OAuth + * @param silent Whether or not to show the OAuth window + * @return Promise to return an authorization code */ performOAuthAuthorization(eventId: string, url: string, silent: boolean): void; /** * Registers a handler for the oauth-reply event on the IPC channel - * @param {(event, args) => void} handler Handler to call when the event is triggered + * @param handler Handler to call when the event is triggered */ registerOAuthCallback(handler: (event, args) => void): void; } diff --git a/src/sql/platform/oAuth/electron-browser/sqlOAuthServiceImpl.ts b/src/sql/platform/oAuth/electron-browser/sqlOAuthServiceImpl.ts index c30e217de1..fbf534fe80 100644 --- a/src/sql/platform/oAuth/electron-browser/sqlOAuthServiceImpl.ts +++ b/src/sql/platform/oAuth/electron-browser/sqlOAuthServiceImpl.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as electron from 'electron'; import { ISqlOAuthService } from 'sql/platform/oAuth/common/sqlOAuthService'; @@ -18,10 +16,10 @@ export class SqlOAuthService implements ISqlOAuthService { /** * Sends request to main thread to handle OAuth request - * @param {string} eventId Unique ID of the request to return upon completion - * @param {string} url URL to load to do OAuth - * @param {boolean} silent Whether or not to show the OAuth window - * @return {Thenable} Promise to return an authorization code + * @param eventId Unique ID of the request to return upon completion + * @param url URL to load to do OAuth + * @param silent Whether or not to show the OAuth window + * @return Promise to return an authorization code */ performOAuthAuthorization(eventId: string, url: string, silent: boolean): void { // Setup the args and send the IPC call @@ -37,7 +35,7 @@ export class SqlOAuthService implements ISqlOAuthService { /** * Registers a handler for the oauth-reply event on the IPC channel - * @param {(event, args) => void} handler Handler to call when the event is triggered + * @param handler Handler to call when the event is triggered */ registerOAuthCallback(handler: (event, args) => void): void { electron.ipcRenderer.on('oauth-reply', handler); diff --git a/src/sql/platform/scripting/common/scriptingService.ts b/src/sql/platform/scripting/common/scriptingService.ts index f5a568e91f..0257584ef7 100644 --- a/src/sql/platform/scripting/common/scriptingService.ts +++ b/src/sql/platform/scripting/common/scriptingService.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; @@ -50,14 +48,10 @@ export class ScriptingService implements IScriptingService { private _providers: { [handle: string]: azdata.ScriptingProvider; } = Object.create(null); private failedScriptingOperations: { [operationId: string]: azdata.ScriptingCompleteResult } = {}; - constructor( @IConnectionManagementService private _connectionService: IConnectionManagementService) { } + constructor(@IConnectionManagementService private _connectionService: IConnectionManagementService) { } /** * Call the service for scripting based on provider and scripting operation - * @param connectionUri - * @param metadata - * @param operation - * @param paramDetails */ public script(connectionUri: string, metadata: azdata.ObjectMetadata, operation: ScriptOperation, paramDetails: azdata.ScriptingParamDetails): Thenable { let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri); @@ -73,8 +67,6 @@ export class ScriptingService implements IScriptingService { /** * Callback method for when scripting is complete - * @param handle - * @param scriptingCompleteResult */ public onScriptingComplete(handle: number, scriptingCompleteResult: azdata.ScriptingCompleteResult): void { if (scriptingCompleteResult && scriptingCompleteResult.hasError && scriptingCompleteResult.errorMessage) { diff --git a/src/sql/platform/taskHistory/common/taskService.ts b/src/sql/platform/taskHistory/common/taskService.ts index f9f28f1db7..8d566e3772 100644 --- a/src/sql/platform/taskHistory/common/taskService.ts +++ b/src/sql/platform/taskHistory/common/taskService.ts @@ -3,7 +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 { TaskNode, TaskStatus, TaskExecutionMode } from 'sql/workbench/parts/taskHistory/common/taskNode'; import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService'; @@ -192,7 +191,7 @@ export class TaskService implements ITaskService { } public handleTaskComplete(eventArgs: TaskStatusChangeArgs): void { - var task = this.getTaskInQueue(eventArgs.taskId); + let task = this.getTaskInQueue(eventArgs.taskId); if (task) { task.status = eventArgs.status; if (eventArgs.message) { @@ -240,7 +239,7 @@ export class TaskService implements ITaskService { public getNumberOfInProgressTasks(): number { if (this._taskQueue.hasChildren) { - var inProgressTasks = this._taskQueue.children.filter(x => x.status === TaskStatus.InProgress); + let inProgressTasks = this._taskQueue.children.filter(x => x.status === TaskStatus.InProgress); return inProgressTasks ? inProgressTasks.length : 0; } return 0; @@ -249,4 +248,4 @@ export class TaskService implements ITaskService { public getAllTasks(): TaskNode { return this._taskQueue; } -} \ No newline at end of file +} diff --git a/src/sql/platform/telemetry/telemetry.contribution.ts b/src/sql/platform/telemetry/telemetry.contribution.ts index af58beeff6..275307c4fd 100644 --- a/src/sql/platform/telemetry/telemetry.contribution.ts +++ b/src/sql/platform/telemetry/telemetry.contribution.ts @@ -41,7 +41,7 @@ export class SqlTelemetryContribution extends Disposable implements IWorkbenchCo /* send monthly uses once the user launches on a day that's in a month - after the last time we sent a monthly usage count */ + after the last time we sent a monthly usage count */ const monthlyUseCount: number = storageService.getNumber('telemetry.monthlyUseCount', StorageScope.GLOBAL, 0); if (this.didMonthChange(monthlyLastUseDate)) { telemetryService.publicLog('telemetry.monthlyUse', { monthlyFirstUse: true }); @@ -136,9 +136,9 @@ export class SqlTelemetryContribution extends Disposable implements IWorkbenchCo } /** - Growth Metrics - Active here means opened app atleast 1 time in a month - */ + * Growth Metrics + * Active here means opened app atleast 1 time in a month +*/ export enum UserGrowthType { // first time opening app NewUser = 1, diff --git a/src/sql/sqlops.d.ts b/src/sql/sqlops.d.ts index da331c72d2..39fa057199 100644 --- a/src/sql/sqlops.d.ts +++ b/src/sql/sqlops.d.ts @@ -54,8 +54,8 @@ declare module 'sqlops' { 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; @@ -63,8 +63,8 @@ declare module 'sqlops' { * 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} 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; } @@ -97,14 +97,14 @@ declare module 'sqlops' { /** * 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; @@ -133,35 +133,35 @@ declare module 'sqlops' { * 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; /** * 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; /** * 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; /** * 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; @@ -1718,7 +1718,6 @@ declare module 'sqlops' { export namespace window { /** * @deprecated this method has been deprecated and will be removed in a future release, please use sqlops.window.createWebViewDialog instead. - * @param title */ export function createDialog( title: string diff --git a/src/sql/sqlops.proposed.d.ts b/src/sql/sqlops.proposed.d.ts index ac8b441899..8e670d5da3 100644 --- a/src/sql/sqlops.proposed.d.ts +++ b/src/sql/sqlops.proposed.d.ts @@ -13,7 +13,6 @@ declare module 'sqlops' { /** * Supports defining a model that can be instantiated as a view in the UI * @export - * @interface ModelBuilder */ export interface ModelBuilder { navContainer(): ContainerBuilder; @@ -117,7 +116,7 @@ declare module 'sqlops' { * 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, itemLayout?: FormItemLayout): void; @@ -125,7 +124,7 @@ declare module 'sqlops' { * 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; @@ -139,7 +138,6 @@ declare module 'sqlops' { /** * Removes a from item from the from - * @param formComponent */ removeFormItem(formComponent: FormComponent | FormComponentGroup): boolean; } @@ -150,18 +148,16 @@ declare module 'sqlops' { /** * Sends any updated properties of the component to the UI * - * @returns {Thenable} Thenable that completes once the update + * @returns henable that completes once the update * has been applied in the UI - * @memberof Component */ updateProperties(properties: { [key: string]: any }): Thenable; /** * Sends an updated property of the component to the UI * - * @returns {Thenable} 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; @@ -227,7 +223,7 @@ declare module 'sqlops' { * 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, itemLayout?: TItemLayout): void; @@ -235,8 +231,8 @@ declare module 'sqlops' { * 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; @@ -245,7 +241,7 @@ declare module 'sqlops' { * 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; @@ -258,7 +254,7 @@ declare module 'sqlops' { /** * Defines the layout for this container * - * @param {TLayout} layout object + * @param layout object */ setLayout(layout: TLayout): void; } @@ -1193,9 +1189,8 @@ declare module 'sqlops' { } /** - * creates a web view dialog - * @param title - */ + * creates a web view dialog + */ export function createWebViewDialog(title: string): ModalDialog; /** @@ -1533,14 +1528,14 @@ declare module 'sqlops' { /** * 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; /** * 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): void; } @@ -1723,8 +1718,8 @@ declare module 'sqlops' { 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; @@ -1739,7 +1734,6 @@ declare module 'sqlops' { /** * 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; @@ -1754,7 +1748,6 @@ declare module 'sqlops' { /** * All notebook documents currently known to the system. * - * @readonly */ export let notebookDocuments: NotebookDocument[]; diff --git a/src/sql/workbench/api/common/sqlExtHostTypes.ts b/src/sql/workbench/api/common/sqlExtHostTypes.ts index a2a9ee55d0..3a85f9ae71 100644 --- a/src/sql/workbench/api/common/sqlExtHostTypes.ts +++ b/src/sql/workbench/api/common/sqlExtHostTypes.ts @@ -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 { nb, IConnectionProfile } from 'azdata'; import * as vsExtTypes from 'vs/workbench/api/common/extHostTypes'; @@ -555,12 +554,12 @@ export enum SchemaUpdateAction { Add = 2 } - export enum SchemaDifferenceType { +export enum SchemaDifferenceType { Object = 0, Property = 1 } - export enum SchemaCompareEndpointType { +export enum SchemaCompareEndpointType { database = 0, dacpac = 1 } diff --git a/src/sql/workbench/api/electron-browser/mainThreadDashboard.ts b/src/sql/workbench/api/electron-browser/mainThreadDashboard.ts index 42dd805bd5..132e5e2b9b 100644 --- a/src/sql/workbench/api/electron-browser/mainThreadDashboard.ts +++ b/src/sql/workbench/api/electron-browser/mainThreadDashboard.ts @@ -1,9 +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 { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers'; import { SqlMainContext, MainThreadDashboardShape, ExtHostDashboardShape, SqlExtHostContext } from 'sql/workbench/api/node/sqlExtHost.protocol'; import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol'; @@ -15,14 +14,14 @@ export class MainThreadDashboard implements MainThreadDashboardShape { constructor( context: IExtHostContext, - @IDashboardService private _dashboardService: IDashboardService + @IDashboardService dashboardService: IDashboardService ) { this._proxy = context.getProxy(SqlExtHostContext.ExtHostDashboard); - _dashboardService.onDidChangeToDashboard(e => { + dashboardService.onDidChangeToDashboard(e => { this._proxy.$onDidChangeToDashboard(e); }); - _dashboardService.onDidOpenDashboard(e => { + dashboardService.onDidOpenDashboard(e => { this._proxy.$onDidOpenDashboard(e); }); } diff --git a/src/sql/workbench/api/node/extHostAccountManagement.ts b/src/sql/workbench/api/node/extHostAccountManagement.ts index 0e1e5fb887..939fd634d6 100644 --- a/src/sql/workbench/api/node/extHostAccountManagement.ts +++ b/src/sql/workbench/api/node/extHostAccountManagement.ts @@ -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 { Disposable } from 'vs/workbench/api/common/extHostTypes'; import { @@ -143,7 +141,7 @@ export class ExtHostAccountManagement extends ExtHostAccountManagementShape { /** * This method is for testing only, it is not exposed via the shape. - * @return {number} Number of providers that are currently registered + * @return Number of providers that are currently registered */ public getProviderCount(): number { return Object.keys(this._providers).length; diff --git a/src/sql/workbench/api/node/extHostCredentialManagement.ts b/src/sql/workbench/api/node/extHostCredentialManagement.ts index a1d07a02e6..56eaa228fd 100644 --- a/src/sql/workbench/api/node/extHostCredentialManagement.ts +++ b/src/sql/workbench/api/node/extHostCredentialManagement.ts @@ -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 { IMainContext } from 'vs/workbench/api/common/extHost.protocol'; import { SqlMainContext, MainThreadCredentialManagementShape, ExtHostCredentialManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol'; @@ -93,7 +92,7 @@ export class ExtHostCredentialManagement extends ExtHostCredentialManagementShap /** * Helper method for tests. Not exposed via shape. - * @return {number} Number of providers registered + * @return Number of providers registered */ public getProviderCount(): number { return Object.keys(this._adapter).length; diff --git a/src/sql/workbench/api/node/extHostDataProtocol.ts b/src/sql/workbench/api/node/extHostDataProtocol.ts index 2e184f5ece..fff5734972 100644 --- a/src/sql/workbench/api/node/extHostDataProtocol.ts +++ b/src/sql/workbench/api/node/extHostDataProtocol.ts @@ -358,11 +358,11 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape { } public $expandObjectExplorerNode(handle: number, nodeInfo: azdata.ExpandNodeInfo): Thenable { - return this._resolveProvider (handle).expandNode(nodeInfo); + return this._resolveProvider(handle).expandNode(nodeInfo); } public $refreshObjectExplorerNode(handle: number, nodeInfo: azdata.ExpandNodeInfo): Thenable { - return this._resolveProvider (handle).refreshNode(nodeInfo); + return this._resolveProvider(handle).refreshNode(nodeInfo); } public $closeObjectExplorerSession(handle: number, closeSessionInfo: azdata.ObjectExplorerCloseSessionInfo): Thenable { diff --git a/src/sql/workbench/api/node/extHostModelViewTree.ts b/src/sql/workbench/api/node/extHostModelViewTree.ts index 89c66b907c..a2fa6eeadf 100644 --- a/src/sql/workbench/api/node/extHostModelViewTree.ts +++ b/src/sql/workbench/api/node/extHostModelViewTree.ts @@ -99,15 +99,15 @@ export class ExtHostTreeView extends vsTreeExt.ExtHostTreeView { console.error(`No tree item with id \'${parentHandle}\' found.`); } - this._onNodeCheckedChanged.fire({element: parentElement, checked: checked}); + this._onNodeCheckedChanged.fire({ element: parentElement, checked: checked }); } onNodeSelectedChanged(parentHandles?: vsTreeExt.TreeItemHandle[]): void { if (parentHandles) { let nodes = parentHandles.map(parentHandle => { - return parentHandle ? this.getExtensionElement(parentHandle) : void 0; + return parentHandle ? this.getExtensionElement(parentHandle) : void 0; }); - this._onChangeSelection.fire({ selection: nodes}); + this._onChangeSelection.fire({ selection: nodes }); } } diff --git a/src/sql/workbench/api/node/extHostNotebook.ts b/src/sql/workbench/api/node/extHostNotebook.ts index e74df3c799..83cfc14ac7 100644 --- a/src/sql/workbench/api/node/extHostNotebook.ts +++ b/src/sql/workbench/api/node/extHostNotebook.ts @@ -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'; @@ -99,7 +98,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape { }; return details; } catch (error) { - throw typeof(error) === 'string' ? new Error(error) : error; + throw typeof (error) === 'string' ? new Error(error) : error; } }); } @@ -231,7 +230,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape { } private findManagerForUri(uriString: string): NotebookManagerAdapter { - for(let manager of this.getAdapters(NotebookManagerAdapter)) { + for (let manager of this.getAdapters(NotebookManagerAdapter)) { if (manager.uriString === uriString) { return manager; } @@ -279,7 +278,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape { let value = await callback(manager); return value; } catch (error) { - throw typeof(error) === 'string' ? new Error(error) : error; + throw typeof (error) === 'string' ? new Error(error) : error; } } diff --git a/src/sql/workbench/api/node/extHostNotebookDocumentData.ts b/src/sql/workbench/api/node/extHostNotebookDocumentData.ts index 83289da399..d54e64b690 100644 --- a/src/sql/workbench/api/node/extHostNotebookDocumentData.ts +++ b/src/sql/workbench/api/node/extHostNotebookDocumentData.ts @@ -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'; @@ -91,7 +90,7 @@ export class ExtHostNotebookDocumentData implements IDisposable { } private _validateIndex(index: number): number { - if (typeof(index) !== 'number') { + if (typeof (index) !== 'number') { throw new Error('Invalid argument'); } diff --git a/src/sql/workbench/api/node/extHostNotebookEditor.ts b/src/sql/workbench/api/node/extHostNotebookEditor.ts index b60d28d9e6..5b5083a1b4 100644 --- a/src/sql/workbench/api/node/extHostNotebookEditor.ts +++ b/src/sql/workbench/api/node/extHostNotebookEditor.ts @@ -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'; @@ -70,7 +69,7 @@ export class NotebookEditorEdit { private getAsRange(location: number | CellRange): CellRange { let range: CellRange = null; if (typeof (location) === 'number') { - range = new CellRange(location, location+1); + range = new CellRange(location, location + 1); } else if (location instanceof CellRange) { range = location; @@ -81,7 +80,7 @@ export class NotebookEditorEdit { return range; } - insertCell(value: Partial, location?: number): void { + insertCell(value: Partial, location?: number): void { if (location === null || location === undefined) { // If not specified, assume adding to end of list location = this._document.cells.length; @@ -92,11 +91,11 @@ export class NotebookEditorEdit { deleteCell(index: number): void { let range: CellRange = null; - if (typeof(index) === 'number') { + if (typeof (index) === 'number') { // Currently only allowing single-cell deletion. // Do this by saying the range extends over 1 cell so on the main thread // we can delete that cell, then handle insertions - range = new CellRange(index, index+1); + range = new CellRange(index, index + 1); } else { throw new Error('Unrecognized index'); } @@ -104,7 +103,7 @@ export class NotebookEditorEdit { this._pushEdit(range, null, true); } - private _pushEdit(range: azdata.nb.CellRange, cell: Partial, forceMoveMarkers: boolean): void { + private _pushEdit(range: azdata.nb.CellRange, cell: Partial, forceMoveMarkers: boolean): void { let validRange = this._document.validateCellRange(range); this._collectedEdits.push({ range: validRange, diff --git a/src/sql/workbench/api/node/extHostQueryEditor.ts b/src/sql/workbench/api/node/extHostQueryEditor.ts index d6c7722719..c5c3045ae4 100644 --- a/src/sql/workbench/api/node/extHostQueryEditor.ts +++ b/src/sql/workbench/api/node/extHostQueryEditor.ts @@ -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 { IMainContext } from 'vs/workbench/api/common/extHost.protocol'; import { ExtHostQueryEditorShape, SqlMainContext, MainThreadQueryEditorShape } from 'sql/workbench/api/node/sqlExtHost.protocol'; @@ -31,7 +30,7 @@ class ExtHostQueryDocument implements azdata.queryeditor.QueryDocument { } } -export class ExtHostQueryEditor implements ExtHostQueryEditorShape { +export class ExtHostQueryEditor implements ExtHostQueryEditorShape { private _proxy: MainThreadQueryEditorShape; private _nextListenerHandle: number = 0; @@ -57,7 +56,7 @@ export class ExtHostQueryEditor implements ExtHostQueryEditorShape { this._nextListenerHandle++; } - public $onQueryEvent(handle: number, fileUri:string, event: IQueryEvent): void { + public $onQueryEvent(handle: number, fileUri: string, event: IQueryEvent): void { let listener: azdata.queryeditor.QueryEventListener = this._queryListeners[handle]; if (listener) { let planXml = event.params ? event.params.planXml : undefined; diff --git a/src/sql/workbench/api/node/extHostResourceProvider.ts b/src/sql/workbench/api/node/extHostResourceProvider.ts index 822e83142f..f1f61450e9 100644 --- a/src/sql/workbench/api/node/extHostResourceProvider.ts +++ b/src/sql/workbench/api/node/extHostResourceProvider.ts @@ -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 { IMainContext } from 'vs/workbench/api/common/extHost.protocol'; import { Disposable } from 'vs/workbench/api/common/extHostTypes'; @@ -64,7 +62,7 @@ export class ExtHostResourceProvider extends ExtHostResourceProviderShape { /** * This method is for testing only, it is not exposed via the shape. - * @return {number} Number of providers that are currently registered + * @return Number of providers that are currently registered */ public getProviderCount(): number { return Object.keys(this._providers).length; diff --git a/src/sql/workbench/api/node/mainThreadDataProtocol.ts b/src/sql/workbench/api/node/mainThreadDataProtocol.ts index f4229c382f..6e370896c0 100644 --- a/src/sql/workbench/api/node/mainThreadDataProtocol.ts +++ b/src/sql/workbench/api/node/mainThreadDataProtocol.ts @@ -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 { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { @@ -255,7 +254,7 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape { public $registerObjectExplorerNodeProvider(providerId: string, supportedProviderId: string, group: string, handle: number): Promise { const self = this; - this._objectExplorerService.registerNodeProvider( { + this._objectExplorerService.registerNodeProvider({ supportedProviderId: supportedProviderId, providerId: providerId, group: group, diff --git a/src/sql/workbench/api/node/sqlExtHost.protocol.ts b/src/sql/workbench/api/node/sqlExtHost.protocol.ts index 16a5ca3b6c..521d2ab1f6 100644 --- a/src/sql/workbench/api/node/sqlExtHost.protocol.ts +++ b/src/sql/workbench/api/node/sqlExtHost.protocol.ts @@ -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 { createMainContextProxyIdentifier as createMainId, @@ -18,7 +17,7 @@ import * as vscode from 'vscode'; import { ITreeComponentItem } from 'sql/workbench/common/views'; import { ITaskHandlerDescription } from 'sql/platform/tasks/common/tasks'; import { - IItemConfig, ModelComponentTypes, IComponentShape, IModelViewDialogDetails, IModelViewTabDetails, IModelViewButtonDetails, + IItemConfig, IComponentShape, IModelViewDialogDetails, IModelViewTabDetails, IModelViewButtonDetails, IModelViewWizardDetails, IModelViewWizardPageDetails, INotebookManagerDetails, INotebookSessionDetails, INotebookKernelDetails, INotebookFutureDetails, FutureMessageType, INotebookFutureDone, ISingleNotebookEditOperation } from 'sql/workbench/api/common/sqlExtHostTypes'; import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor'; @@ -460,7 +459,7 @@ export abstract class ExtHostDataProtocolShape { */ $schemaCompare(handle: number, sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable { throw ni(); } - /** + /** * Schema compare generate script */ $schemaCompareGenerateScript(handle: number, operationId: string, targetDatabaseName: string, scriptFilePath: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable { throw ni(); } @@ -768,7 +767,7 @@ export interface MainThreadModelViewDialogShape extends IDisposable { $setDirty(handle: number, isDirty: boolean): void; } export interface ExtHostQueryEditorShape { - $onQueryEvent(handle: number, fileUri:string, event: IQueryEvent): void; + $onQueryEvent(handle: number, fileUri: string, event: IQueryEvent): void; } export interface MainThreadQueryEditorShape extends IDisposable { @@ -782,9 +781,7 @@ export interface ExtHostNotebookShape { /** * Looks up a notebook manager for a given notebook URI - * @param {number} providerHandle - * @param {vscode.Uri} notebookUri - * @returns {Thenable} handle of the manager to be used when sending + * @returns handle of the manager to be used when sending */ $getNotebookManager(providerHandle: number, notebookUri: UriComponents): Thenable; $handleNotebookClosed(notebookUri: UriComponents): void; @@ -887,4 +884,4 @@ export interface ExtHostExtensionManagementShape { export interface MainThreadExtensionManagementShape extends IDisposable { $install(vsixPath: string): Thenable; -} \ No newline at end of file +} diff --git a/src/sql/workbench/browser/modal/dialogHelper.ts b/src/sql/workbench/browser/modal/dialogHelper.ts index 99f21c6fab..640ebf35b0 100644 --- a/src/sql/workbench/browser/modal/dialogHelper.ts +++ b/src/sql/workbench/browser/modal/dialogHelper.ts @@ -3,7 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox'; import { Button } from 'sql/base/browser/ui/button/button'; import { append, $, addClass, addClasses } from 'vs/base/browser/dom'; @@ -51,7 +50,7 @@ export function getBooleanValueFromStringOrBoolean(value: any): boolean { } export function getCategoryDisplayName(categories: azdata.CategoryValue[], categoryName: string) { - var displayName: string; + let displayName: string; categories.forEach(c => { if (c.name === categoryName) { displayName = c.displayName; @@ -61,7 +60,7 @@ export function getCategoryDisplayName(categories: azdata.CategoryValue[], categ } export function getCategoryName(categories: azdata.CategoryValue[], categoryDisplayName: string) { - var categoryName: string; + let categoryName: string; categories.forEach(c => { if (c.displayName === categoryDisplayName) { categoryName = c.name; diff --git a/src/sql/workbench/browser/modal/modal.ts b/src/sql/workbench/browser/modal/modal.ts index 1085a6f7df..98e6b2d860 100644 --- a/src/sql/workbench/browser/modal/modal.ts +++ b/src/sql/workbench/browser/modal/modal.ts @@ -136,7 +136,6 @@ export abstract class Modal extends Disposable implements IThemable { * Constructor for modal * @param _title Title of the modal, if undefined, the title section is not rendered * @param _name Name of the modal, used for telemetry - * @param _partService * @param options Modal options */ constructor( @@ -474,7 +473,6 @@ export abstract class Modal extends Disposable implements IThemable { /** * Set the title of the modal - * @param title */ protected set title(title: string) { if (this._title !== undefined) { @@ -488,7 +486,6 @@ export abstract class Modal extends Disposable implements IThemable { /** * Set the icon title class name - * @param iconClassName */ protected set titleIconClassName(iconClassName: string) { if (this._modalTitleIcon) { diff --git a/src/sql/workbench/browser/modal/optionsDialogHelper.ts b/src/sql/workbench/browser/modal/optionsDialogHelper.ts index bb600b33b7..8f8be213b4 100644 --- a/src/sql/workbench/browser/modal/optionsDialogHelper.ts +++ b/src/sql/workbench/browser/modal/optionsDialogHelper.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as DialogHelper from './dialogHelper'; import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox'; import { MessageType } from 'vs/base/browser/ui/inputbox/inputBox'; @@ -69,7 +67,7 @@ export function createOptionElement(option: azdata.ServiceOption, rowContainer: } export function getOptionValueAndCategoryValues(option: azdata.ServiceOption, options: { [optionName: string]: any }, possibleInputs: string[]): any { - var optionValue = option.defaultValue; + let optionValue = option.defaultValue; if (options[option.name]) { // if the value type is boolean, the option value can be either boolean or string if (option.valueType === ServiceOptionType.boolean) { @@ -106,10 +104,10 @@ export function getOptionValueAndCategoryValues(option: azdata.ServiceOption, op export function validateInputs(optionsMap: { [optionName: string]: IOptionElement }): boolean { let isValid = true; let isFocused = false; - for (var optionName in optionsMap) { - var optionElement: IOptionElement = optionsMap[optionName]; - var widget = optionElement.optionWidget; - var isInputBox = (optionElement.option.valueType === ServiceOptionType.string || + for (let optionName in optionsMap) { + let optionElement: IOptionElement = optionsMap[optionName]; + let widget = optionElement.optionWidget; + let isInputBox = (optionElement.option.valueType === ServiceOptionType.string || optionElement.option.valueType === ServiceOptionType.password || optionElement.option.valueType === ServiceOptionType.number); @@ -127,8 +125,8 @@ export function validateInputs(optionsMap: { [optionName: string]: IOptionElemen } export function updateOptions(options: { [optionName: string]: any }, optionsMap: { [optionName: string]: IOptionElement }): void { - for (var optionName in optionsMap) { - var optionElement: IOptionElement = optionsMap[optionName]; + for (let optionName in optionsMap) { + let optionElement: IOptionElement = optionsMap[optionName]; if (optionElement.optionWidget.value !== options[optionName]) { if (!optionElement.optionWidget.value && options[optionName]) { delete options[optionName]; @@ -149,9 +147,9 @@ export let trueInputValue: string = 'True'; export let falseInputValue: string = 'False'; export function findElement(container: HTMLElement, className: string): HTMLElement { - var elementBuilder = container; + let elementBuilder = container; while (elementBuilder) { - var htmlElement = elementBuilder; + let htmlElement = elementBuilder; if (htmlElement.className.startsWith(className)) { break; } @@ -161,9 +159,9 @@ export function findElement(container: HTMLElement, className: string): HTMLElem } export function groupOptionsByCategory(options: azdata.ServiceOption[]): { [category: string]: azdata.ServiceOption[] } { - var connectionOptionsMap: { [category: string]: azdata.ServiceOption[] } = {}; + let connectionOptionsMap: { [category: string]: azdata.ServiceOption[] } = {}; options.forEach(option => { - var groupName = option.groupName; + let groupName = option.groupName; if (groupName === null || groupName === undefined) { groupName = 'General'; } diff --git a/src/sql/workbench/common/sqlWorkbenchUtils.ts b/src/sql/workbench/common/sqlWorkbenchUtils.ts index 8ef709c73d..f2b78dafab 100644 --- a/src/sql/workbench/common/sqlWorkbenchUtils.ts +++ b/src/sql/workbench/common/sqlWorkbenchUtils.ts @@ -13,11 +13,6 @@ import { IEditorInput } from 'vs/workbench/common/editor'; /** * Gets the 'sql' configuration section for use in looking up settings. Note that configs under * 'mssql' or other sections are not available from this. - * - * @export - * @param {IWorkspaceConfigurationService} workspaceConfigService - * @param {string} sectionName - * @returns {*} */ export function getSqlConfigSection(workspaceConfigService: IConfigurationService, sectionName: string): any { let config = workspaceConfigService.getValue(ConnectionConstants.sqlConfigSectionName); diff --git a/src/sql/workbench/common/taskUtilities.ts b/src/sql/workbench/common/taskUtilities.ts index 7f6a27c781..96a88cb849 100644 --- a/src/sql/workbench/common/taskUtilities.ts +++ b/src/sql/workbench/common/taskUtilities.ts @@ -309,9 +309,6 @@ export function openInsight(query: IInsightsConfig, profile: IConnectionProfile, * is focused or there is no such editor, in which case it comes from the OE selection. Returns * undefined when there is no such connection. * - * @param objectExplorerService - * @param connectionManagementService - * @param workbenchEditorService * @param topLevelOnly If true, only return top-level (i.e. connected) Object Explorer connections instead of database connections when appropriate */ export function getCurrentGlobalConnection(objectExplorerService: IObjectExplorerService, connectionManagementService: IConnectionManagementService, workbenchEditorService: IEditorService, topLevelOnly: boolean = false): IConnectionProfile { diff --git a/src/sql/workbench/parts/connection/browser/advancedPropertiesController.ts b/src/sql/workbench/parts/connection/browser/advancedPropertiesController.ts index a40885ce02..6bfdd94f72 100644 --- a/src/sql/workbench/parts/connection/browser/advancedPropertiesController.ts +++ b/src/sql/workbench/parts/connection/browser/advancedPropertiesController.ts @@ -25,7 +25,7 @@ export class AdvancedPropertiesController { public showDialog(providerOptions: azdata.ConnectionOption[], container: HTMLElement, options: { [name: string]: any }): void { this._options = options; - var serviceOptions = providerOptions.map(option => AdvancedPropertiesController.connectionOptionToServiceOption(option)); + let serviceOptions = providerOptions.map(option => AdvancedPropertiesController.connectionOptionToServiceOption(option)); this.advancedDialog.open(serviceOptions, this._options); } diff --git a/src/sql/workbench/parts/connection/browser/recentConnectionTreeController.ts b/src/sql/workbench/parts/connection/browser/recentConnectionTreeController.ts index 91cfbdf4c0..9c9bf01b18 100644 --- a/src/sql/workbench/parts/connection/browser/recentConnectionTreeController.ts +++ b/src/sql/workbench/parts/connection/browser/recentConnectionTreeController.ts @@ -109,7 +109,7 @@ export class RecentConnectionTreeController extends DefaultController { } public showContextMenu(tree: ITree, element: any, event: any): boolean { - var actionContext: any; + let actionContext: any; if (element instanceof ConnectionProfile) { actionContext = new RecentConnectionsActionsContext(); diff --git a/src/sql/workbench/parts/dashboard/common/componentHost.directive.ts b/src/sql/workbench/parts/dashboard/common/componentHost.directive.ts index a736495e12..02efc21324 100644 --- a/src/sql/workbench/parts/dashboard/common/componentHost.directive.ts +++ b/src/sql/workbench/parts/dashboard/common/componentHost.directive.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import { Directive, ViewContainerRef, Inject, forwardRef } from '@angular/core'; @@ -9,5 +9,5 @@ import { Directive, ViewContainerRef, Inject, forwardRef } from '@angular/core'; selector: '[component-host]', }) export class ComponentHostDirective { - constructor( @Inject(forwardRef(() => ViewContainerRef)) public viewContainerRef: ViewContainerRef) { } + constructor(@Inject(forwardRef(() => ViewContainerRef)) public viewContainerRef: ViewContainerRef) { } } diff --git a/src/sql/workbench/parts/dashboard/containers/dashboardControlHostContainer.component.ts b/src/sql/workbench/parts/dashboard/containers/dashboardControlHostContainer.component.ts index 8bbdf9226c..5976d5b00d 100644 --- a/src/sql/workbench/parts/dashboard/containers/dashboardControlHostContainer.component.ts +++ b/src/sql/workbench/parts/dashboard/containers/dashboardControlHostContainer.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!./dashboardControlHostContainer'; diff --git a/src/sql/workbench/parts/dashboard/containers/dashboardControlHostContainer.css b/src/sql/workbench/parts/dashboard/containers/dashboardControlHostContainer.css index e4bf0dbe29..b7f1c56c3b 100644 --- a/src/sql/workbench/parts/dashboard/containers/dashboardControlHostContainer.css +++ b/src/sql/workbench/parts/dashboard/containers/dashboardControlHostContainer.css @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - dashboard-controlhost-container { +dashboard-controlhost-container { height: 100%; width : 100%; display: block; diff --git a/src/sql/workbench/parts/dashboard/containers/dashboardHomeContainer.css b/src/sql/workbench/parts/dashboard/containers/dashboardHomeContainer.css index 050c2a72fa..e134cbd8f1 100644 --- a/src/sql/workbench/parts/dashboard/containers/dashboardHomeContainer.css +++ b/src/sql/workbench/parts/dashboard/containers/dashboardHomeContainer.css @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - dashboard-home-tab { +dashboard-home-tab { height: 100%; width: 100%; display: block; diff --git a/src/sql/workbench/parts/dashboard/containers/dashboardModelViewContainer.component.ts b/src/sql/workbench/parts/dashboard/containers/dashboardModelViewContainer.component.ts index 2f0e0bb966..92930ad1f0 100644 --- a/src/sql/workbench/parts/dashboard/containers/dashboardModelViewContainer.component.ts +++ b/src/sql/workbench/parts/dashboard/containers/dashboardModelViewContainer.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!./dashboardWebviewContainer'; diff --git a/src/sql/workbench/parts/dashboard/containers/dashboardWebviewContainer.component.ts b/src/sql/workbench/parts/dashboard/containers/dashboardWebviewContainer.component.ts index 03399ed1cc..f9811ba42d 100644 --- a/src/sql/workbench/parts/dashboard/containers/dashboardWebviewContainer.component.ts +++ b/src/sql/workbench/parts/dashboard/containers/dashboardWebviewContainer.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!./dashboardWebviewContainer'; diff --git a/src/sql/workbench/parts/dashboard/contents/controlHostContent.component.ts b/src/sql/workbench/parts/dashboard/contents/controlHostContent.component.ts index 80a889e3c8..19e169197e 100644 --- a/src/sql/workbench/parts/dashboard/contents/controlHostContent.component.ts +++ b/src/sql/workbench/parts/dashboard/contents/controlHostContent.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!./controlHostContent'; diff --git a/src/sql/workbench/parts/dashboard/contents/controlHostContent.css b/src/sql/workbench/parts/dashboard/contents/controlHostContent.css index ea015ce963..70f6fc22a9 100644 --- a/src/sql/workbench/parts/dashboard/contents/controlHostContent.css +++ b/src/sql/workbench/parts/dashboard/contents/controlHostContent.css @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - controlhost-content { +controlhost-content { height: 100%; width : 100%; display: block; diff --git a/src/sql/workbench/parts/dashboard/contents/dashboardWidgetWrapper.component.ts b/src/sql/workbench/parts/dashboard/contents/dashboardWidgetWrapper.component.ts index 690637ae42..3ab841c93c 100644 --- a/src/sql/workbench/parts/dashboard/contents/dashboardWidgetWrapper.component.ts +++ b/src/sql/workbench/parts/dashboard/contents/dashboardWidgetWrapper.component.ts @@ -197,11 +197,6 @@ export class DashboardWidgetWrapper extends AngularDisposable implements OnInit /** * Attempts to get the selector for a given key, and if none is defined tries * to load it from the widget registry and configure as needed - * - * @private - * @param {string} key - * @returns {Type} - * @memberof DashboardWidgetWrapper */ private getOrCreateSelector(key: string): Type { let selector = componentMap[key]; diff --git a/src/sql/workbench/parts/dashboard/contents/webviewContent.component.ts b/src/sql/workbench/parts/dashboard/contents/webviewContent.component.ts index f01c0f0f3d..58a912e853 100644 --- a/src/sql/workbench/parts/dashboard/contents/webviewContent.component.ts +++ b/src/sql/workbench/parts/dashboard/contents/webviewContent.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!./webviewContent'; diff --git a/src/sql/workbench/parts/dashboard/dashboard.component.ts b/src/sql/workbench/parts/dashboard/dashboard.component.ts index ce3bebb4e2..186c11d0cb 100644 --- a/src/sql/workbench/parts/dashboard/dashboard.component.ts +++ b/src/sql/workbench/parts/dashboard/dashboard.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!./dashboard'; diff --git a/src/sql/workbench/parts/dashboard/widgets/insights/views/charts/chartInsight.component.ts b/src/sql/workbench/parts/dashboard/widgets/insights/views/charts/chartInsight.component.ts index ea12b525b6..edb591cb86 100644 --- a/src/sql/workbench/parts/dashboard/widgets/insights/views/charts/chartInsight.component.ts +++ b/src/sql/workbench/parts/dashboard/widgets/insights/views/charts/chartInsight.component.ts @@ -293,7 +293,7 @@ function isValidData(data: IInsightData): boolean { Chart.pluginService.register({ beforeDraw: function (chart) { if (chart.config.options.viewArea && chart.config.options.viewArea.backgroundColor) { - var ctx = chart.chart.ctx; + let ctx = chart.chart.ctx; ctx.fillStyle = chart.config.options.viewArea.backgroundColor; ctx.fillRect(0, 0, chart.chart.width, chart.chart.height); } diff --git a/src/sql/workbench/parts/dashboard/widgets/properties/propertiesJson.ts b/src/sql/workbench/parts/dashboard/widgets/properties/propertiesJson.ts index ce8cc650b0..3c3a325999 100644 --- a/src/sql/workbench/parts/dashboard/widgets/properties/propertiesJson.ts +++ b/src/sql/workbench/parts/dashboard/widgets/properties/propertiesJson.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import { ProviderProperties } from './propertiesWidget.component'; import * as nls from 'vs/nls'; diff --git a/src/sql/workbench/parts/dataExplorer/browser/media/dataExplorerViewlet.css b/src/sql/workbench/parts/dataExplorer/browser/media/dataExplorerViewlet.css deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/sql/workbench/parts/grid/common/interfaces.ts b/src/sql/workbench/parts/grid/common/interfaces.ts index f2a4f6f2f6..72e163bf1d 100644 --- a/src/sql/workbench/parts/grid/common/interfaces.ts +++ b/src/sql/workbench/parts/grid/common/interfaces.ts @@ -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. diff --git a/src/sql/workbench/parts/grid/media/flexbox.css b/src/sql/workbench/parts/grid/media/flexbox.css index 3de8861cee..7e2ce07808 100644 --- a/src/sql/workbench/parts/grid/media/flexbox.css +++ b/src/sql/workbench/parts/grid/media/flexbox.css @@ -1,71 +1,76 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + .fullsize { - height: 100%; - width: 100%; + height: 100%; + width: 100%; } /* vertical box styles */ .vertBox { - display: flex; - flex-flow: column; + display: flex; + flex-flow: column; } .vertBox .boxRow.header { - flex: 0 0 auto; + flex: 0 0 auto; } .vertBox .boxRow.content { - flex: 1 1 0; + flex: 1 1 0; } .edgesPadding { - padding-left: 10px; - padding-right: 10px; - padding-top: 10px; + padding-left: 10px; + padding-right: 10px; + padding-top: 10px; } .messagesTopSpacing { - height: 5px; + height: 5px; } .results { - flex: 100 1 0; + flex: 100 1 0; } .scrollable { - overflow: auto; + overflow: auto; } .maxHeight { - max-height: fit-content; + max-height: fit-content; } .minHeight { - min-height: fit-content; + min-height: fit-content; } /* horizontal box style */ .horzBox { - display: flex; - flex-flow: row; + display: flex; + flex-flow: row; } .horzBox .boxCol.content { - flex: 1 1 1%; - overflow: auto; - max-width: fit-content; + flex: 1 1 1%; + overflow: auto; + max-width: fit-content; } .hidden { - display: none !important; + display: none !important; } /* testing .vertBox { - border: 1px solid green; + border: 1px solid green; } .horzBox { - border: 1px solid red; + border: 1px solid red; } */ \ No newline at end of file diff --git a/src/sql/workbench/parts/grid/views/editData/editData.component.html b/src/sql/workbench/parts/grid/views/editData/editData.component.html index c90b81a280..425f6e1f8b 100644 --- a/src/sql/workbench/parts/grid/views/editData/editData.component.html +++ b/src/sql/workbench/parts/grid/views/editData/editData.component.html @@ -7,7 +7,7 @@
+ (onScroll)="onScroll($event)" [class.hidden]="!resultActive">
void} * * @memberOf QueryComponent */ @@ -559,11 +557,6 @@ export abstract class GridParentComponent { * Called by keyEvent method to give child classes a chance to * handle key events. * - * @protected - * @abstract - * @param {StandardKeyboardEvent} e - * @returns {boolean} - * * @memberOf GridParentComponent */ protected abstract tryHandleKeyEvent(e: StandardKeyboardEvent): boolean; diff --git a/src/sql/workbench/parts/notebook/cellToggleMoreActions.ts b/src/sql/workbench/parts/notebook/cellToggleMoreActions.ts index ecef1dc4f3..aeaa0557d3 100644 --- a/src/sql/workbench/parts/notebook/cellToggleMoreActions.ts +++ b/src/sql/workbench/parts/notebook/cellToggleMoreActions.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import { ElementRef } from '@angular/core'; @@ -19,7 +19,7 @@ import { ToggleMoreWidgetAction } from 'sql/workbench/parts/dashboard/common/act import { CellTypes, CellType } from 'sql/workbench/parts/notebook/models/contracts'; import { CellModel } from 'sql/workbench/parts/notebook/models/cell'; -export const HIDDEN_CLASS ='actionhidden'; +export const HIDDEN_CLASS = 'actionhidden'; export class CellToggleMoreActions { private _actions: CellActionBase[] = []; @@ -29,7 +29,7 @@ export class CellToggleMoreActions { @IInstantiationService private instantiationService: IInstantiationService) { this._actions.push( instantiationService.createInstance(DeleteCellAction, 'delete', localize('delete', 'Delete')), - instantiationService.createInstance(AddCellFromContextAction,'codeBefore', localize('codeBefore', 'Insert Code before'), CellTypes.Code, false), + instantiationService.createInstance(AddCellFromContextAction, 'codeBefore', localize('codeBefore', 'Insert Code before'), CellTypes.Code, false), instantiationService.createInstance(AddCellFromContextAction, 'codeAfter', localize('codeAfter', 'Insert Code after'), CellTypes.Code, true), instantiationService.createInstance(AddCellFromContextAction, 'markdownBefore', localize('markdownBefore', 'Insert Text before'), CellTypes.Markdown, false), instantiationService.createInstance(AddCellFromContextAction, 'markdownAfter', localize('markdownAfter', 'Insert Text after'), CellTypes.Markdown, true), @@ -38,7 +38,7 @@ export class CellToggleMoreActions { } public onInit(elementRef: ElementRef, model: NotebookModel, cellModel: ICellModel) { - let context = new CellContext(model,cellModel); + let context = new CellContext(model, cellModel); this._moreActionsElement = elementRef.nativeElement; if (this._moreActionsElement.childNodes.length > 0) { this._moreActionsElement.removeChild(this._moreActionsElement.childNodes[0]); diff --git a/src/sql/workbench/parts/notebook/cellViews/code.component.ts b/src/sql/workbench/parts/notebook/cellViews/code.component.ts index 6d655d6001..4e40f3e60d 100644 --- a/src/sql/workbench/parts/notebook/cellViews/code.component.ts +++ b/src/sql/workbench/parts/notebook/cellViews/code.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!./code'; import { OnInit, Component, Input, Inject, ElementRef, ViewChild, Output, EventEmitter, OnChanges, SimpleChange, forwardRef, ChangeDetectorRef } from '@angular/core'; @@ -160,7 +160,7 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange && this.cellModel.cellUri; } - private get destroyed(): boolean{ + private get destroyed(): boolean { return !!(this._changeRef['destroyed']); } diff --git a/src/sql/workbench/parts/notebook/cellViews/codeActions.ts b/src/sql/workbench/parts/notebook/cellViews/codeActions.ts index d6fd7fd57c..9ebc49aad1 100644 --- a/src/sql/workbench/parts/notebook/cellViews/codeActions.ts +++ b/src/sql/workbench/parts/notebook/cellViews/codeActions.ts @@ -1,9 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ - -import { nb } from 'azdata'; + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import { Action } from 'vs/base/common/actions'; import { localize } from 'vs/nls'; @@ -15,12 +13,12 @@ import { NotebookModel } from 'sql/workbench/parts/notebook/models/notebookModel import { getErrorMessage } from 'sql/workbench/parts/notebook/notebookUtils'; import { ICellModel, CellExecutionState } from 'sql/workbench/parts/notebook/models/modelInterfaces'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; -import { MultiStateAction, IMultiStateData, IActionStateData } from 'sql/workbench/parts/notebook/notebookActions'; +import { MultiStateAction, IMultiStateData } from 'sql/workbench/parts/notebook/notebookActions'; let notebookMoreActionMsg = localize('notebook.failed', "Please select active cell and try again"); const emptyExecutionCountLabel = '[ ]'; -function hasModelAndCell(context: CellContext, notificationService: INotificationService): boolean { +function hasModelAndCell(context: CellContext, notificationService: INotificationService): boolean { if (!context || !context.model) { return false; } @@ -71,11 +69,11 @@ export class RunCellAction extends MultiStateAction { constructor(context: CellContext, @INotificationService private notificationService: INotificationService, @IConnectionManagementService private connectionManagementService: IConnectionManagementService) { super(RunCellAction.ID, new IMultiStateData([ - { key: CellExecutionState.Hidden, value: { label: emptyExecutionCountLabel, className: '', tooltip: '', hideIcon: true }}, - { key: CellExecutionState.Stopped, value: { label: '', className: 'toolbarIconRun', tooltip: localize('runCell', 'Run cell') }}, - { key: CellExecutionState.Running, value: { label: '', className: 'toolbarIconStop', tooltip: localize('stopCell', 'Cancel execution') }}, - { key: CellExecutionState.Error, value: { label: '', className: 'toolbarIconRunError', tooltip: localize('errorRunCell', 'Error on last run. Click to run again') }}, - ], CellExecutionState.Hidden )); + { key: CellExecutionState.Hidden, value: { label: emptyExecutionCountLabel, className: '', tooltip: '', hideIcon: true } }, + { key: CellExecutionState.Stopped, value: { label: '', className: 'toolbarIconRun', tooltip: localize('runCell', 'Run cell') } }, + { key: CellExecutionState.Running, value: { label: '', className: 'toolbarIconStop', tooltip: localize('stopCell', 'Cancel execution') } }, + { key: CellExecutionState.Error, value: { label: '', className: 'toolbarIconRunError', tooltip: localize('errorRunCell', 'Error on last run. Click to run again') } }, + ], CellExecutionState.Hidden)); this.ensureContextIsUpdated(context); } diff --git a/src/sql/workbench/parts/notebook/cellViews/codeCell.component.ts b/src/sql/workbench/parts/notebook/cellViews/codeCell.component.ts index 56c67ac23e..5a675c6a46 100644 --- a/src/sql/workbench/parts/notebook/cellViews/codeCell.component.ts +++ b/src/sql/workbench/parts/notebook/cellViews/codeCell.component.ts @@ -1,9 +1,9 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, OnDestroy, ViewChild, SimpleChange, OnChanges, AfterViewInit } from '@angular/core'; +import { OnInit, Component, Input, Inject, forwardRef, ChangeDetectorRef, SimpleChange, OnChanges } from '@angular/core'; import { CellView } from 'sql/workbench/parts/notebook/cellViews/interfaces'; import { ICellModel } from 'sql/workbench/parts/notebook/models/modelInterfaces'; import { NotebookModel } from 'sql/workbench/parts/notebook/models/notebookModel'; diff --git a/src/sql/workbench/parts/notebook/cellViews/media/output.css b/src/sql/workbench/parts/notebook/cellViews/media/output.css index 48b7e75ec9..9b56567c70 100644 --- a/src/sql/workbench/parts/notebook/cellViews/media/output.css +++ b/src/sql/workbench/parts/notebook/cellViews/media/output.css @@ -8,126 +8,126 @@ |----------------------------------------------------------------------------*/ output-component .jp-RenderedText { - text-align: left; - padding-left: var(--jp-code-padding); - font-size: var(--jp-code-font-size); - line-height: var(--jp-code-line-height); - font-family: var(--jp-code-font-family); + text-align: left; + padding-left: var(--jp-code-padding); + font-size: var(--jp-code-font-size); + line-height: var(--jp-code-line-height); + font-family: var(--jp-code-font-family); } output-component .jp-RenderedText pre, .jp-RenderedJavaScript pre, output-component .jp-RenderedHTMLCommon pre { - color: var(--jp-content-font-color1); - border: none; - margin: 0px; - padding: 0px; + color: var(--jp-content-font-color1); + border: none; + margin: 0px; + padding: 0px; } /* ansi_up creates classed spans for console foregrounds and backgrounds. */ output-component .jp-RenderedText pre .ansi-black-fg { - color: #3e424d; + color: #3e424d; } output-component .jp-RenderedText pre .ansi-red-fg { - color: #e75c58; + color: #e75c58; } output-component .jp-RenderedText pre .ansi-green-fg { - color: #00a250; + color: #00a250; } output-component .jp-RenderedText pre .ansi-yellow-fg { - color: #ddb62b; + color: #ddb62b; } output-component .jp-RenderedText pre .ansi-blue-fg { - color: #208ffb; + color: #208ffb; } output-component .jp-RenderedText pre .ansi-magenta-fg { - color: #d160c4; + color: #d160c4; } output-component .jp-RenderedText pre .ansi-cyan-fg { - color: #60c6c8; + color: #60c6c8; } output-component .jp-RenderedText pre .ansi-white-fg { - color: #c5c1b4; + color: #c5c1b4; } output-component .jp-RenderedText pre .ansi-black-bg { - background-color: #3e424d; + background-color: #3e424d; } output-component .jp-RenderedText pre .ansi-red-bg { - background-color: #e75c58; + background-color: #e75c58; } output-component .jp-RenderedText pre .ansi-green-bg { - background-color: #00a250; + background-color: #00a250; } output-component .jp-RenderedText pre .ansi-yellow-bg { - background-color: #ddb62b; + background-color: #ddb62b; } output-component .jp-RenderedText pre .ansi-blue-bg { - background-color: #208ffb; + background-color: #208ffb; } output-component .jp-RenderedText pre .ansi-magenta-bg { - background-color: #d160c4; + background-color: #d160c4; } output-component .jp-RenderedText pre .ansi-cyan-bg { - background-color: #60c6c8; + background-color: #60c6c8; } output-component .jp-RenderedText pre .ansi-white-bg { - background-color: #c5c1b4; + background-color: #c5c1b4; } output-component .jp-RenderedText pre .ansi-bright-black-fg { - color: #282c36; + color: #282c36; } output-component .jp-RenderedText pre .ansi-bright-red-fg { - color: #b22b31; + color: #b22b31; } output-component .jp-RenderedText pre .ansi-bright-green-fg { - color: #007427; + color: #007427; } output-component .jp-RenderedText pre .ansi-bright-yellow-fg { - color: #b27d12; + color: #b27d12; } output-component .jp-RenderedText pre .ansi-bright-blue-fg { - color: #0065ca; + color: #0065ca; } output-component .jp-RenderedText pre .ansi-bright-magenta-fg { - color: #a03196; + color: #a03196; } output-component .jp-RenderedText pre .ansi-bright-cyan-fg { - color: #258f8f; + color: #258f8f; } output-component .jp-RenderedText pre .ansi-bright-white-fg { - color: #a1a6b2; + color: #a1a6b2; } output-component .jp-RenderedText pre .ansi-bright-black-bg { - background-color: #282c36; + background-color: #282c36; } output-component .jp-RenderedText pre .ansi-bright-red-bg { - background-color: #b22b31; + background-color: #b22b31; } output-component .jp-RenderedText pre .ansi-bright-green-bg { - background-color: #007427; + background-color: #007427; } output-component .jp-RenderedText pre .ansi-bright-yellow-bg { - background-color: #b27d12; + background-color: #b27d12; } output-component .jp-RenderedText pre .ansi-bright-blue-bg { - background-color: #0065ca; + background-color: #0065ca; } output-component .jp-RenderedText pre .ansi-bright-magenta-bg { - background-color: #a03196; + background-color: #a03196; } output-component .jp-RenderedText pre .ansi-bright-cyan-bg { - background-color: #258f8f; + background-color: #258f8f; } output-component .jp-RenderedText pre .ansi-bright-white-bg { - background-color: #a1a6b2; + background-color: #a1a6b2; } output-component .jp-RenderedText[data-mime-type='application/vnd.jupyter.stderr'] { - background: var(--jp-rendermime-error-background); - padding-top: var(--jp-code-padding); + background: var(--jp-rendermime-error-background); + padding-top: var(--jp-code-padding); } /*----------------------------------------------------------------------------- @@ -135,14 +135,14 @@ output-component .jp-RenderedText[data-mime-type='application/vnd.jupyter.stderr |----------------------------------------------------------------------------*/ .jp-RenderedLatex { - color: var(--jp-content-font-color1); - font-size: var(--jp-content-font-size1); - line-height: var(--jp-content-line-height); + color: var(--jp-content-font-color1); + font-size: var(--jp-content-font-size1); + line-height: var(--jp-content-line-height); } /* Left-justify outputs.*/ .jp-OutputArea-output.jp-RenderedLatex { - text-align: left; + text-align: left; } /*----------------------------------------------------------------------------- @@ -150,36 +150,36 @@ output-component .jp-RenderedText[data-mime-type='application/vnd.jupyter.stderr |----------------------------------------------------------------------------*/ output-component .jp-RenderedHTMLCommon { - color: var(--jp-content-font-color1); - font-family: var(--jp-content-font-family); - font-size: var(--jp-content-font-size1); - line-height: var(--jp-content-line-height); - /* Give a bit more R padding on Markdown text to keep line lengths reasonable */ - padding-right: 20px; + color: var(--jp-content-font-color1); + font-family: var(--jp-content-font-family); + font-size: var(--jp-content-font-size1); + line-height: var(--jp-content-line-height); + /* Give a bit more R padding on Markdown text to keep line lengths reasonable */ + padding-right: 20px; } output-component .jp-RenderedHTMLCommon em { - font-style: italic; + font-style: italic; } output-component .jp-RenderedHTMLCommon strong { - font-weight: bold; + font-weight: bold; } output-component .jp-RenderedHTMLCommon u { - text-decoration: underline; + text-decoration: underline; } output-component .jp-RenderedHTMLCommon a:link { - text-decoration: none; + text-decoration: none; } output-component .jp-RenderedHTMLCommon a:hover { - text-decoration: underline; + text-decoration: underline; } output-component .jp-RenderedHTMLCommon a:visited { - text-decoration: none; + text-decoration: none; } /* Headings */ @@ -190,11 +190,11 @@ output-component .jp-RenderedHTMLCommon h3, output-component .jp-RenderedHTMLCommon h4, output-component .jp-RenderedHTMLCommon h5, output-component .jp-RenderedHTMLCommon h6 { - line-height: var(--jp-content-heading-line-height); - font-weight: var(--jp-content-heading-font-weight); - font-style: normal; - margin: var(--jp-content-heading-margin-top) 0 - var(--jp-content-heading-margin-bottom) 0; + line-height: var(--jp-content-heading-line-height); + font-weight: var(--jp-content-heading-font-weight); + font-style: normal; + margin: var(--jp-content-heading-margin-top) 0 + var(--jp-content-heading-margin-bottom) 0; } output-component .jp-RenderedHTMLCommon h1:first-child, @@ -203,7 +203,7 @@ output-component .jp-RenderedHTMLCommon h3:first-child, output-component .jp-RenderedHTMLCommon h4:first-child, output-component .jp-RenderedHTMLCommon h5:first-child, output-component .jp-RenderedHTMLCommon h6:first-child { - margin-top: calc(0.5 * var(--jp-content-heading-margin-top)); + margin-top: calc(0.5 * var(--jp-content-heading-margin-top)); } output-component .jp-RenderedHTMLCommon h1:last-child, @@ -212,194 +212,194 @@ output-component .jp-RenderedHTMLCommon h3:last-child, output-component .jp-RenderedHTMLCommon h4:last-child, output-component .jp-RenderedHTMLCommon h5:last-child, output-component .jp-RenderedHTMLCommon h6:last-child { - margin-bottom: calc(0.5 * var(--jp-content-heading-margin-bottom)); + margin-bottom: calc(0.5 * var(--jp-content-heading-margin-bottom)); } output-component .jp-RenderedHTMLCommon h1 { - font-size: var(--jp-content-font-size5); + font-size: var(--jp-content-font-size5); } output-component .jp-RenderedHTMLCommon h2 { - font-size: var(--jp-content-font-size4); + font-size: var(--jp-content-font-size4); } output-component .jp-RenderedHTMLCommon h3 { - font-size: var(--jp-content-font-size3); + font-size: var(--jp-content-font-size3); } output-component .jp-RenderedHTMLCommon h4 { - font-size: var(--jp-content-font-size2); + font-size: var(--jp-content-font-size2); } output-component .jp-RenderedHTMLCommon h5 { - font-size: var(--jp-content-font-size1); + font-size: var(--jp-content-font-size1); } output-component .jp-RenderedHTMLCommon h6 { - font-size: var(--jp-content-font-size0); + font-size: var(--jp-content-font-size0); } /* Lists */ output-component .jp-RenderedHTMLCommon ul:not(.list-inline), output-component .jp-RenderedHTMLCommon ol:not(.list-inline) { - padding-left: 2em; + padding-left: 2em; } output-component .jp-RenderedHTMLCommon ul { - list-style: disc; + list-style: disc; } output-component .jp-RenderedHTMLCommon ul ul { - list-style: square; + list-style: square; } output-component .jp-RenderedHTMLCommon ul ul ul { - list-style: circle; + list-style: circle; } output-component .jp-RenderedHTMLCommon ol { - list-style: decimal; + list-style: decimal; } output-component .jp-RenderedHTMLCommon ol ol { - list-style: upper-alpha; + list-style: upper-alpha; } output-component .jp-RenderedHTMLCommon ol ol ol { - list-style: lower-alpha; + list-style: lower-alpha; } output-component .jp-RenderedHTMLCommon ol ol ol ol { - list-style: lower-roman; + list-style: lower-roman; } output-component .jp-RenderedHTMLCommon ol ol ol ol ol { - list-style: decimal; + list-style: decimal; } output-component .jp-RenderedHTMLCommon ol, output-component .jp-RenderedHTMLCommon ul { - margin-bottom: 1em; + margin-bottom: 1em; } output-component .jp-RenderedHTMLCommon ul ul, output-component .jp-RenderedHTMLCommon ul ol, output-component .jp-RenderedHTMLCommon ol ul, output-component .jp-RenderedHTMLCommon ol ol { - margin-bottom: 0em; + margin-bottom: 0em; } output-component .jp-RenderedHTMLCommon hr { - color: var(--jp-border-color2); - background-color: var(--jp-border-color1); - margin-top: 1em; - margin-bottom: 1em; + color: var(--jp-border-color2); + background-color: var(--jp-border-color1); + margin-top: 1em; + margin-bottom: 1em; } output-component .jp-RenderedHTMLCommon > pre { - margin: 1.5em 2em; + margin: 1.5em 2em; } output-component .jp-RenderedHTMLCommon pre, output-component .jp-RenderedHTMLCommon code { - border: 0; - background-color: var(--jp-layout-color0); - color: var(--jp-content-font-color1); - font-family: var(--jp-code-font-family); - font-size: inherit; - line-height: var(--jp-code-line-height); - padding: 0; + border: 0; + background-color: var(--jp-layout-color0); + color: var(--jp-content-font-color1); + font-family: var(--jp-code-font-family); + font-size: inherit; + line-height: var(--jp-code-line-height); + padding: 0; } output-component .jp-RenderedHTMLCommon p > code { - background-color: var(--jp-layout-color2); - padding: 1px 5px; + background-color: var(--jp-layout-color2); + padding: 1px 5px; } /* Tables */ output-component .jp-RenderedHTMLCommon table { - border-collapse: collapse; - border-spacing: 0; - border: none; - color: var(--jp-ui-font-color1); - font-size: 12px; - table-layout: auto; - margin-left: auto; - margin-right: auto; + border-collapse: collapse; + border-spacing: 0; + border: none; + color: var(--jp-ui-font-color1); + font-size: 12px; + table-layout: auto; + margin-left: auto; + margin-right: auto; } output-component .jp-RenderedHTMLCommon thead { - border-bottom: var(--jp-border-width) solid var(--jp-border-color1); - vertical-align: bottom; + border-bottom: var(--jp-border-width) solid var(--jp-border-color1); + vertical-align: bottom; } output-component .jp-RenderedHTMLCommon td, output-component .jp-RenderedHTMLCommon th, output-component .jp-RenderedHTMLCommon tr { - text-align: left; - vertical-align: middle; - padding: 0.5em 0.5em; - line-height: normal; - white-space: normal; - max-width: none; - border: none; + text-align: left; + vertical-align: middle; + padding: 0.5em 0.5em; + line-height: normal; + white-space: normal; + max-width: none; + border: none; } .jp-RenderedMarkdown.jp-RenderedHTMLCommon td, .jp-RenderedMarkdown.jp-RenderedHTMLCommon th { - max-width: none; + max-width: none; } output-component th { - font-weight: bold; + font-weight: bold; } output-component .jp-RenderedHTMLCommon tbody tr:nth-child(odd) { - background: var(--jp-layout-color0); + background: var(--jp-layout-color0); } output-component .jp-RenderedHTMLCommon tbody tr:nth-child(even) { - background: var(--jp-rendermime-table-row-background); + background: var(--jp-rendermime-table-row-background); } output-component .jp-RenderedHTMLCommon tbody tr:hover { - background: var(--jp-rendermime-table-row-hover-background); + background: var(--jp-rendermime-table-row-hover-background); } output-component .jp-RenderedHTMLCommon table { - margin-bottom: 1em; - display: table-row; + margin-bottom: 1em; + display: table-row; } output-component .jp-RenderedHTMLCommon p { - text-align: left; - margin: 0px; + text-align: left; + margin: 0px; } output-component .jp-RenderedHTMLCommon p { - margin-bottom: 1em; + margin-bottom: 1em; } output-component .jp-RenderedHTMLCommon img { - -moz-force-broken-image-icon: 1; + -moz-force-broken-image-icon: 1; } /* Restrict to direct children as other images could be nested in other content. */ output-component .jp-RenderedHTMLCommon > img { - display: block; - margin-left: auto; - margin-right: auto; - margin-bottom: 1em; + display: block; + margin-left: auto; + margin-right: auto; + margin-bottom: 1em; } /* Change color behind transparent images if they need it... */ [data-theme-light='false'] .jp-RenderedImage img.jp-needs-light-background { - background-color: var(--jp-inverse-layout-color1); + background-color: var(--jp-inverse-layout-color1); } [data-theme-light='true'] .jp-RenderedImage img.jp-needs-dark-background { - background-color: var(--jp-inverse-layout-color1); + background-color: var(--jp-inverse-layout-color1); } /* ...or leave it untouched if they don't */ [data-theme-light='false'] .jp-RenderedImage img.jp-needs-dark-background { @@ -411,31 +411,31 @@ output-component .jp-RenderedHTMLCommon img, .jp-RenderedImage img, output-component .jp-RenderedHTMLCommon svg, .jp-RenderedSVG svg { - max-width: 100%; - height: auto; + max-width: 100%; + height: auto; } output-component .jp-RenderedHTMLCommon img.jp-mod-unconfined, .jp-RenderedImage img.jp-mod-unconfined, output-component .jp-RenderedHTMLCommon svg.jp-mod-unconfined, .jp-RenderedSVG svg.jp-mod-unconfined { - max-width: none; + max-width: none; } output-component .jp-RenderedHTMLCommon .alert { - margin-bottom: 1em; + margin-bottom: 1em; } output-component .jp-RenderedHTMLCommon blockquote { - margin: 1em 2em; - padding: 0 1em; - border-left: 5px solid var(--jp-border-color2); + margin: 1em 2em; + padding: 0 1em; + border-left: 5px solid var(--jp-border-color2); } a.jp-InternalAnchorLink { - visibility: hidden; - margin-left: 8px; - color: var(--md-blue-800); + visibility: hidden; + margin-left: 8px; + color: var(--md-blue-800); } h1:hover .jp-InternalAnchorLink, @@ -444,7 +444,7 @@ h3:hover .jp-InternalAnchorLink, h4:hover .jp-InternalAnchorLink, h5:hover .jp-InternalAnchorLink, h6:hover .jp-InternalAnchorLink { - visibility: visible; + visibility: visible; } /* Most direct children of .jp-RenderedHTMLCommon have a margin-bottom of 1.0. @@ -453,7 +453,7 @@ h6:hover .jp-InternalAnchorLink { * code cells. */ output-component .jp-RenderedHTMLCommon > *:last-child { - margin-bottom: 0.5em; + margin-bottom: 0.5em; } /*----------------------------------------------------------------------------- @@ -461,5 +461,5 @@ output-component .jp-RenderedHTMLCommon > *:last-child { |----------------------------------------------------------------------------*/ .jp-RenderedPDF { - font-size: var(--jp-ui-font-size1); + font-size: var(--jp-ui-font-size1); } diff --git a/src/sql/workbench/parts/notebook/cellViews/output.component.ts b/src/sql/workbench/parts/notebook/cellViews/output.component.ts index 73c656e2a0..bd2a8dd811 100644 --- a/src/sql/workbench/parts/notebook/cellViews/output.component.ts +++ b/src/sql/workbench/parts/notebook/cellViews/output.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!./code'; import 'vs/css!./media/output'; @@ -17,7 +17,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService'; import * as DOM from 'vs/base/browser/dom'; export const OUTPUT_SELECTOR: string = 'output-component'; -const USER_SELECT_CLASS ='actionselect'; +const USER_SELECT_CLASS = 'actionselect'; @Component({ selector: OUTPUT_SELECTOR, diff --git a/src/sql/workbench/parts/notebook/cellViews/outputArea.component.ts b/src/sql/workbench/parts/notebook/cellViews/outputArea.component.ts index 268de7c40d..fe149891a1 100644 --- a/src/sql/workbench/parts/notebook/cellViews/outputArea.component.ts +++ b/src/sql/workbench/parts/notebook/cellViews/outputArea.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!./code'; import 'vs/css!./outputArea'; import { OnInit, Component, Input, Inject, ElementRef, ViewChild, forwardRef, ChangeDetectorRef } from '@angular/core'; diff --git a/src/sql/workbench/parts/notebook/cellViews/outputArea.css b/src/sql/workbench/parts/notebook/cellViews/outputArea.css index c3f80f0154..031a113de6 100644 --- a/src/sql/workbench/parts/notebook/cellViews/outputArea.css +++ b/src/sql/workbench/parts/notebook/cellViews/outputArea.css @@ -18,5 +18,5 @@ output-area-component .notebook-output { .output-userselect pre{ white-space: pre-wrap; - word-wrap: break-word; -} \ No newline at end of file + word-wrap: break-word; +} diff --git a/src/sql/workbench/parts/notebook/cellViews/placeholder.css b/src/sql/workbench/parts/notebook/cellViews/placeholder.css index 976b01e323..a0f75658b7 100644 --- a/src/sql/workbench/parts/notebook/cellViews/placeholder.css +++ b/src/sql/workbench/parts/notebook/cellViews/placeholder.css @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - placeholder-cell-component { +placeholder-cell-component { height: 50px; width: 100%; display: block; @@ -12,7 +12,7 @@ placeholder-cell-component .text { display: flex; - align-items: center; + align-items: center; justify-content: center; height: 50px; -webkit-margin-before: 0em; diff --git a/src/sql/workbench/parts/notebook/cellViews/placeholderCell.component.ts b/src/sql/workbench/parts/notebook/cellViews/placeholderCell.component.ts index 838b220e38..d4511584ec 100644 --- a/src/sql/workbench/parts/notebook/cellViews/placeholderCell.component.ts +++ b/src/sql/workbench/parts/notebook/cellViews/placeholderCell.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!./placeholder'; import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, OnDestroy, ViewChild, SimpleChange, OnChanges } from '@angular/core'; @@ -49,7 +49,7 @@ export class PlaceholderCellComponent extends CellView implements OnInit, OnChan } get clickOn(): string { - return localize('clickOn','Click on'); + return localize('clickOn', 'Click on'); } get plusCode(): string { diff --git a/src/sql/workbench/parts/notebook/cellViews/textCell.component.ts b/src/sql/workbench/parts/notebook/cellViews/textCell.component.ts index 8e54f9e24c..932cf02883 100644 --- a/src/sql/workbench/parts/notebook/cellViews/textCell.component.ts +++ b/src/sql/workbench/parts/notebook/cellViews/textCell.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!./textCell'; import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, OnDestroy, ViewChild, OnChanges, SimpleChange } from '@angular/core'; @@ -25,7 +25,7 @@ import { NotebookModel } from 'sql/workbench/parts/notebook/models/notebookModel import { CellToggleMoreActions } from 'sql/workbench/parts/notebook/cellToggleMoreActions'; export const TEXT_SELECTOR: string = 'text-cell-component'; -const USER_SELECT_CLASS ='actionselect'; +const USER_SELECT_CLASS = 'actionselect'; @Component({ selector: TEXT_SELECTOR, @@ -165,7 +165,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { // If the asset is in the same folder or a subfolder, replace 'vscode-resource:' with 'file:', so the image is visible if (!path.relative(path.dirname(this.cellModel.notebookModel.notebookUri.fsPath), filePath).includes('..')) { // ok to change from vscode-resource: to file: - htmlContent = htmlContent.replace('vscode-resource:'+ filePath, 'file:' + filePath); + htmlContent = htmlContent.replace('vscode-resource:' + filePath, 'file:' + filePath); } htmlContentCopy = htmlContentCopy.slice(pathEndIndex); } @@ -190,7 +190,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { } public toggleEditMode(editMode?: boolean): void { - this.isEditMode = editMode !== undefined? editMode : !this.isEditMode; + this.isEditMode = editMode !== undefined ? editMode : !this.isEditMode; this.updateMoreActions(); this.updatePreview(); this._changeRef.detectChanges(); diff --git a/src/sql/workbench/parts/notebook/models/cell.ts b/src/sql/workbench/parts/notebook/models/cell.ts index a41db5e9a0..feb6d19bf2 100644 --- a/src/sql/workbench/parts/notebook/models/cell.ts +++ b/src/sql/workbench/parts/notebook/models/cell.ts @@ -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, ServerInfo } from 'azdata'; import { Event, Emitter } from 'vs/base/common/event'; diff --git a/src/sql/workbench/parts/notebook/models/cellMagicMapper.ts b/src/sql/workbench/parts/notebook/models/cellMagicMapper.ts index fb7435df14..45ea53bc5e 100644 --- a/src/sql/workbench/parts/notebook/models/cellMagicMapper.ts +++ b/src/sql/workbench/parts/notebook/models/cellMagicMapper.ts @@ -1,16 +1,13 @@ - /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ - -'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 { ICellMagicMapper, ILanguageMagic } from 'sql/workbench/parts/notebook/models/modelInterfaces'; const defaultKernel = '*'; export class CellMagicMapper implements ICellMagicMapper { - private kernelToMagicMap = new Map(); + private kernelToMagicMap = new Map(); constructor(languageMagics: ILanguageMagic[]) { if (languageMagics) { diff --git a/src/sql/workbench/parts/notebook/models/clientSession.ts b/src/sql/workbench/parts/notebook/models/clientSession.ts index 0070d76ed9..81b4b62e7d 100644 --- a/src/sql/workbench/parts/notebook/models/clientSession.ts +++ b/src/sql/workbench/parts/notebook/models/clientSession.ts @@ -1,13 +1,10 @@ - /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ // This code is based on @jupyterlab/packages/apputils/src/clientsession.tsx -'use strict'; - import { nb } from 'azdata'; import { URI } from 'vs/base/common/uri'; import { Event, Emitter } from 'vs/base/common/event'; @@ -274,7 +271,6 @@ export class ClientSession implements IClientSession { /** * Helper method to either call ChangeKernel on current session, or start a new session - * @param options */ private async doChangeKernel(options: nb.IKernelSpec): Promise { let kernel: nb.IKernel; diff --git a/src/sql/workbench/parts/notebook/models/contracts.ts b/src/sql/workbench/parts/notebook/models/contracts.ts index eac52e4de8..fa7fba6765 100644 --- a/src/sql/workbench/parts/notebook/models/contracts.ts +++ b/src/sql/workbench/parts/notebook/models/contracts.ts @@ -1,10 +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'; export type CellType = 'code' | 'markdown' | 'raw'; diff --git a/src/sql/workbench/parts/notebook/models/modelInterfaces.ts b/src/sql/workbench/parts/notebook/models/modelInterfaces.ts index bbc6a0dc2d..105caf94c2 100644 --- a/src/sql/workbench/parts/notebook/models/modelInterfaces.ts +++ b/src/sql/workbench/parts/notebook/models/modelInterfaces.ts @@ -1,13 +1,10 @@ - /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ // This code is based on @jupyterlab/packages/apputils/src/clientsession.tsx -'use strict'; - import { nb } from 'azdata'; import { Event } from 'vs/base/common/event'; import { IDisposable } from 'vs/base/common/lifecycle'; @@ -417,9 +414,6 @@ export interface NotebookContentChange { cellIndex?: number; /** * Optional value indicating if the notebook is in a dirty or clean state after this change - * - * @type {boolean} - * @memberof NotebookContentChange */ isDirty?: boolean; } diff --git a/src/sql/workbench/parts/notebook/models/notebookConnection.ts b/src/sql/workbench/parts/notebook/models/notebookConnection.ts index 3fdf658daf..9852f32188 100644 --- a/src/sql/workbench/parts/notebook/models/notebookConnection.ts +++ b/src/sql/workbench/parts/notebook/models/notebookConnection.ts @@ -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 { localize } from 'vs/nls'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; @@ -22,7 +19,6 @@ export namespace constants { * Long term this should be refactored to an extension contribution * * @export - * @class NotebookConnection */ export class NotebookConnection { private _host: string; diff --git a/src/sql/workbench/parts/notebook/notebook.component.ts b/src/sql/workbench/parts/notebook/notebook.component.ts index 28726e18c3..6ea2dad117 100644 --- a/src/sql/workbench/parts/notebook/notebook.component.ts +++ b/src/sql/workbench/parts/notebook/notebook.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import { OnInit, Component, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, OnDestroy } from '@angular/core'; @@ -185,7 +185,9 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe cell.trustedMode = isTrusted; }); //Updates dirty state - this._notebookParams.input && this._notebookParams.input.updateModel(); + if (this._notebookParams.input) { + this._notebookParams.input.updateModel(); + } this.detectChanges(); } diff --git a/src/sql/workbench/parts/notebook/notebook.module.ts b/src/sql/workbench/parts/notebook/notebook.module.ts index 4b09359238..b3d4c00cda 100644 --- a/src/sql/workbench/parts/notebook/notebook.module.ts +++ b/src/sql/workbench/parts/notebook/notebook.module.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ 'use strict'; diff --git a/src/sql/workbench/parts/notebook/notebookConstants.ts b/src/sql/workbench/parts/notebook/notebookConstants.ts index 54ff5d1527..f9b5c7c69d 100644 --- a/src/sql/workbench/parts/notebook/notebookConstants.ts +++ b/src/sql/workbench/parts/notebook/notebookConstants.ts @@ -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'; - export namespace nbversion { /** * The major version of the notebook format. diff --git a/src/sql/workbench/parts/notebook/notebookInput.ts b/src/sql/workbench/parts/notebook/notebookInput.ts index 284b54b83c..b8f587bc2b 100644 --- a/src/sql/workbench/parts/notebook/notebookInput.ts +++ b/src/sql/workbench/parts/notebook/notebookInput.ts @@ -252,11 +252,11 @@ export class NotebookInput extends EditorInput { return this.resource; } - public get untitledEditorModel() : UntitledEditorModel { + public get untitledEditorModel(): UntitledEditorModel { return this._untitledEditorModel; } - public set untitledEditorModel(value : UntitledEditorModel) { + public set untitledEditorModel(value: UntitledEditorModel) { this._untitledEditorModel = value; } diff --git a/src/sql/workbench/parts/notebook/outputs/common/mimemodel.ts b/src/sql/workbench/parts/notebook/outputs/common/mimemodel.ts index 29e1fddb78..04bf55db37 100644 --- a/src/sql/workbench/parts/notebook/outputs/common/mimemodel.ts +++ b/src/sql/workbench/parts/notebook/outputs/common/mimemodel.ts @@ -41,7 +41,7 @@ export class MimeModel implements IRenderMime.IMimeModel { } get themeService(): IThemeService { - return this._themeService; + return this._themeService; } /** diff --git a/src/sql/workbench/parts/notebook/outputs/common/url.ts b/src/sql/workbench/parts/notebook/outputs/common/url.ts index 12af9140a0..33cce2f760 100644 --- a/src/sql/workbench/parts/notebook/outputs/common/url.ts +++ b/src/sql/workbench/parts/notebook/outputs/common/url.ts @@ -90,11 +90,11 @@ export namespace URLExt { return ( '?' + keys - .map(key => { - const content = encodeURIComponent(String(value[key])); - return key + (content ? '=' + content : ''); - }) - .join('&') + .map(key => { + const content = encodeURIComponent(String(value[key])); + return key + (content ? '=' + content : ''); + }) + .join('&') ); } diff --git a/src/sql/workbench/parts/notebook/outputs/factories.ts b/src/sql/workbench/parts/notebook/outputs/factories.ts index 797d96806a..6853a4c172 100644 --- a/src/sql/workbench/parts/notebook/outputs/factories.ts +++ b/src/sql/workbench/parts/notebook/outputs/factories.ts @@ -13,7 +13,7 @@ export const htmlRendererFactory: IRenderMime.IRendererFactory = { safe: true, mimeTypes: ['text/html'], defaultRank: 50, - createRenderer: options => new widgets.RenderedHTML(options) + createRenderer: options => new widgets.RenderedHTML(options) }; /** diff --git a/src/sql/workbench/parts/notebook/outputs/sanitizer.ts b/src/sql/workbench/parts/notebook/outputs/sanitizer.ts index 3aceb4eca0..ff45226f43 100644 --- a/src/sql/workbench/parts/notebook/outputs/sanitizer.ts +++ b/src/sql/workbench/parts/notebook/outputs/sanitizer.ts @@ -1,4 +1,3 @@ - // Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. diff --git a/src/sql/workbench/parts/objectExplorer/browser/connectionTreeAction.ts b/src/sql/workbench/parts/objectExplorer/browser/connectionTreeAction.ts index fdc8618a0f..292d454209 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/connectionTreeAction.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/connectionTreeAction.ts @@ -41,7 +41,7 @@ export class RefreshAction extends Action { this._tree = tree; } public run(): Promise { - var treeNode: TreeNode; + let treeNode: TreeNode; if (this.element instanceof ConnectionProfile) { let connection: ConnectionProfile = this.element; if (this._connectionManagementService.isConnected(undefined, connection)) { diff --git a/src/sql/workbench/parts/objectExplorer/browser/objectExplorerActions.ts b/src/sql/workbench/parts/objectExplorer/browser/objectExplorerActions.ts index be4b4f431f..4161dac35c 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/objectExplorerActions.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/objectExplorerActions.ts @@ -183,10 +183,10 @@ export class OEScriptSelectAction extends ScriptSelectAction { this._objectExplorerTreeNode = await getTreeNode(actionContext, this._objectExplorerService); } this._treeSelectionHandler.onTreeActionStateChange(true); - var connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode); - var ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile); + let connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode); + let ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile); ownerUri = this._connectionManagementService.getFormattedUri(ownerUri, connectionProfile); - var metadata = this._objectExplorerTreeNode.metadata; + let metadata = this._objectExplorerTreeNode.metadata; return super.run({ profile: connectionProfile, object: metadata }).then((result) => { this._treeSelectionHandler.onTreeActionStateChange(false); @@ -218,8 +218,8 @@ export class OEEditDataAction extends EditDataAction { this._objectExplorerTreeNode = await getTreeNode(actionContext, this._objectExplorerService); } this._treeSelectionHandler.onTreeActionStateChange(true); - var connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode); - var metadata = (this._objectExplorerTreeNode).metadata; + let connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode); + let metadata = (this._objectExplorerTreeNode).metadata; return super.run({ profile: connectionProfile, object: metadata }).then((result) => { this._treeSelectionHandler.onTreeActionStateChange(false); @@ -252,9 +252,9 @@ export class OEScriptCreateAction extends ScriptCreateAction { this._objectExplorerTreeNode = await getTreeNode(actionContext, this._objectExplorerService); } this._treeSelectionHandler.onTreeActionStateChange(true); - var connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode); - var metadata = (this._objectExplorerTreeNode).metadata; - var ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile); + let connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode); + let metadata = (this._objectExplorerTreeNode).metadata; + let ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile); ownerUri = this._connectionManagementService.getFormattedUri(ownerUri, connectionProfile); return super.run({ profile: connectionProfile, object: metadata }).then((result) => { @@ -288,9 +288,9 @@ export class OEScriptExecuteAction extends ScriptExecuteAction { this._objectExplorerTreeNode = await getTreeNode(actionContext, this._objectExplorerService); } this._treeSelectionHandler.onTreeActionStateChange(true); - var connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode); - var metadata = (this._objectExplorerTreeNode).metadata; - var ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile); + let connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode); + let metadata = (this._objectExplorerTreeNode).metadata; + let ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile); ownerUri = this._connectionManagementService.getFormattedUri(ownerUri, connectionProfile); return super.run({ profile: connectionProfile, object: metadata }).then((result) => { @@ -324,9 +324,9 @@ export class OEScriptAlterAction extends ScriptAlterAction { this._objectExplorerTreeNode = await getTreeNode(actionContext, this._objectExplorerService); } this._treeSelectionHandler.onTreeActionStateChange(true); - var connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode); - var metadata = (this._objectExplorerTreeNode).metadata; - var ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile); + let connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode); + let metadata = (this._objectExplorerTreeNode).metadata; + let ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile); ownerUri = this._connectionManagementService.getFormattedUri(ownerUri, connectionProfile); return super.run({ profile: connectionProfile, object: metadata }).then((result) => { @@ -360,9 +360,9 @@ export class OEScriptDeleteAction extends ScriptDeleteAction { this._objectExplorerTreeNode = await getTreeNode(actionContext, this._objectExplorerService); } this._treeSelectionHandler.onTreeActionStateChange(true); - var connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode); - var metadata = (this._objectExplorerTreeNode).metadata; - var ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile); + let connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode); + let metadata = (this._objectExplorerTreeNode).metadata; + let ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile); ownerUri = this._connectionManagementService.getFormattedUri(ownerUri, connectionProfile); return super.run({ profile: connectionProfile, object: metadata }).then((result) => { @@ -410,4 +410,3 @@ export class ObjectExplorerActionUtilities { return scriptMap; } } - diff --git a/src/sql/workbench/parts/objectExplorer/browser/serverTreeController.ts b/src/sql/workbench/parts/objectExplorer/browser/serverTreeController.ts index 2db3770e4d..525c1a09c4 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/serverTreeController.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/serverTreeController.ts @@ -68,7 +68,7 @@ export class ServerTreeController extends treedefaults.DefaultController { tree.setFocus(element); - var actionContext: any; + let actionContext: any; if (element instanceof TreeNode) { let context = new ObjectExplorerActionsContext(); context.nodeInfo = element.toNodeInfo(); @@ -103,4 +103,4 @@ export class ServerTreeController extends treedefaults.DefaultController { return true; } -} \ No newline at end of file +} diff --git a/src/sql/workbench/parts/objectExplorer/browser/serverTreeDataSource.ts b/src/sql/workbench/parts/objectExplorer/browser/serverTreeDataSource.ts index 044cc0da47..8e0bc3e759 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/serverTreeDataSource.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/serverTreeDataSource.ts @@ -67,7 +67,7 @@ export class ServerTreeDataSource implements IDataSource { } else if (element instanceof ConnectionProfileGroup) { resolve((element).getChildren()); } else if (element instanceof TreeNode) { - var node = element; + let node = element; if (node.children) { resolve(node.children); } else { diff --git a/src/sql/workbench/parts/objectExplorer/browser/treeSelectionHandler.ts b/src/sql/workbench/parts/objectExplorer/browser/treeSelectionHandler.ts index c577531ffc..46f51eec50 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/treeSelectionHandler.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/treeSelectionHandler.ts @@ -69,12 +69,6 @@ export class TreeSelectionHandler { /** * - * @param connectionManagementService - * @param objectExplorerService - * @param isDoubleClick - * @param isKeyboard - * @param selection - * @param tree * @param connectionCompleteCallback A function that gets called after a connection is established due to the selection, if needed */ private handleTreeItemSelected(connectionManagementService: IConnectionManagementService, objectExplorerService: IObjectExplorerService, isDoubleClick: boolean, isKeyboard: boolean, selection: any[], tree: ITree, connectionCompleteCallback: () => void): void { @@ -117,4 +111,4 @@ export class TreeSelectionHandler { tree.toggleExpansion(selection[0]); } } -} \ No newline at end of file +} diff --git a/src/sql/workbench/parts/objectExplorer/common/treeNode.ts b/src/sql/workbench/parts/objectExplorer/common/treeNode.ts index 849654be6e..833efc8fcd 100644 --- a/src/sql/workbench/parts/objectExplorer/common/treeNode.ts +++ b/src/sql/workbench/parts/objectExplorer/common/treeNode.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import { NodeType, SqlThemeIcon } from 'sql/workbench/parts/objectExplorer/common/nodeType'; @@ -107,7 +107,7 @@ export class TreeNode { this.nodeStatus = nodeStatus; } public getConnectionProfile(): ConnectionProfile { - var currentNode: TreeNode = this; + let currentNode: TreeNode = this; while (!currentNode.connection && currentNode.parent) { currentNode = currentNode.parent; } @@ -118,7 +118,7 @@ export class TreeNode { if (this.connection) { return undefined; } - var currentNode: TreeNode = this; + let currentNode: TreeNode = this; while (currentNode.nodeTypeId !== NodeType.Database && currentNode.nodeTypeId !== NodeType.Server && currentNode.parent) { currentNode = currentNode.parent; } @@ -130,7 +130,7 @@ export class TreeNode { } public getSession(): azdata.ObjectExplorerSession { - var currentNode: TreeNode = this; + let currentNode: TreeNode = this; while (!currentNode.session && currentNode.parent) { currentNode = currentNode.parent; } @@ -172,4 +172,4 @@ export class TreeNode { public setSelected(selected: boolean, clearOtherSelections?: boolean): Thenable { return this._objectExplorerCallbacks.setNodeSelected(this, selected, clearOtherSelections); } -} \ No newline at end of file +} diff --git a/src/sql/workbench/parts/queryPlan/electron-browser/media/qp.css b/src/sql/workbench/parts/queryPlan/electron-browser/media/qp.css index c8b4120907..ae56f03dec 100644 --- a/src/sql/workbench/parts/queryPlan/electron-browser/media/qp.css +++ b/src/sql/workbench/parts/queryPlan/electron-browser/media/qp.css @@ -1,79 +1,85 @@ -div.qp-node { - margin: 2px; - padding: 2px; - border: 1px solid; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +div.qp-node { + margin: 2px; + padding: 2px; + border: 1px solid; } + div.qp-statement-header { - margin: 2px; - padding: 2px; - font-size: 12px; - line-height: normal; - } + margin: 2px; + padding: 2px; + font-size: 12px; + line-height: normal; +} div.qp-node, div.qp-tt { - font-size: 11px; - line-height: normal; + font-size: 11px; + line-height: normal; } .qp-node>div { - font-family: Monospace; - text-align: center; + font-family: Monospace; + text-align: center; } div[class|='qp-icon'] { - height: 32px; - width: 32px; - margin-left: auto; - margin-right: auto; - background-repeat: no-repeat; + height: 32px; + width: 32px; + margin-left: auto; + margin-right: auto; + background-repeat: no-repeat; } .qp-tt { - top: 4em; - left: 2em; - border: 1px solid; - padding: 2px; - width: 30em; + top: 4em; + left: 2em; + border: 1px solid; + padding: 2px; + width: 30em; } .qp-tt div, .qp-tt table { - font-family: Sans-Serif; - text-align: left; + font-family: Sans-Serif; + text-align: left; } .qp-tt table { - border-width: 0px; - border-spacing: 0px; - margin-top: 10px; - margin-bottom: 10px; - width: 100%; + border-width: 0px; + border-spacing: 0px; + margin-top: 10px; + margin-bottom: 10px; + width: 100%; } .qp-tt td, .qp-tt th { - font-size: 11px; - border-bottom: solid 1px; - padding: 1px; + font-size: 11px; + border-bottom: solid 1px; + padding: 1px; } .qp-tt td { - text-align: right; - padding-left: 10px; + text-align: right; + padding-left: 10px; } .qp-tt th { - text-align: left; + text-align: left; } .qp-bold, .qp-tt-header { - font-weight: bold; + font-weight: bold; } .qp-tt-header { - text-align: center; + text-align: center; } /* Icons */ @@ -165,54 +171,54 @@ div[class|='qp-icon'] { /* Layout - can't touch this */ .qp-tt { - position: absolute; - z-index: 1; - white-space: normal; - -webkit-transition-delay: 0.5s; - transition-delay: 0.5s; + position: absolute; + z-index: 1; + white-space: normal; + -webkit-transition-delay: 0.5s; + transition-delay: 0.5s; } div.qp-node .qp-tt, .qp-noCssTooltip div.qp-node:hover .qp-tt { - visibility: hidden; - position: absolute; - overflow: hidden; + visibility: hidden; + position: absolute; + overflow: hidden; } div.qp-node:hover .qp-tt { - visibility: visible; + visibility: visible; } .qp-tt table { - white-space: nowrap; + white-space: nowrap; } .qp-node { - position: relative; - white-space: nowrap; + position: relative; + white-space: nowrap; } .qp-tr { - display: table; + display: table; } .qp-tr>div { - display: table-cell; - padding-left: 15px; + display: table-cell; + padding-left: 15px; } .qp-root { display: table; - position: relative; + position: relative; } .qp-root svg { - position: absolute; - width: 100%; - height: 100%; - top: 0; - left: 0; - z-index: 0; - background: transparent; - pointer-events: none; + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + z-index: 0; + background: transparent; + pointer-events: none; } diff --git a/src/sql/workbench/parts/queryPlan/electron-browser/queryPlan.component.ts b/src/sql/workbench/parts/queryPlan/electron-browser/queryPlan.component.ts index 99358c89bb..ba79f112de 100644 --- a/src/sql/workbench/parts/queryPlan/electron-browser/queryPlan.component.ts +++ b/src/sql/workbench/parts/queryPlan/electron-browser/queryPlan.component.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import 'vs/css!./media/qp'; diff --git a/src/sql/workbench/parts/queryPlan/electron-browser/queryPlan.module.ts b/src/sql/workbench/parts/queryPlan/electron-browser/queryPlan.module.ts index 59cd76409c..7d90d8e097 100644 --- a/src/sql/workbench/parts/queryPlan/electron-browser/queryPlan.module.ts +++ b/src/sql/workbench/parts/queryPlan/electron-browser/queryPlan.module.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import { NgModule, Inject, forwardRef, ApplicationRef, ComponentFactoryResolver, Type } from '@angular/core'; import { APP_BASE_HREF, CommonModule } from '@angular/common'; diff --git a/src/sql/workbench/parts/taskHistory/browser/taskHistoryActionProvider.ts b/src/sql/workbench/parts/taskHistory/browser/taskHistoryActionProvider.ts index c8de09a26f..508fd20343 100644 --- a/src/sql/workbench/parts/taskHistory/browser/taskHistoryActionProvider.ts +++ b/src/sql/workbench/parts/taskHistory/browser/taskHistoryActionProvider.ts @@ -43,7 +43,7 @@ export class TaskHistoryActionProvider extends ContributableActionProvider { * Return actions for history task */ public getTaskHistoryActions(tree: ITree, element: TaskNode): IAction[] { - var actions = []; + let actions = []; // get actions for tasks in progress if (element.status === TaskStatus.InProgress && element.isCancelable) { diff --git a/src/sql/workbench/parts/taskHistory/browser/taskHistoryRenderer.ts b/src/sql/workbench/parts/taskHistory/browser/taskHistoryRenderer.ts index 47c8619341..395c8fcfcb 100644 --- a/src/sql/workbench/parts/taskHistory/browser/taskHistoryRenderer.ts +++ b/src/sql/workbench/parts/taskHistory/browser/taskHistoryRenderer.ts @@ -55,7 +55,7 @@ export class TaskHistoryRenderer implements IRenderer { const taskTemplate: ITaskHistoryTemplateData = Object.create(null); taskTemplate.root = dom.append(container, $('.task-group')); taskTemplate.icon = dom.append(taskTemplate.root, $('img.task-icon')); - var titleContainer = dom.append(taskTemplate.root, $('div.task-details')); + let titleContainer = dom.append(taskTemplate.root, $('div.task-details')); taskTemplate.title = dom.append(titleContainer, $('div.title')); taskTemplate.description = dom.append(titleContainer, $('div.description')); taskTemplate.time = dom.append(titleContainer, $('div.time')); @@ -147,7 +147,5 @@ export class TaskHistoryRenderer implements IRenderer { public disposeTemplate(tree: ITree, templateId: string, templateData: any): void { // no op // InputBox disposed in wrapUp - } } - diff --git a/src/sql/workbench/parts/taskHistory/browser/taskHistoryView.ts b/src/sql/workbench/parts/taskHistory/browser/taskHistoryView.ts index 0a52218ae3..d939abce99 100644 --- a/src/sql/workbench/parts/taskHistory/browser/taskHistoryView.ts +++ b/src/sql/workbench/parts/taskHistory/browser/taskHistoryView.ts @@ -142,7 +142,7 @@ export class TaskHistoryView { let isDoubleClick = isMouseOrigin && event.payload.originalEvent && event.payload.originalEvent.detail === 2; if (isDoubleClick) { if (task.status === TaskStatus.Failed) { - var err = task.taskName + ': ' + task.message; + let err = task.taskName + ': ' + task.message; this._errorMessageService.showDialog(Severity.Error, localize('taskError', 'Task error'), err); } } diff --git a/src/sql/workbench/parts/taskHistory/common/taskNode.ts b/src/sql/workbench/parts/taskHistory/common/taskNode.ts index ee245112ec..a7af0b5036 100644 --- a/src/sql/workbench/parts/taskHistory/common/taskNode.ts +++ b/src/sql/workbench/parts/taskHistory/common/taskNode.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import { StopWatch } from 'vs/base/common/stopwatch'; import { generateUuid } from 'vs/base/common/uuid'; diff --git a/src/sql/workbench/services/accountManagement/browser/accountManagementService.ts b/src/sql/workbench/services/accountManagement/browser/accountManagementService.ts index 45430d82b0..775d789d34 100644 --- a/src/sql/workbench/services/accountManagement/browser/accountManagementService.ts +++ b/src/sql/workbench/services/accountManagement/browser/accountManagementService.ts @@ -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 platform from 'vs/platform/registry/common/platform'; import * as statusbar from 'vs/workbench/browser/parts/statusbar/statusbar'; @@ -88,7 +86,7 @@ export class AccountManagementService implements IAccountManagementService { /** * Called from an account provider (via extension host -> main thread interop) when an * account's properties have been updated (usually when the account goes stale). - * @param {Account} updatedAccount Account with the updated properties + * @param updatedAccount Account with the updated properties */ public accountUpdated(updatedAccount: azdata.Account): Thenable { let self = this; @@ -123,8 +121,8 @@ export class AccountManagementService implements IAccountManagementService { /** * Asks the requested provider to prompt for an account - * @param {string} providerId ID of the provider to ask to prompt for an account - * @return {Thenable} Promise to return an account + * @param providerId ID of the provider to ask to prompt for an account + * @return Promise to return an account */ public addAccount(providerId: string): Thenable { let self = this; @@ -155,8 +153,8 @@ export class AccountManagementService implements IAccountManagementService { /** * Asks the requested provider to refresh an account - * @param {Account} account account to refresh - * @return {Thenable} Promise to return an account + * @param account account to refresh + * @return Promise to return an account */ public refreshAccount(account: azdata.Account): Thenable { let self = this; @@ -187,7 +185,7 @@ export class AccountManagementService implements IAccountManagementService { /** * Retrieves metadata of all providers that have been registered - * @returns {Thenable} Registered account providers + * @returns Registered account providers */ public getAccountProviderMetadata(): Thenable { return Promise.resolve(Object.values(this._providers).map(provider => provider.metadata)); @@ -195,8 +193,8 @@ export class AccountManagementService implements IAccountManagementService { /** * Retrieves the accounts that belong to a specific provider - * @param {string} providerId ID of the provider the returned accounts belong to - * @returns {Thenable} Promise to return a list of accounts + * @param providerId ID of the provider the returned accounts belong to + * @returns Promise to return a list of accounts */ public getAccountsForProvider(providerId: string): Thenable { let self = this; @@ -214,9 +212,9 @@ export class AccountManagementService implements IAccountManagementService { /** * Generates a security token by asking the account's provider - * @param {Account} account Account to generate security token for - * @param {azdata.AzureResource} resource The resource to get the security token for - * @return {Thenable<{}>} Promise to return the security token + * @param account Account to generate security token for + * @param resource The resource to get the security token for + * @return Promise to return the security token */ public getSecurityToken(account: azdata.Account, resource: azdata.AzureResource): Thenable<{}> { return this.doWithProvider(account.key.providerId, provider => { @@ -226,8 +224,8 @@ export class AccountManagementService implements IAccountManagementService { /** * Removes an account from the account store and clears sensitive data in the provider - * @param {AccountKey} accountKey Key for the account to remove - * @returns {Thenable} Promise with result of account removal, true if account was + * @param accountKey Key for the account to remove + * @returns Promise with result of account removal, true if account was * removed, false otherwise. */ public removeAccount(accountKey: azdata.AccountKey): Thenable { @@ -263,7 +261,7 @@ export class AccountManagementService implements IAccountManagementService { // UI METHODS ////////////////////////////////////////////////////////// /** * Opens the account list dialog - * @return {TPromise} Promise that finishes when the account list dialog opens + * @return Promise that finishes when the account list dialog opens */ public openAccountListDialog(): Thenable { let self = this; @@ -285,7 +283,7 @@ export class AccountManagementService implements IAccountManagementService { /** * Begin auto OAuth device code open add account dialog - * @return {TPromise} Promise that finishes when the account list dialog opens + * @return Promise that finishes when the account list dialog opens */ public beginAutoOAuthDeviceCode(providerId: string, title: string, message: string, userCode: string, uri: string): Thenable { let self = this; @@ -325,8 +323,8 @@ export class AccountManagementService implements IAccountManagementService { // SERVICE MANAGEMENT METHODS ////////////////////////////////////////// /** * Called by main thread to register an account provider from extension - * @param {azdata.AccountProviderMetadata} providerMetadata Metadata of the provider that is being registered - * @param {azdata.AccountProvider} provider References to the methods of the provider + * @param providerMetadata Metadata of the provider that is being registered + * @param provider References to the methods of the provider */ public registerProvider(providerMetadata: azdata.AccountProviderMetadata, provider: azdata.AccountProvider): Thenable { let self = this; diff --git a/src/sql/workbench/services/commandLine/common/commandLineService.ts b/src/sql/workbench/services/commandLine/common/commandLineService.ts index 1d9e85553f..313d424e6b 100644 --- a/src/sql/workbench/services/commandLine/common/commandLineService.ts +++ b/src/sql/workbench/services/commandLine/common/commandLineService.ts @@ -2,10 +2,10 @@ * 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 { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; -import {ConnectionProfileGroup} from 'sql/platform/connection/common/connectionProfileGroup'; +import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup'; import { equalsIgnoreCase } from 'vs/base/common/strings'; import { ICommandLineProcessing } from 'sql/workbench/services/commandLine/common/commandLine'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; @@ -20,10 +20,10 @@ import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/co import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { warn } from 'sql/base/common/log'; -import { ipcRenderer as ipc} from 'electron'; +import { ipcRenderer as ipc } from 'electron'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IStatusbarService, StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar'; +import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; import { localize } from 'vs/nls'; export class CommandLineService implements ICommandLineProcessing { @@ -32,7 +32,7 @@ export class CommandLineService implements ICommandLineProcessing { constructor( @ICapabilitiesService private _capabilitiesService: ICapabilitiesService, @IConnectionManagementService private _connectionManagementService: IConnectionManagementService, - @IEnvironmentService private _environmentService: IEnvironmentService, + @IEnvironmentService environmentService: IEnvironmentService, @IQueryEditorService private _queryEditorService: IQueryEditorService, @IObjectExplorerService private _objectExplorerService: IObjectExplorerService, @IEditorService private _editorService: IEditorService, @@ -41,16 +41,15 @@ export class CommandLineService implements ICommandLineProcessing { @IStatusbarService private _statusBarService: IStatusbarService ) { if (ipc) { - ipc.on('ads:processCommandLine', (event: any, args: ParsedArgs) => this.onLaunched(args)); + ipc.on('ads:processCommandLine', (event: any, args: ParsedArgs) => this.onLaunched(args)); } // we only get the ipc from main during window reuse - if (_environmentService) { - this.onLaunched(_environmentService.args); + if (environmentService) { + this.onLaunched(environmentService.args); } } - private onLaunched(args: ParsedArgs) - { + private onLaunched(args: ParsedArgs) { const registry = platform.Registry.as(ConnectionProviderExtensions.ConnectionProviderContributions); let sqlProvider = registry.getProperties(Constants.mssqlProviderName); // We can't connect to object explorer until the MSSQL connection provider is registered @@ -81,7 +80,7 @@ export class CommandLineService implements ICommandLineProcessing { if (args.server) { profile = this.readProfileFromArgs(args); } - } + } let showConnectDialogOnStartup: boolean = this._configurationService.getValue('workbench.showConnectDialogOnStartup'); if (showConnectDialogOnStartup && !commandName && !profile && !this._connectionManagementService.hasRegisteredServers()) { // prompt the user for a new connection on startup if no profiles are registered @@ -90,9 +89,8 @@ export class CommandLineService implements ICommandLineProcessing { } let connectedContext: azdata.ConnectedContext = undefined; if (profile) { - if (this._statusBarService) - { - this._statusBarService.setStatusMessage(localize('connectingLabel','Connecting:') + profile.serverName, 2500); + if (this._statusBarService) { + this._statusBarService.setStatusMessage(localize('connectingLabel', 'Connecting:') + profile.serverName, 2500); } try { await this._connectionManagementService.connectIfNotConnected(profile, 'connection', true); @@ -105,15 +103,13 @@ export class CommandLineService implements ICommandLineProcessing { } } if (commandName) { - if (this._statusBarService) - { - this._statusBarService.setStatusMessage(localize('runningCommandLabel','Running command:') + commandName, 2500); + if (this._statusBarService) { + this._statusBarService.setStatusMessage(localize('runningCommandLabel', 'Running command:') + commandName, 2500); } await this._commandService.executeCommand(commandName, connectedContext); } else if (profile) { - if (this._statusBarService) - { - this._statusBarService.setStatusMessage(localize('openingNewQueryLabel','Opening new query:') + profile.serverName, 2500); + if (this._statusBarService) { + this._statusBarService.setStatusMessage(localize('openingNewQueryLabel', 'Opening new query:') + profile.serverName, 2500); } // Default to showing new query try { @@ -146,29 +142,26 @@ export class CommandLineService implements ICommandLineProcessing { return this._connectionManagementService ? this.tryMatchSavedProfile(profile) : profile; } - private tryMatchSavedProfile(profile: ConnectionProfile) - { + private tryMatchSavedProfile(profile: ConnectionProfile) { let match: ConnectionProfile = undefined; // If we can find a saved mssql provider connection that matches the args, use it let groups = this._connectionManagementService.getConnectionGroups([Constants.mssqlProviderName]); - if (groups && groups.length > 0) - { + if (groups && groups.length > 0) { let rootGroup = groups[0]; let connections = ConnectionProfileGroup.getConnectionsInGroup(rootGroup); - match = connections.find((c) => this.matchProfile(profile, c)) ; + match = connections.find((c) => this.matchProfile(profile, c)); } return match ? match : profile; } // determines if the 2 profiles are a functional match // profile1 is the profile generated from command line parameters - private matchProfile(profile1: ConnectionProfile, profile2: ConnectionProfile): boolean - { - return equalsIgnoreCase(profile1.serverName,profile2.serverName) - && equalsIgnoreCase(profile1.providerName, profile2.providerName) - // case sensitive servers can have 2 databases whose name differs only in case - && profile1.databaseName === profile2.databaseName - && equalsIgnoreCase(profile1.userName, profile2.userName) - && profile1.authenticationType === profile2.authenticationType; + private matchProfile(profile1: ConnectionProfile, profile2: ConnectionProfile): boolean { + return equalsIgnoreCase(profile1.serverName, profile2.serverName) + && equalsIgnoreCase(profile1.providerName, profile2.providerName) + // case sensitive servers can have 2 databases whose name differs only in case + && profile1.databaseName === profile2.databaseName + && equalsIgnoreCase(profile1.userName, profile2.userName) + && profile1.authenticationType === profile2.authenticationType; } } diff --git a/src/sql/workbench/services/connection/browser/connectionController.ts b/src/sql/workbench/services/connection/browser/connectionController.ts index 302f732d5f..60597f4fd4 100644 --- a/src/sql/workbench/services/connection/browser/connectionController.ts +++ b/src/sql/workbench/services/connection/browser/connectionController.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; import { IConnectionComponentCallbacks, IConnectionComponentController, IConnectionValidateResult } from 'sql/workbench/services/connection/browser/connectionDialogService'; import { AdvancedPropertiesController } from 'sql/workbench/parts/connection/browser/advancedPropertiesController'; @@ -40,7 +38,7 @@ export class ConnectionController implements IConnectionComponentController { this._connectionManagementService = connectionManagementService; this._callback = callback; this._providerOptions = connectionProperties.connectionOptions; - var specialOptions = this._providerOptions.filter( + let specialOptions = this._providerOptions.filter( (property) => (property.specialValueType !== null && property.specialValueType !== undefined)); this._connectionWidget = this._instantiationService.createInstance(ConnectionWidget, specialOptions, { onSetConnectButton: (enable: boolean) => this._callback.onSetConnectButton(enable), @@ -100,8 +98,8 @@ export class ConnectionController implements IConnectionComponentController { } private handleonSetAzureTimeOut(): void { - var timeoutPropertyName = 'connectTimeout'; - var timeoutOption = this._model.options[timeoutPropertyName]; + let timeoutPropertyName = 'connectTimeout'; + let timeoutOption = this._model.options[timeoutPropertyName]; if (timeoutOption === undefined || timeoutOption === null) { this._model.options[timeoutPropertyName] = 30; } @@ -111,7 +109,7 @@ export class ConnectionController implements IConnectionComponentController { if (!this._advancedController) { this._advancedController = this._instantiationService.createInstance(AdvancedPropertiesController, () => this._connectionWidget.focusOnAdvancedButton()); } - var advancedOption = this._providerOptions.filter( + let advancedOption = this._providerOptions.filter( (property) => (property.specialValueType === undefined || property.specialValueType === null)); this._advancedController.showDialog(advancedOption, this._container, this._model.options); } @@ -133,8 +131,8 @@ export class ConnectionController implements IConnectionComponentController { } private getAllServerGroups(providers?: string[]): IConnectionProfileGroup[] { - var connectionGroupRoot = this._connectionManagementService.getConnectionGroups(providers); - var connectionGroupNames: IConnectionProfileGroup[] = []; + let connectionGroupRoot = this._connectionManagementService.getConnectionGroups(providers); + let connectionGroupNames: IConnectionProfileGroup[] = []; if (connectionGroupRoot && connectionGroupRoot.length > 0) { this.getServerGroupHelper(connectionGroupRoot[0], connectionGroupNames); } diff --git a/src/sql/workbench/services/connection/browser/connectionDialogService.ts b/src/sql/workbench/services/connection/browser/connectionDialogService.ts index c301a3e5e0..1890e2a25b 100644 --- a/src/sql/workbench/services/connection/browser/connectionDialogService.ts +++ b/src/sql/workbench/services/connection/browser/connectionDialogService.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { IConnectionManagementService, ConnectionType, INewConnectionParams, IConnectionCompletionOptions, IConnectionResult @@ -302,7 +300,7 @@ export class ConnectionDialogService implements IConnectionDialogService { private handleFillInConnectionInputs(connectionInfo: IConnectionProfile): void { this._connectionManagementService.addSavedPassword(connectionInfo).then(connectionWithPassword => { - var model = this.createModel(connectionWithPassword); + let model = this.createModel(connectionWithPassword); this._model = model; this.uiController.fillInConnectionInputs(model); }); diff --git a/src/sql/workbench/services/connection/browser/connectionWidget.ts b/src/sql/workbench/services/connection/browser/connectionWidget.ts index c5eac58251..08f42ff851 100644 --- a/src/sql/workbench/services/connection/browser/connectionWidget.ts +++ b/src/sql/workbench/services/connection/browser/connectionWidget.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import 'vs/css!./media/sqlConnection'; import { Button } from 'sql/base/browser/ui/button/button'; @@ -110,12 +108,12 @@ export class ConnectionWidget { this._callbacks = callbacks; this._toDispose = []; this._optionsMaps = {}; - for (var i = 0; i < options.length; i++) { - var option = options[i]; + for (let i = 0; i < options.length; i++) { + let option = options[i]; this._optionsMaps[option.specialValueType] = option; } - var authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType]; + let authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType]; if (authTypeOption) { if (OS === OperatingSystem.Windows) { authTypeOption.defaultValue = this.getAuthTypeDisplayName(AuthenticationType.Integrated); @@ -571,7 +569,7 @@ export class ConnectionWidget { } if (connectionInfo.authenticationType !== null && connectionInfo.authenticationType !== undefined) { - var authTypeDisplayName = this.getAuthTypeDisplayName(connectionInfo.authenticationType); + let authTypeDisplayName = this.getAuthTypeDisplayName(connectionInfo.authenticationType); this._authTypeSelectBox.selectWithOptionName(authTypeDisplayName); } @@ -607,8 +605,8 @@ export class ConnectionWidget { } private getAuthTypeDisplayName(authTypeName: string) { - var displayName: string; - var authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType]; + let displayName: string; + let authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType]; if (authTypeOption) { authTypeOption.categoryValues.forEach(c => { @@ -621,8 +619,8 @@ export class ConnectionWidget { } private getAuthTypeName(authTypeDisplayName: string) { - var authTypeName: string; - var authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType]; + let authTypeName: string; + let authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType]; authTypeOption.categoryValues.forEach(c => { if (c.displayName === authTypeDisplayName) { authTypeName = c.name; diff --git a/src/sql/workbench/services/connection/common/connectionDialogService.ts b/src/sql/workbench/services/connection/common/connectionDialogService.ts index 87a0b09cdf..7934078906 100644 --- a/src/sql/workbench/services/connection/common/connectionDialogService.ts +++ b/src/sql/workbench/services/connection/common/connectionDialogService.ts @@ -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 { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { INewConnectionParams, IConnectionResult, IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; @@ -13,21 +12,12 @@ export interface IConnectionDialogService { _serviceBrand: any; /** * Opens the connection dialog and returns the promise for successfully opening the dialog - * @param connectionManagementService - * @param params - * @param model - * @param connectionResult */ showDialog(connectionManagementService: IConnectionManagementService, params: INewConnectionParams, model: IConnectionProfile, connectionResult?: IConnectionResult): Thenable; /** * Opens the connection dialog and returns the promise when connection is made * or dialog is closed - * @param connectionManagementService - * @param params - * @param model - * @param connectionResult */ openDialogAndWait(connectionManagementService: IConnectionManagementService, params?: INewConnectionParams, model?: IConnectionProfile, connectionResult?: IConnectionResult, doConnect?: boolean): Thenable; } - diff --git a/src/sql/workbench/services/dashboard/browser/newDashboardTabDialog.ts b/src/sql/workbench/services/dashboard/browser/newDashboardTabDialog.ts index 13feb71f87..06c16ae4f6 100644 --- a/src/sql/workbench/services/dashboard/browser/newDashboardTabDialog.ts +++ b/src/sql/workbench/services/dashboard/browser/newDashboardTabDialog.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import 'vs/css!sql/media/icons/common-icons'; import 'vs/css!./media/newDashboardTabDialog'; @@ -27,7 +25,6 @@ import * as TelemetryKeys from 'sql/platform/telemetry/telemetryKeys'; import { NewDashboardTabViewModel, IDashboardUITab } from 'sql/workbench/services/dashboard/common/newDashboardTabViewModel'; import { IDashboardTab } from 'sql/platform/dashboard/common/dashboardRegistry'; import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService'; -import { Orientation } from 'vs/base/browser/ui/sash/sash'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; class ExtensionListDelegate implements IListVirtualDelegate { @@ -67,7 +64,7 @@ class ExtensionListRenderer implements IListRenderer; diff --git a/src/sql/workbench/services/errorMessage/browser/media/errorMessageDialog.css b/src/sql/workbench/services/errorMessage/browser/media/errorMessageDialog.css index fbda875136..abd887ee1c 100644 --- a/src/sql/workbench/services/errorMessage/browser/media/errorMessageDialog.css +++ b/src/sql/workbench/services/errorMessage/browser/media/errorMessageDialog.css @@ -2,7 +2,8 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - .error-dialog { + +.error-dialog { padding: 15px; overflow: auto; height: 200px; diff --git a/src/sql/workbench/services/fileBrowser/browser/fileBrowserController.ts b/src/sql/workbench/services/fileBrowser/browser/fileBrowserController.ts index e2d7c8840e..f20bea760e 100644 --- a/src/sql/workbench/services/fileBrowser/browser/fileBrowserController.ts +++ b/src/sql/workbench/services/fileBrowser/browser/fileBrowserController.ts @@ -3,7 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; import { ITree } from 'vs/base/parts/tree/browser/tree'; import treedefaults = require('vs/base/parts/tree/browser/treeDefaults'); import { IMouseEvent } from 'vs/base/browser/mouseEvent'; @@ -21,12 +20,12 @@ export class FileBrowserController extends treedefaults.DefaultController { protected onLeftClick(tree: ITree, element: any, event: IMouseEvent, origin: string = 'mouse'): boolean { // In file browser, double clicking an element calls tree.dispose(). There should not be any tree events after selection. if (event.detail === 2) { - var payload = { origin: origin, originalEvent: event }; + let payload = { origin: origin, originalEvent: event }; if (tree.getInput() === element) { tree.clearFocus(payload); tree.clearSelection(payload); } else { - var isMouseDown = event && event.browserEvent && event.browserEvent.type === 'mousedown'; + let isMouseDown = event && event.browserEvent && event.browserEvent.type === 'mousedown'; if (!isMouseDown) { event.preventDefault(); // we cannot preventDefault onMouseDown because this would break DND otherwise } @@ -41,16 +40,16 @@ export class FileBrowserController extends treedefaults.DefaultController { } protected onEnter(tree: ITree, event: IKeyboardEvent): boolean { - var payload = { origin: 'keyboard', originalEvent: event }; + let payload = { origin: 'keyboard', originalEvent: event }; if (tree.getHighlight()) { return false; } - var focus = tree.getFocus(); + let focus = tree.getFocus(); if (focus) { // In file browser, pressing enter key on an element will close dialog and call tree.dispose(). There should not be any tree events after selection. tree.setSelection([focus], payload); } return true; } -} \ No newline at end of file +} diff --git a/src/sql/workbench/services/fileBrowser/browser/fileBrowserDataSource.ts b/src/sql/workbench/services/fileBrowser/browser/fileBrowserDataSource.ts index 7cbc8b6f47..b53e0adda2 100644 --- a/src/sql/workbench/services/fileBrowser/browser/fileBrowserDataSource.ts +++ b/src/sql/workbench/services/fileBrowser/browser/fileBrowserDataSource.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { IFileBrowserService } from 'sql/platform/fileBrowser/common/interfaces'; import { FileNode } from 'sql/workbench/services/fileBrowser/common/fileNode'; import { ITree, IDataSource } from 'vs/base/parts/tree/browser/tree'; @@ -47,7 +45,7 @@ export class FileBrowserDataSource implements IDataSource { public getChildren(tree: ITree, element: any): Promise { return new Promise((resolve) => { if (element instanceof FileNode) { - var node = element; + let node = element; if (node.children) { resolve(node.children); } else { @@ -69,4 +67,4 @@ export class FileBrowserDataSource implements IDataSource { public getParent(tree: ITree, element: any): Promise { return Promise.resolve(null); } -} \ No newline at end of file +} diff --git a/src/sql/workbench/services/fileBrowser/browser/fileBrowserRenderer.ts b/src/sql/workbench/services/fileBrowser/browser/fileBrowserRenderer.ts index cf033b0846..e249fb5e8f 100644 --- a/src/sql/workbench/services/fileBrowser/browser/fileBrowserRenderer.ts +++ b/src/sql/workbench/services/fileBrowser/browser/fileBrowserRenderer.ts @@ -3,7 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; import { FileNode } from 'sql/workbench/services/fileBrowser/common/fileNode'; import { ITree, IRenderer } from 'vs/base/parts/tree/browser/tree'; import { FileKind } from 'vs/platform/files/common/files'; @@ -61,8 +60,8 @@ export class FileBrowserRenderer implements IRenderer { templateData.label.element.style.display = 'flex'; const extraClasses = ['explorer-item']; - var fileuri = URI.file(element.fullPath); - var filekind; + let fileuri = URI.file(element.fullPath); + let filekind; if (element.parent === null) { filekind = FileKind.ROOT_FOLDER; } else if (element.isFile === false) { diff --git a/src/sql/workbench/services/fileBrowser/common/fileBrowserViewModel.ts b/src/sql/workbench/services/fileBrowser/common/fileBrowserViewModel.ts index 17df93de91..ab559ea3fc 100644 --- a/src/sql/workbench/services/fileBrowser/common/fileBrowserViewModel.ts +++ b/src/sql/workbench/services/fileBrowser/common/fileBrowserViewModel.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { IFileBrowserService } from 'sql/platform/fileBrowser/common/interfaces'; import { localize } from 'vs/nls'; @@ -18,7 +16,7 @@ export class FileBrowserViewModel { private _fileValidationServiceType: string; public formattedFileFilters: string[]; - constructor( @IFileBrowserService private _fileBrowserService: IFileBrowserService) { + constructor(@IFileBrowserService private _fileBrowserService: IFileBrowserService) { } public onAddFileTree(onAddFileTreeCallback) { @@ -44,8 +42,8 @@ export class FileBrowserViewModel { this._fileFilters = fileFilters; } this.formattedFileFilters = []; - for (var i = 0; i < this._fileFilters.length; i++) { - var filterStr = this._fileFilters[i].label + '(' + this._fileFilters[i].filters.join(';') + ')'; + for (let i = 0; i < this._fileFilters.length; i++) { + let filterStr = this._fileFilters[i].label + '(' + this._fileFilters[i].filters.join(';') + ')'; this.formattedFileFilters.push(filterStr); } } @@ -63,4 +61,4 @@ export class FileBrowserViewModel { public closeFileBrowser() { this._fileBrowserService.closeFileBrowser(this._ownerUri); } -} \ No newline at end of file +} diff --git a/src/sql/workbench/services/fileBrowser/common/fileNode.ts b/src/sql/workbench/services/fileBrowser/common/fileNode.ts index 1bb1490eb1..50cc4b1e81 100644 --- a/src/sql/workbench/services/fileBrowser/common/fileNode.ts +++ b/src/sql/workbench/services/fileBrowser/common/fileNode.ts @@ -1,8 +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'; + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + import { generateUuid } from 'vs/base/common/uuid'; /** diff --git a/src/sql/workbench/services/insights/browser/insightsDialogService.ts b/src/sql/workbench/services/insights/browser/insightsDialogService.ts index 495557beb6..3632266e2c 100644 --- a/src/sql/workbench/services/insights/browser/insightsDialogService.ts +++ b/src/sql/workbench/services/insights/browser/insightsDialogService.ts @@ -17,7 +17,7 @@ export class InsightsDialogService implements IInsightsDialogService { private _insightsDialogView: InsightsDialogView; private _insightsDialogModel: IInsightsDialogModel; - constructor( @IInstantiationService private _instantiationService: IInstantiationService) { } + constructor(@IInstantiationService private _instantiationService: IInstantiationService) { } // query string public show(input: IInsightsConfig, connectionProfile: IConnectionProfile): void { diff --git a/src/sql/workbench/services/insights/browser/insightsDialogView.ts b/src/sql/workbench/services/insights/browser/insightsDialogView.ts index 1ccd6e1609..db3a6a9f71 100644 --- a/src/sql/workbench/services/insights/browser/insightsDialogView.ts +++ b/src/sql/workbench/services/insights/browser/insightsDialogView.ts @@ -403,7 +403,6 @@ export class InsightsDialogView extends Modal { /** * Creates the context that should be passed to the action passed on the selected element for the top table - * @param element */ private topInsightContext(element: ListResource): IConnectionProfile { let database = this._insight.actions.database || this._connectionProfile.databaseName; @@ -451,7 +450,6 @@ export class InsightsDialogView extends Modal { /** * Creates the context that should be passed to the action passed on the selected element for the bottom table - * @param element */ private bottomInsightContext(element: ListResource, cell: Slick.Cell): IInsightDialogActionContext { diff --git a/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts b/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts index 9b6842a8fc..45e92e98a6 100644 --- a/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts +++ b/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts @@ -116,7 +116,7 @@ export class NotebookService extends Disposable implements INotebookService { notebookRegistry.providers.forEach(p => { // Don't need to re-register SQL_NOTEBOOK_PROVIDER if (p.provider !== SQL_NOTEBOOK_PROVIDER) { - this.updateRegisteredProviders({id: p.provider, registration: p}); + this.updateRegisteredProviders({ id: p.provider, registration: p }); } }); } diff --git a/src/sql/workbench/services/notebook/node/localContentManager.ts b/src/sql/workbench/services/notebook/node/localContentManager.ts index e5983abe94..8cfefe65d5 100644 --- a/src/sql/workbench/services/notebook/node/localContentManager.ts +++ b/src/sql/workbench/services/notebook/node/localContentManager.ts @@ -5,8 +5,6 @@ // Note: the code in the v3 and v4 namespaces has been adapted (with significant changes) from https://github.com/nteract/nteract/tree/master/packages/commutable -'use strict'; - import { nb } from 'azdata'; import * as json from 'vs/base/common/json'; @@ -347,7 +345,7 @@ namespace v3 { pdf: 'application/pdf' }; type MimeTypeKey = keyof typeof VALID_MIMETYPES; - type MimePayload = {[P in MimeTypeKey]?: nb.MultilineString }; + type MimePayload = { [P in MimeTypeKey]?: nb.MultilineString }; interface MimeOutput extends MimePayload { output_type: T; diff --git a/src/sql/workbench/services/notebook/sql/sqlSessionManager.ts b/src/sql/workbench/services/notebook/sql/sqlSessionManager.ts index 8b33954e69..c49e0fdaf6 100644 --- a/src/sql/workbench/services/notebook/sql/sqlSessionManager.ts +++ b/src/sql/workbench/services/notebook/sql/sqlSessionManager.ts @@ -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 os from 'os'; import { nb, QueryExecuteSubsetResult, IDbColumn, BatchSummary, IResultMessage, ResultSetSummary } from 'azdata'; @@ -432,7 +431,7 @@ export class SQLFuture extends Disposable implements FutureInternal { if (rowCount > 0) { subsetResult = await this._queryRunner.getQueryRows(0, rowCount, resultSet.batchId, resultSet.id); } else { - subsetResult = { message: '', resultSubset: { rowCount: 0, rows: [] }}; + subsetResult = { message: '', resultSubset: { rowCount: 0, rows: [] } }; } let msg: nb.IIOPubMessage = { channel: 'iopub', diff --git a/src/sql/workbench/services/objectExplorer/common/objectExplorerService.ts b/src/sql/workbench/services/objectExplorer/common/objectExplorerService.ts index 754e233129..fd6e607747 100644 --- a/src/sql/workbench/services/objectExplorer/common/objectExplorerService.ts +++ b/src/sql/workbench/services/objectExplorer/common/objectExplorerService.ts @@ -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 { NodeType } from 'sql/workbench/parts/objectExplorer/common/nodeType'; import { TreeNode, TreeItemCollapsibleState } from 'sql/workbench/parts/objectExplorer/common/treeNode'; @@ -190,8 +189,8 @@ export class ObjectExplorerService implements IObjectExplorerService { public deleteObjectExplorerNode(connection: IConnectionProfile): Thenable { let self = this; - var connectionUri = connection.id; - var nodeTree = this._activeObjectExplorerNodes[connectionUri]; + let connectionUri = connection.id; + let nodeTree = this._activeObjectExplorerNodes[connectionUri]; if (nodeTree) { return self.closeSession(connection.providerName, nodeTree.getSession()).then(() => { delete self._activeObjectExplorerNodes[connectionUri]; diff --git a/src/sql/workbench/services/queryEditor/common/queryEditorService.ts b/src/sql/workbench/services/queryEditor/common/queryEditorService.ts index 2ceccfb734..7a8bd669b8 100644 --- a/src/sql/workbench/services/queryEditor/common/queryEditorService.ts +++ b/src/sql/workbench/services/queryEditor/common/queryEditorService.ts @@ -23,7 +23,7 @@ export interface IQueryEditorService { _serviceBrand: any; // Creates new untitled document for SQL queries and opens it in a new editor tab - newSqlEditor(sqlContent?: string, connectionProviderName?: string, isDirty?: boolean, objectName?:string ): Promise; + newSqlEditor(sqlContent?: string, connectionProviderName?: string, isDirty?: boolean, objectName?: string): Promise; // Creates a new query plan document newQueryPlanEditor(xmlShowPlan: string): Promise; @@ -34,9 +34,8 @@ export interface IQueryEditorService { /** * Handles updating of SQL files on a save as event. These need special consideration * due to query results and other information being tied to the URI of the file - * @param {URI} oldResource URI of the file before the save as was completed - * @param {URI} newResource URI of the file after the save as operation was completed - * @memberof IQueryEditorService + * @param oldResource URI of the file before the save as was completed + * @param newResource URI of the file after the save as operation was completed */ onSaveAsCompleted(oldResource: URI, newResource: URI): void; -} \ No newline at end of file +} diff --git a/src/sqltest/parts/commandLine/commandLineService.test.ts b/src/sqltest/parts/commandLine/commandLineService.test.ts index 7c890a3de9..46c052eafa 100644 --- a/src/sqltest/parts/commandLine/commandLineService.test.ts +++ b/src/sqltest/parts/commandLine/commandLineService.test.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as assert from 'assert'; import * as TypeMoq from 'typemoq'; import * as azdata from 'azdata'; @@ -178,7 +176,7 @@ suite('commandLineService tests', () => { try { await service.processCommandLine(new TestParsedArgs()); connectionManagementService.verifyAll(); - } catch (error){ + } catch (error) { assert.fail(error, null, 'processCommandLine rejected ' + error); } }); @@ -316,22 +314,22 @@ suite('commandLineService tests', () => { const connectionManagementService: TypeMoq.Mock = TypeMoq.Mock.ofType(TestConnectionManagementService, TypeMoq.MockBehavior.Strict); - var connection = new ConnectionProfile(capabilitiesService, { - connectionName: 'Test', - savePassword: false, - groupFullName: 'testGroup', - serverName: 'myserver', - databaseName: 'mydatabase', - authenticationType: Constants.integrated, - password: undefined, - userName: '', - groupId: undefined, - providerName: 'MSSQL', - options: {}, - saveProfile: true, - id: 'testID' - }); - var conProfGroup = new ConnectionProfileGroup('testGroup', undefined, 'testGroup', undefined, undefined); + let connection = new ConnectionProfile(capabilitiesService, { + connectionName: 'Test', + savePassword: false, + groupFullName: 'testGroup', + serverName: 'myserver', + databaseName: 'mydatabase', + authenticationType: Constants.integrated, + password: undefined, + userName: '', + groupId: undefined, + providerName: 'MSSQL', + options: {}, + saveProfile: true, + id: 'testID' + }); + let conProfGroup = new ConnectionProfileGroup('testGroup', undefined, 'testGroup', undefined, undefined); conProfGroup.connections = [connection]; const args: TestParsedArgs = new TestParsedArgs(); args.server = 'myserver'; diff --git a/src/sqltest/parts/common/optionsDialogHelper.test.ts b/src/sqltest/parts/common/optionsDialogHelper.test.ts index 7b560d5d7e..d1465fa645 100644 --- a/src/sqltest/parts/common/optionsDialogHelper.test.ts +++ b/src/sqltest/parts/common/optionsDialogHelper.test.ts @@ -3,7 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; import * as OptionsDialogHelper from 'sql/workbench/browser/modal/optionsDialogHelper'; import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox'; import * as azdata from 'azdata'; @@ -13,18 +12,18 @@ import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes'; import { $ } from 'vs/base/browser/dom'; suite('Advanced options helper tests', () => { - var possibleInputs: string[]; + let possibleInputs: string[]; let options: { [name: string]: any }; - var categoryOption: azdata.ServiceOption; - var booleanOption: azdata.ServiceOption; - var numberOption: azdata.ServiceOption; - var stringOption: azdata.ServiceOption; - var defaultGroupOption: azdata.ServiceOption; - var isValid: boolean; - var inputValue: string; - var inputBox: TypeMoq.Mock; + let categoryOption: azdata.ServiceOption; + let booleanOption: azdata.ServiceOption; + let numberOption: azdata.ServiceOption; + let stringOption: azdata.ServiceOption; + let defaultGroupOption: azdata.ServiceOption; + let isValid: boolean; + let inputValue: string; + let inputBox: TypeMoq.Mock; - var optionsMap: { [optionName: string]: OptionsDialogHelper.IOptionElement }; + let optionsMap: { [optionName: string]: OptionsDialogHelper.IOptionElement }; setup(() => { options = {}; @@ -108,7 +107,7 @@ suite('Advanced options helper tests', () => { categoryOption.defaultValue = 'ReadWrite'; categoryOption.isRequired = false; possibleInputs = []; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(categoryOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(categoryOption, options, possibleInputs); assert.equal(optionValue, 'ReadWrite'); assert.equal(possibleInputs.length, 3); assert.equal(possibleInputs[0], ''); @@ -120,7 +119,7 @@ suite('Advanced options helper tests', () => { categoryOption.defaultValue = 'ReadWrite'; categoryOption.isRequired = true; possibleInputs = []; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(categoryOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(categoryOption, options, possibleInputs); assert.equal(optionValue, 'ReadWrite'); assert.equal(possibleInputs.length, 2); assert.equal(possibleInputs[0], 'ReadWrite'); @@ -131,7 +130,7 @@ suite('Advanced options helper tests', () => { categoryOption.defaultValue = null; categoryOption.isRequired = false; possibleInputs = []; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(categoryOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(categoryOption, options, possibleInputs); assert.equal(optionValue, ''); assert.equal(possibleInputs.length, 3); assert.equal(possibleInputs[0], ''); @@ -143,7 +142,7 @@ suite('Advanced options helper tests', () => { categoryOption.defaultValue = null; categoryOption.isRequired = true; possibleInputs = []; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(categoryOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(categoryOption, options, possibleInputs); assert.equal(optionValue, 'ReadWrite'); assert.equal(possibleInputs.length, 2); assert.equal(possibleInputs[0], 'ReadWrite'); @@ -155,7 +154,7 @@ suite('Advanced options helper tests', () => { categoryOption.isRequired = false; possibleInputs = []; options['applicationIntent'] = 'ReadOnly'; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(categoryOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(categoryOption, options, possibleInputs); assert.equal(optionValue, 'ReadOnly'); assert.equal(possibleInputs.length, 3); assert.equal(possibleInputs[0], ''); @@ -168,7 +167,7 @@ suite('Advanced options helper tests', () => { categoryOption.isRequired = true; possibleInputs = []; options['applicationIntent'] = 'ReadOnly'; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(categoryOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(categoryOption, options, possibleInputs); assert.equal(optionValue, 'ReadOnly'); assert.equal(possibleInputs.length, 2); assert.equal(possibleInputs[0], 'ReadWrite'); @@ -179,7 +178,7 @@ suite('Advanced options helper tests', () => { booleanOption.defaultValue = 'False'; booleanOption.isRequired = false; possibleInputs = []; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(booleanOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(booleanOption, options, possibleInputs); assert.equal(optionValue, 'False'); assert.equal(possibleInputs.length, 3); assert.equal(possibleInputs[0], ''); @@ -191,7 +190,7 @@ suite('Advanced options helper tests', () => { booleanOption.defaultValue = 'False'; booleanOption.isRequired = true; possibleInputs = []; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(booleanOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(booleanOption, options, possibleInputs); assert.equal(optionValue, 'False'); assert.equal(possibleInputs.length, 2); assert.equal(possibleInputs[0], 'True'); @@ -202,7 +201,7 @@ suite('Advanced options helper tests', () => { booleanOption.defaultValue = null; booleanOption.isRequired = false; possibleInputs = []; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(booleanOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(booleanOption, options, possibleInputs); assert.equal(optionValue, ''); assert.equal(possibleInputs.length, 3); assert.equal(possibleInputs[0], ''); @@ -214,7 +213,7 @@ suite('Advanced options helper tests', () => { booleanOption.defaultValue = null; booleanOption.isRequired = true; possibleInputs = []; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(booleanOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(booleanOption, options, possibleInputs); assert.equal(optionValue, 'True'); assert.equal(possibleInputs.length, 2); assert.equal(possibleInputs[0], 'True'); @@ -226,7 +225,7 @@ suite('Advanced options helper tests', () => { booleanOption.isRequired = false; possibleInputs = []; options['asynchronousProcessing'] = true; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(booleanOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(booleanOption, options, possibleInputs); assert.equal(optionValue, 'True'); assert.equal(possibleInputs.length, 3); assert.equal(possibleInputs[0], ''); @@ -239,7 +238,7 @@ suite('Advanced options helper tests', () => { booleanOption.isRequired = true; possibleInputs = []; options['asynchronousProcessing'] = 'False'; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(booleanOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(booleanOption, options, possibleInputs); assert.equal(optionValue, 'False'); assert.equal(possibleInputs.length, 2); assert.equal(possibleInputs[0], 'True'); @@ -250,7 +249,7 @@ suite('Advanced options helper tests', () => { numberOption.defaultValue = '15'; numberOption.isRequired = true; possibleInputs = []; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(numberOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(numberOption, options, possibleInputs); assert.equal(optionValue, '15'); }); @@ -259,7 +258,7 @@ suite('Advanced options helper tests', () => { numberOption.isRequired = false; possibleInputs = []; options['connectTimeout'] = '45'; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(numberOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(numberOption, options, possibleInputs); assert.equal(optionValue, '45'); }); @@ -267,7 +266,7 @@ suite('Advanced options helper tests', () => { stringOption.defaultValue = 'Japanese'; stringOption.isRequired = true; possibleInputs = []; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(stringOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(stringOption, options, possibleInputs); assert.equal(optionValue, 'Japanese'); }); @@ -276,7 +275,7 @@ suite('Advanced options helper tests', () => { stringOption.isRequired = false; possibleInputs = []; options['currentLanguage'] = 'Spanish'; - var optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(stringOption, options, possibleInputs); + let optionValue = OptionsDialogHelper.getOptionValueAndCategoryValues(stringOption, options, possibleInputs); assert.equal(optionValue, 'Spanish'); }); @@ -291,7 +290,7 @@ suite('Advanced options helper tests', () => { optionValue: null }; - var error = OptionsDialogHelper.validateInputs(optionsMap); + let error = OptionsDialogHelper.validateInputs(optionsMap); assert.equal(error, true); }); @@ -306,7 +305,7 @@ suite('Advanced options helper tests', () => { optionValue: null }; - var error = OptionsDialogHelper.validateInputs(optionsMap); + let error = OptionsDialogHelper.validateInputs(optionsMap); assert.equal(error, true); }); @@ -320,7 +319,7 @@ suite('Advanced options helper tests', () => { option: numberOption, optionValue: null }; - var error = OptionsDialogHelper.validateInputs(optionsMap); + let error = OptionsDialogHelper.validateInputs(optionsMap); assert.equal(error, true); }); @@ -335,7 +334,7 @@ suite('Advanced options helper tests', () => { optionValue: null }; - var error = OptionsDialogHelper.validateInputs(optionsMap); + let error = OptionsDialogHelper.validateInputs(optionsMap); assert.equal(error, false); }); @@ -350,7 +349,7 @@ suite('Advanced options helper tests', () => { optionValue: null }; - var error = OptionsDialogHelper.validateInputs(optionsMap); + let error = OptionsDialogHelper.validateInputs(optionsMap); assert.equal(error, false); }); diff --git a/src/sqltest/parts/connection/advancedPropertiesDialog.test.ts b/src/sqltest/parts/connection/advancedPropertiesDialog.test.ts index a3bdcd37d9..7fc24a65b8 100644 --- a/src/sqltest/parts/connection/advancedPropertiesDialog.test.ts +++ b/src/sqltest/parts/connection/advancedPropertiesDialog.test.ts @@ -3,7 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; import { OptionsDialog } from 'sql/workbench/browser/modal/optionsDialog'; import { AdvancedPropertiesController } from 'sql/workbench/parts/connection/browser/advancedPropertiesController'; import { ContextKeyServiceStub } from 'sqltest/stubs/contextKeyServiceStub'; @@ -14,8 +13,8 @@ import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes'; import { $ } from 'vs/base/browser/dom'; suite('Advanced properties dialog tests', () => { - var advancedController: AdvancedPropertiesController; - var providerOptions: azdata.ConnectionOption[]; + let advancedController: AdvancedPropertiesController; + let providerOptions: azdata.ConnectionOption[]; setup(() => { advancedController = new AdvancedPropertiesController(() => { }, null); @@ -84,7 +83,7 @@ suite('Advanced properties dialog tests', () => { }); test('advanced dialog should open when showDialog in advancedController get called', () => { - var isAdvancedDialogCalled = false; + let isAdvancedDialogCalled = false; let options: { [name: string]: any } = {}; let advanceDialog = TypeMoq.Mock.ofType(OptionsDialog, TypeMoq.MockBehavior.Strict, '', // title diff --git a/src/sqltest/parts/connection/connectionManagementService.test.ts b/src/sqltest/parts/connection/connectionManagementService.test.ts index 4efc223046..9bdde32cd0 100644 --- a/src/sqltest/parts/connection/connectionManagementService.test.ts +++ b/src/sqltest/parts/connection/connectionManagementService.test.ts @@ -106,10 +106,10 @@ suite('SQL ConnectionManagementService tests', () => { c => c.serverName === connectionProfile.serverName))).returns(() => Promise.resolve({ profile: connectionProfile, savedCred: true })); connectionStore.setup(x => x.addSavedPassword(TypeMoq.It.is( c => c.serverName === connectionProfileWithEmptySavedPassword.serverName))).returns( - () => Promise.resolve({ profile: connectionProfileWithEmptySavedPassword, savedCred: true })); + () => Promise.resolve({ profile: connectionProfileWithEmptySavedPassword, savedCred: true })); connectionStore.setup(x => x.addSavedPassword(TypeMoq.It.is( c => c.serverName === connectionProfileWithEmptyUnsavedPassword.serverName))).returns( - () => Promise.resolve({ profile: connectionProfileWithEmptyUnsavedPassword, savedCred: false })); + () => Promise.resolve({ profile: connectionProfileWithEmptyUnsavedPassword, savedCred: false })); connectionStore.setup(x => x.isPasswordRequired(TypeMoq.It.isAny())).returns(() => true); connectionStore.setup(x => x.getConnectionProfileGroups(false, undefined)).returns(() => [root]); diff --git a/src/sqltest/parts/connection/connectionTreeActions.test.ts b/src/sqltest/parts/connection/connectionTreeActions.test.ts index 3e4814d1bb..2b23a96f43 100644 --- a/src/sqltest/parts/connection/connectionTreeActions.test.ts +++ b/src/sqltest/parts/connection/connectionTreeActions.test.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as TypeMoq from 'typemoq'; import * as assert from 'assert'; import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup'; @@ -108,7 +106,7 @@ suite('SQL Connection Tree Action tests', () => { let manageConnectionAction: ManageConnectionAction = new ManageConnectionAction(ManageConnectionAction.ID, ManageConnectionAction.LABEL, undefined, connectionManagementService.object, capabilitiesService, instantiationService.object, objectExplorerService.object); - var actionContext = new ObjectExplorerActionsContext(); + let actionContext = new ObjectExplorerActionsContext(); actionContext.connectionProfile = connection.toIConnectionProfile(); actionContext.isConnectionNode = true; manageConnectionAction.run(actionContext).then((value) => { @@ -146,7 +144,7 @@ suite('SQL Connection Tree Action tests', () => { let manageConnectionAction: ManageConnectionAction = new ManageConnectionAction(ManageConnectionAction.ID, ManageConnectionAction.LABEL, undefined, connectionManagementService.object, capabilitiesService, instantiationService.object, objectExplorerService.object); - var actionContext = new ObjectExplorerActionsContext(); + let actionContext = new ObjectExplorerActionsContext(); actionContext.connectionProfile = connection.toIConnectionProfile(); actionContext.nodeInfo = treeNode.toNodeInfo(); manageConnectionAction.run(actionContext).then((value) => { @@ -177,7 +175,7 @@ suite('SQL Connection Tree Action tests', () => { let changeConnectionAction: DisconnectConnectionAction = new DisconnectConnectionAction(DisconnectConnectionAction.ID, DisconnectConnectionAction.LABEL, connection, connectionManagementService.object, objectExplorerService.object, errorMessageService.object); - var actionContext = new ObjectExplorerActionsContext(); + let actionContext = new ObjectExplorerActionsContext(); actionContext.connectionProfile = connection.toIConnectionProfile(); changeConnectionAction.run(actionContext).then((value) => { connectionManagementService.verify(x => x.isProfileConnected(TypeMoq.It.isAny()), TypeMoq.Times.atLeastOnce()); @@ -348,7 +346,7 @@ suite('SQL Connection Tree Action tests', () => { capabilitiesService.capabilities['MSSQL'] = { connection: sqlProvider }; - var connection = new ConnectionProfile(capabilitiesService, { + let connection = new ConnectionProfile(capabilitiesService, { connectionName: 'Test', savePassword: false, groupFullName: 'testGroup', @@ -363,9 +361,9 @@ suite('SQL Connection Tree Action tests', () => { saveProfile: true, id: 'testID' }); - var conProfGroup = new ConnectionProfileGroup('testGroup', undefined, 'testGroup', undefined, undefined); + let conProfGroup = new ConnectionProfileGroup('testGroup', undefined, 'testGroup', undefined, undefined); conProfGroup.connections = [connection]; - var connectionManagementService = TypeMoq.Mock.ofType(TestConnectionManagementService, TypeMoq.MockBehavior.Strict); + let connectionManagementService = TypeMoq.Mock.ofType(TestConnectionManagementService, TypeMoq.MockBehavior.Strict); connectionManagementService.callBase = true; connectionManagementService.setup(x => x.getConnectionGroups()).returns(() => [conProfGroup]); connectionManagementService.setup(x => x.getActiveConnections()).returns(() => [connection]); @@ -374,7 +372,7 @@ suite('SQL Connection Tree Action tests', () => { })); connectionManagementService.setup(x => x.isConnected(undefined, TypeMoq.It.isAny())).returns(() => isConnectedReturnValue); - var objectExplorerSession = { + let objectExplorerSession = { success: true, sessionId: '1234', rootNode: { @@ -390,17 +388,17 @@ suite('SQL Connection Tree Action tests', () => { errorMessage: '' }; - var tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName\Db1\tables', '', '', null, null, undefined, undefined); + let tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName\Db1\tables', '', '', null, null, undefined, undefined); tablesNode.connection = connection; tablesNode.session = objectExplorerSession; - var table1Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined); - var table2Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined); + let table1Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined); + let table2Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined); tablesNode.children = [table1Node, table2Node]; let objectExplorerService = TypeMoq.Mock.ofType(ObjectExplorerService, TypeMoq.MockBehavior.Loose, connectionManagementService.object); objectExplorerService.callBase = true; objectExplorerService.setup(x => x.getObjectExplorerNode(TypeMoq.It.isAny())).returns(() => tablesNode); objectExplorerService.setup(x => x.refreshTreeNode(TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => Promise.resolve([table1Node, table2Node])); - var dataSource = new ServerTreeDataSource(objectExplorerService.object, connectionManagementService.object, undefined); + let dataSource = new ServerTreeDataSource(objectExplorerService.object, connectionManagementService.object, undefined); let tree = TypeMoq.Mock.ofType(Tree, TypeMoq.MockBehavior.Loose, $('div'), { dataSource }); tree.callBase = true; @@ -436,7 +434,7 @@ suite('SQL Connection Tree Action tests', () => { capabilitiesService.capabilities['MSSQL'] = { connection: sqlProvider }; - var connection = new ConnectionProfile(capabilitiesService, { + let connection = new ConnectionProfile(capabilitiesService, { connectionName: 'Test', savePassword: false, groupFullName: 'testGroup', @@ -451,9 +449,9 @@ suite('SQL Connection Tree Action tests', () => { saveProfile: true, id: 'testID' }); - var conProfGroup = new ConnectionProfileGroup('testGroup', undefined, 'testGroup', undefined, undefined); + let conProfGroup = new ConnectionProfileGroup('testGroup', undefined, 'testGroup', undefined, undefined); conProfGroup.connections = [connection]; - var connectionManagementService = TypeMoq.Mock.ofType(TestConnectionManagementService, TypeMoq.MockBehavior.Strict); + let connectionManagementService = TypeMoq.Mock.ofType(TestConnectionManagementService, TypeMoq.MockBehavior.Strict); connectionManagementService.callBase = true; connectionManagementService.setup(x => x.getConnectionGroups()).returns(() => [conProfGroup]); connectionManagementService.setup(x => x.getActiveConnections()).returns(() => [connection]); @@ -462,7 +460,7 @@ suite('SQL Connection Tree Action tests', () => { })); connectionManagementService.setup(x => x.isConnected(undefined, TypeMoq.It.isAny())).returns(() => isConnectedReturnValue); - var objectExplorerSession = { + let objectExplorerSession = { success: true, sessionId: '1234', rootNode: { @@ -478,17 +476,17 @@ suite('SQL Connection Tree Action tests', () => { errorMessage: '' }; - var tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName\Db1\tables', '', '', null, null, undefined, undefined); + let tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName\Db1\tables', '', '', null, null, undefined, undefined); tablesNode.connection = connection; tablesNode.session = objectExplorerSession; - var table1Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined); - var table2Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined); + let table1Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined); + let table2Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined); tablesNode.children = [table1Node, table2Node]; let objectExplorerService = TypeMoq.Mock.ofType(ObjectExplorerService, TypeMoq.MockBehavior.Loose, connectionManagementService.object); objectExplorerService.callBase = true; objectExplorerService.setup(x => x.getObjectExplorerNode(TypeMoq.It.isAny())).returns(() => tablesNode); objectExplorerService.setup(x => x.refreshTreeNode(TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => Promise.resolve([table1Node, table2Node])); - var dataSource = new ServerTreeDataSource(objectExplorerService.object, connectionManagementService.object, undefined); + let dataSource = new ServerTreeDataSource(objectExplorerService.object, connectionManagementService.object, undefined); let tree = TypeMoq.Mock.ofType(Tree, TypeMoq.MockBehavior.Loose, $('div'), { dataSource }); tree.callBase = true; diff --git a/src/sqltest/parts/connection/objectExplorerService.test.ts b/src/sqltest/parts/connection/objectExplorerService.test.ts index 6ed139367b..35757aafa8 100644 --- a/src/sqltest/parts/connection/objectExplorerService.test.ts +++ b/src/sqltest/parts/connection/objectExplorerService.test.ts @@ -3,7 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; import { ObjectExplorerProviderTestService } from 'sqltest/stubs/objectExplorerProviderTestService'; import { TestConnectionManagementService } from 'sqltest/stubs/connectionManagementService.test'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; @@ -21,7 +20,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { CapabilitiesTestService } from 'sqltest/stubs/capabilitiesTestService'; suite('SQL Object Explorer Service tests', () => { - var sqlOEProvider: TypeMoq.Mock; + let sqlOEProvider: TypeMoq.Mock; let connectionManagementService: TypeMoq.Mock; let connection: ConnectionProfile; let connectionToFail: ConnectionProfile; @@ -352,7 +351,7 @@ suite('SQL Object Explorer Service tests', () => { assert.equal(expandInfo !== null || expandInfo !== undefined, true); assert.equal(expandInfo.sessionId, '1234'); assert.equal(expandInfo.nodes.length, 2); - var children = expandInfo.nodes; + let children = expandInfo.nodes; assert.equal(children[0].label, 'dbo.Table1'); assert.equal(children[1].label, 'dbo.Table2'); done(); @@ -370,7 +369,7 @@ suite('SQL Object Explorer Service tests', () => { assert.equal(expandInfo !== null || expandInfo !== undefined, true); assert.equal(expandInfo.sessionId, '1234'); assert.equal(expandInfo.nodes.length, 2); - var children = expandInfo.nodes; + let children = expandInfo.nodes; assert.equal(children[0].label, 'dbo.Table1'); assert.equal(children[1].label, 'dbo.Table3'); done(); @@ -382,7 +381,7 @@ suite('SQL Object Explorer Service tests', () => { }); test('expand tree node should get correct children', (done) => { - var tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName/tables', '', '', null, null, undefined, undefined); + let tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName/tables', '', '', null, null, undefined, undefined); tablesNode.connection = connection; objectExplorerService.createNewSession('MSSQL', connection).then(result => { objectExplorerService.onSessionCreated(1, objectExplorerSession); @@ -403,7 +402,7 @@ suite('SQL Object Explorer Service tests', () => { }); test('refresh tree node should children correctly', (done) => { - var tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName/tables', '', '', null, null, undefined, undefined); + let tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName/tables', '', '', null, null, undefined, undefined); tablesNode.connection = connection; objectExplorerService.createNewSession('MSSQL', connection).then(result => { objectExplorerService.onSessionCreated(1, objectExplorerSession); @@ -427,7 +426,7 @@ suite('SQL Object Explorer Service tests', () => { objectExplorerService.createNewSession('MSSQL', connection).then(result => { objectExplorerService.onSessionCreated(1, objectExplorerSession); objectExplorerService.updateObjectExplorerNodes(connection).then(() => { - var treeNode = objectExplorerService.getObjectExplorerNode(connection); + let treeNode = objectExplorerService.getObjectExplorerNode(connection); assert.equal(treeNode !== null || treeNode !== undefined, true); assert.equal(treeNode.getSession(), objectExplorerSession); assert.equal(treeNode.getConnectionProfile(), connection); @@ -445,7 +444,7 @@ suite('SQL Object Explorer Service tests', () => { objectExplorerService.createNewSession('MSSQL', connection).then(result => { objectExplorerService.onSessionCreated(1, objectExplorerSession); objectExplorerService.updateObjectExplorerNodes(connection).then(() => { - var treeNode = objectExplorerService.getObjectExplorerNode(connection); + let treeNode = objectExplorerService.getObjectExplorerNode(connection); assert.equal(treeNode !== null && treeNode !== undefined, true); objectExplorerService.deleteObjectExplorerNode(connection).then(() => { treeNode = objectExplorerService.getObjectExplorerNode(connection); @@ -460,20 +459,20 @@ suite('SQL Object Explorer Service tests', () => { }); test('children tree nodes should return correct object explorer session, connection profile and database name', () => { - var databaseMetaData = { + let databaseMetaData = { metadataType: 0, metadataTypeName: 'Database', urn: '//server/db1/', name: 'Db1', schema: null }; - var databaseNode = new TreeNode(NodeType.Database, 'Db1', false, 'testServerName\\Db1', '', '', null, databaseMetaData, undefined, undefined); + let databaseNode = new TreeNode(NodeType.Database, 'Db1', false, 'testServerName\\Db1', '', '', null, databaseMetaData, undefined, undefined); databaseNode.connection = connection; databaseNode.session = objectExplorerSession; - var tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName\\Db1\\tables', '', '', databaseNode, null, undefined, undefined); + let tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName\\Db1\\tables', '', '', databaseNode, null, undefined, undefined); databaseNode.children = [tablesNode]; - var table1Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\\Db1\\tables\\dbo.Table1', '', '', tablesNode, null, undefined, undefined); - var table2Node = new TreeNode(NodeType.Table, 'dbo.Table2', false, 'testServerName\\Db1\\tables\\dbo.Table2', '', '', tablesNode, null, undefined, undefined); + let table1Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\\Db1\\tables\\dbo.Table1', '', '', tablesNode, null, undefined, undefined); + let table2Node = new TreeNode(NodeType.Table, 'dbo.Table2', false, 'testServerName\\Db1\\tables\\dbo.Table2', '', '', tablesNode, null, undefined, undefined); tablesNode.children = [table1Node, table2Node]; assert.equal(table1Node.getSession(), objectExplorerSession); assert.equal(table1Node.getConnectionProfile(), connection); @@ -796,4 +795,4 @@ suite('SQL Object Explorer Service tests', () => { // Then refresh gets called on the node sqlOEProvider.verify(x => x.refreshNode(TypeMoq.It.is(x => x.nodePath === tablesNodePath)), TypeMoq.Times.once()); }); -}); \ No newline at end of file +}); diff --git a/src/sqltest/parts/dataExplorer/dataExplorerViewlet.test.ts b/src/sqltest/parts/dataExplorer/dataExplorerViewlet.test.ts index 58949d66cf..93b8727292 100644 --- a/src/sqltest/parts/dataExplorer/dataExplorerViewlet.test.ts +++ b/src/sqltest/parts/dataExplorer/dataExplorerViewlet.test.ts @@ -49,7 +49,7 @@ suite('Data Explorer Viewlet', () => { let oldCount = Platform.Registry.as(Extensions.Viewlets).getViewlets().length; let d = new ViewletDescriptor(DataExplorerTestViewlet, 'dataExplorer-test-id', 'name'); Platform.Registry.as(Extensions.Viewlets).registerViewlet(d); - let retrieved = Platform.Registry.as(Extensions.Viewlets).getViewlet('dataExplorer-test-id'); + let retrieved = Platform.Registry.as(Extensions.Viewlets).getViewlet('dataExplorer-test-id'); assert(d === retrieved); let newCount = Platform.Registry.as(Extensions.Viewlets).getViewlets().length; assert.equal(oldCount + 1, newCount); diff --git a/src/sqltest/parts/insights/insightsDialogController.test.ts b/src/sqltest/parts/insights/insightsDialogController.test.ts index b869b0aa98..b6067dff41 100644 --- a/src/sqltest/parts/insights/insightsDialogController.test.ts +++ b/src/sqltest/parts/insights/insightsDialogController.test.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import { InsightsDialogController } from 'sql/workbench/services/insights/node/insightsDialogController'; import { InsightsDialogModel } from 'sql/workbench/services/insights/common/insightsDialogModel'; diff --git a/src/sqltest/parts/insights/insightsUtils.test.ts b/src/sqltest/parts/insights/insightsUtils.test.ts index 480a89eacc..6fd373643e 100644 --- a/src/sqltest/parts/insights/insightsUtils.test.ts +++ b/src/sqltest/parts/insights/insightsUtils.test.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import { equal, fail } from 'assert'; import * as os from 'os'; @@ -134,7 +134,7 @@ suite('Insights Utils tests', function () { new Workspace( 'TestWorkspace', [toWorkspaceFolder(URI.file(os.tmpdir()))]) - ); + ); const configurationResolverService = new ConfigurationResolverService( undefined, new TestEnvironmentService({}), diff --git a/src/sqltest/parts/notebook/model/clientSession.test.ts b/src/sqltest/parts/notebook/model/clientSession.test.ts index c6c46fe308..ea421247b2 100644 --- a/src/sqltest/parts/notebook/model/clientSession.test.ts +++ b/src/sqltest/parts/notebook/model/clientSession.test.ts @@ -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 * as should from 'should'; import * as TypeMoq from 'typemoq'; import { nb } from 'azdata'; diff --git a/src/sqltest/parts/notebook/model/notebookModel.test.ts b/src/sqltest/parts/notebook/model/notebookModel.test.ts index 5a1468e4e7..1d012515bf 100644 --- a/src/sqltest/parts/notebook/model/notebookModel.test.ts +++ b/src/sqltest/parts/notebook/model/notebookModel.test.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as should from 'should'; import * as TypeMoq from 'typemoq'; import { nb } from 'azdata'; @@ -14,7 +12,6 @@ import { TestNotificationService } from 'vs/platform/notification/test/common/te import { URI } from 'vs/base/common/uri'; import { LocalContentManager } from 'sql/workbench/services/notebook/node/localContentManager'; -import * as testUtils from '../../../utils/testUtils'; import { NotebookManagerStub } from '../common'; import { NotebookModel } from 'sql/workbench/parts/notebook/models/notebookModel'; import { ModelFactory } from 'sql/workbench/parts/notebook/models/modelFactory'; @@ -201,7 +198,7 @@ suite('notebook model', function (): void { // should(sessionFired).be.false(); // }); - test('Should not be in error state if client session initialization succeeds', async function(): Promise { + test('Should not be in error state if client session initialization succeeds', async function (): Promise { let mockContentManager = TypeMoq.Mock.ofType(LocalContentManager); mockContentManager.setup(c => c.getNotebookContents(TypeMoq.It.isAny())).returns(() => Promise.resolve(expectedNotebookContentOneCell)); notebookManagers[0].contentManager = mockContentManager.object; @@ -218,7 +215,7 @@ suite('notebook model', function (): void { sessionReady.resolve(); let actualSession: IClientSession = undefined; - let options: INotebookModelOptions = Object.assign({}, defaultModelOptions, > { + let options: INotebookModelOptions = Object.assign({}, defaultModelOptions, >{ factory: mockModelFactory.object }); let model = new NotebookModel(options, undefined); @@ -238,7 +235,7 @@ suite('notebook model', function (): void { should(model.clientSession).equal(mockClientSession.object); }); - test('Should sanitize kernel display name when IP is included', async function(): Promise { + test('Should sanitize kernel display name when IP is included', async function (): Promise { let model = new NotebookModel(defaultModelOptions); let displayName = 'PySpark (1.1.1.1)'; let sanitizedDisplayName = model.sanitizeDisplayName(displayName); diff --git a/src/sqltest/parts/notebook/model/notebookUtils.test.ts b/src/sqltest/parts/notebook/model/notebookUtils.test.ts index b38a713307..466ea9fd40 100644 --- a/src/sqltest/parts/notebook/model/notebookUtils.test.ts +++ b/src/sqltest/parts/notebook/model/notebookUtils.test.ts @@ -3,86 +3,84 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as should from 'should'; -import { nb, IConnectionProfile } from 'azdata'; +import { IConnectionProfile } from 'azdata'; import { CapabilitiesTestService } from 'sqltest/stubs/capabilitiesTestService'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import { formatServerNameWithDatabaseNameForAttachTo, getServerFromFormattedAttachToName, getDatabaseFromFormattedAttachToName } from 'sql/workbench/parts/notebook/notebookUtils'; -suite('notebookUtils', function(): void { - let conn: IConnectionProfile = { - connectionName: '', - serverName: '', - databaseName: '', - userName: '', - password: '', - authenticationType: '', - savePassword: true, - groupFullName: '', - groupId: '', - providerName: '', - saveProfile: true, - id: '', - options: {}, - azureTenantId: undefined - }; +suite('notebookUtils', function (): void { + let conn: IConnectionProfile = { + connectionName: '', + serverName: '', + databaseName: '', + userName: '', + password: '', + authenticationType: '', + savePassword: true, + groupFullName: '', + groupId: '', + providerName: '', + saveProfile: true, + id: '', + options: {}, + azureTenantId: undefined + }; - test('Should format server and database name correctly for attach to', async function(): Promise { - let capabilitiesService = new CapabilitiesTestService(); - let connProfile = new ConnectionProfile(capabilitiesService, conn); - connProfile.serverName = 'serverName'; - connProfile.databaseName = 'databaseName'; - let attachToNameFormatted = formatServerNameWithDatabaseNameForAttachTo(connProfile); - should(attachToNameFormatted).equal('serverName (databaseName)'); - }); + test('Should format server and database name correctly for attach to', async function (): Promise { + let capabilitiesService = new CapabilitiesTestService(); + let connProfile = new ConnectionProfile(capabilitiesService, conn); + connProfile.serverName = 'serverName'; + connProfile.databaseName = 'databaseName'; + let attachToNameFormatted = formatServerNameWithDatabaseNameForAttachTo(connProfile); + should(attachToNameFormatted).equal('serverName (databaseName)'); + }); - test('Should format server name correctly for attach to', async function(): Promise { - let capabilitiesService = new CapabilitiesTestService(); - let connProfile = new ConnectionProfile(capabilitiesService, conn); - connProfile.serverName = 'serverName'; - let attachToNameFormatted = formatServerNameWithDatabaseNameForAttachTo(connProfile); - should(attachToNameFormatted).equal('serverName'); - }); + test('Should format server name correctly for attach to', async function (): Promise { + let capabilitiesService = new CapabilitiesTestService(); + let connProfile = new ConnectionProfile(capabilitiesService, conn); + connProfile.serverName = 'serverName'; + let attachToNameFormatted = formatServerNameWithDatabaseNameForAttachTo(connProfile); + should(attachToNameFormatted).equal('serverName'); + }); - test('Should format server name correctly for attach to when database is undefined', async function(): Promise { - let capabilitiesService = new CapabilitiesTestService(); - let connProfile = new ConnectionProfile(capabilitiesService, conn); - connProfile.serverName = 'serverName'; - connProfile.databaseName = undefined; - let attachToNameFormatted = formatServerNameWithDatabaseNameForAttachTo(connProfile); - should(attachToNameFormatted).equal('serverName'); - }); + test('Should format server name correctly for attach to when database is undefined', async function (): Promise { + let capabilitiesService = new CapabilitiesTestService(); + let connProfile = new ConnectionProfile(capabilitiesService, conn); + connProfile.serverName = 'serverName'; + connProfile.databaseName = undefined; + let attachToNameFormatted = formatServerNameWithDatabaseNameForAttachTo(connProfile); + should(attachToNameFormatted).equal('serverName'); + }); - test('Should format server name as empty string when server/database are undefined', async function(): Promise { - let capabilitiesService = new CapabilitiesTestService(); - let connProfile = new ConnectionProfile(capabilitiesService, conn); - connProfile.serverName = undefined; - connProfile.databaseName = undefined; - let attachToNameFormatted = formatServerNameWithDatabaseNameForAttachTo(connProfile); - should(attachToNameFormatted).equal(''); - }); + test('Should format server name as empty string when server/database are undefined', async function (): Promise { + let capabilitiesService = new CapabilitiesTestService(); + let connProfile = new ConnectionProfile(capabilitiesService, conn); + connProfile.serverName = undefined; + connProfile.databaseName = undefined; + let attachToNameFormatted = formatServerNameWithDatabaseNameForAttachTo(connProfile); + should(attachToNameFormatted).equal(''); + }); - test('Should extract server name when no database specified', async function(): Promise { - let serverName = getServerFromFormattedAttachToName('serverName'); - let databaseName = getDatabaseFromFormattedAttachToName('serverName'); - should(serverName).equal('serverName'); - should(databaseName).equal(''); - }); + test('Should extract server name when no database specified', async function (): Promise { + let serverName = getServerFromFormattedAttachToName('serverName'); + let databaseName = getDatabaseFromFormattedAttachToName('serverName'); + should(serverName).equal('serverName'); + should(databaseName).equal(''); + }); - test('Should extract server and database name', async function(): Promise { - let serverName = getServerFromFormattedAttachToName('serverName (databaseName)'); - let databaseName = getDatabaseFromFormattedAttachToName('serverName (databaseName)'); - should(serverName).equal('serverName'); - should(databaseName).equal('databaseName'); - }); + test('Should extract server and database name', async function (): Promise { + let serverName = getServerFromFormattedAttachToName('serverName (databaseName)'); + let databaseName = getDatabaseFromFormattedAttachToName('serverName (databaseName)'); + should(serverName).equal('serverName'); + should(databaseName).equal('databaseName'); + }); - test('Should extract server and database name with other parentheses', async function(): Promise { - let serverName = getServerFromFormattedAttachToName('serv()erName (databaseName)'); - let databaseName = getDatabaseFromFormattedAttachToName('serv()erName (databaseName)'); - should(serverName).equal('serv()erName'); - should(databaseName).equal('databaseName'); - }); + test('Should extract server and database name with other parentheses', async function (): Promise { + let serverName = getServerFromFormattedAttachToName('serv()erName (databaseName)'); + let databaseName = getDatabaseFromFormattedAttachToName('serv()erName (databaseName)'); + should(serverName).equal('serv()erName'); + should(databaseName).equal('databaseName'); + }); }); diff --git a/src/sqltest/stubs/capabilitiesTestService.ts b/src/sqltest/stubs/capabilitiesTestService.ts index 4c7eb386a0..e4f5cb387e 100644 --- a/src/sqltest/stubs/capabilitiesTestService.ts +++ b/src/sqltest/stubs/capabilitiesTestService.ts @@ -3,7 +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 { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo'; import { ICapabilitiesService, ProviderFeatures } from 'sql/platform/capabilities/common/capabilitiesService'; @@ -120,7 +119,6 @@ export class CapabilitiesTestService implements ICapabilitiesService { /** * Register the capabilities provider and query the provider for its capabilities - * @param provider */ public registerProvider(provider: azdata.CapabilitiesProvider): void { } @@ -145,4 +143,3 @@ export class CapabilitiesTestService implements ICapabilitiesService { private _onCapabilitiesRegistered = new Emitter(); public readonly onCapabilitiesRegistered = this._onCapabilitiesRegistered.event; } - diff --git a/src/sqltest/stubs/editorGroupService.ts b/src/sqltest/stubs/editorGroupService.ts index 4302a320ee..c1b5cf656f 100644 --- a/src/sqltest/stubs/editorGroupService.ts +++ b/src/sqltest/stubs/editorGroupService.ts @@ -142,7 +142,7 @@ export class EditorGroupTestService implements IEditorGroupsService { /** * Keyboard focus the editor group at the provided position. */ - public focusGroup(group: EditorGroup): void; + public focusGroup(group: EditorGroup): void; public focusGroup(position: Position): void; public focusGroup(arg1: any) { return; diff --git a/src/sqltest/stubs/windowTestService.ts b/src/sqltest/stubs/windowTestService.ts index 0b00c908f5..c6e83c164b 100644 --- a/src/sqltest/stubs/windowTestService.ts +++ b/src/sqltest/stubs/windowTestService.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the Source EULA. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ import * as platform from 'vs/base/common/platform'; import { IWindowConfiguration } from 'vs/platform/windows/common/windows'; diff --git a/src/sqltest/stubs/workbenchEditorTestService.ts b/src/sqltest/stubs/workbenchEditorTestService.ts index f26ba30268..efb53a0d3c 100644 --- a/src/sqltest/stubs/workbenchEditorTestService.ts +++ b/src/sqltest/stubs/workbenchEditorTestService.ts @@ -5,7 +5,7 @@ 'use strict'; import { IEditorService, SIDE_GROUP_TYPE, ACTIVE_GROUP_TYPE, IResourceEditor, IResourceEditorReplacement, IOpenEditorOverrideHandler } from 'vs/workbench/services/editor/common/editorService'; import { ServiceIdentifier, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { IEditorOptions, IResourceInput, ITextEditorOptions } from 'vs/platform/editor/common/editor'; +import { IEditorOptions, IResourceInput, ITextEditorOptions } from 'vs/platform/editor/common/editor'; import { IEditor, IEditorInput, IResourceDiffInput, IResourceSideBySideInput, GroupIdentifier, ITextEditor, IUntitledResourceInput, ITextDiffEditor, ITextSideBySideEditor, IEditorInputWithOptions } from 'vs/workbench/common/editor'; import { Event } from 'vs/base/common/event'; import { Position } from 'vs/editor/common/core/position'; @@ -49,7 +49,7 @@ export class WorkbenchEditorTestService implements IEditorService { public openEditor(editor: IResourceInput | IUntitledResourceInput, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise; public openEditor(editor: IResourceDiffInput, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise; public openEditor(editor: IResourceSideBySideInput, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise; - public openEditor(input: any, arg2?: any, arg3?: any): Promise { + public openEditor(input: any, arg2?: any, arg3?: any): Promise { return undefined; } diff --git a/src/sqltest/utils/testUtils.ts b/src/sqltest/utils/testUtils.ts index 31c2f84177..8ab8d17852 100644 --- a/src/sqltest/utils/testUtils.ts +++ b/src/sqltest/utils/testUtils.ts @@ -1,22 +1,19 @@ - /*--------------------------------------------------------------------------------------------- * 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 assert from 'assert'; export async function assertThrowsAsync(fn, expectedMessage?: string): Promise { - var threw = false; - try { - await fn(); - } catch (e) { - threw = true; - if (expectedMessage) { - assert.strictEqual(e.message, expectedMessage); - } - } - assert.equal(threw, true, 'Expected function to throw but it did not'); + let threw = false; + try { + await fn(); + } catch (e) { + threw = true; + if (expectedMessage) { + assert.strictEqual(e.message, expectedMessage); + } + } + assert.equal(threw, true, 'Expected function to throw but it did not'); } diff --git a/src/sqltest/workbench/api/extHostCredentialManagement.test.ts b/src/sqltest/workbench/api/extHostCredentialManagement.test.ts index 81d5be9d6a..9668980dab 100644 --- a/src/sqltest/workbench/api/extHostCredentialManagement.test.ts +++ b/src/sqltest/workbench/api/extHostCredentialManagement.test.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as assert from 'assert'; import { TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; @@ -116,18 +114,18 @@ suite('ExtHostCredentialManagement', () => { // Then: I should get an error extHost.$getCredentialProvider(undefined) .then( - () => { done('Provider was returned from undefined'); }, - () => { /* Swallow error, this is success path */ } + () => { done('Provider was returned from undefined'); }, + () => { /* Swallow error, this is success path */ } ) .then(() => { return extHost.$getCredentialProvider(null); }) .then( - () => { done('Provider was returned from null'); }, - () => { /* Swallow error, this is success path */ } + () => { done('Provider was returned from null'); }, + () => { /* Swallow error, this is success path */ } ) .then(() => { return extHost.$getCredentialProvider(''); }) .then( - () => { done('Provider was returned from \'\''); }, - () => { done(); } + () => { done('Provider was returned from \'\''); }, + () => { done(); } ); }); }); diff --git a/src/sqltest/workbench/api/exthostNotebook.test.ts b/src/sqltest/workbench/api/exthostNotebook.test.ts index bc8dd0ceb4..468375a194 100644 --- a/src/sqltest/workbench/api/exthostNotebook.test.ts +++ b/src/sqltest/workbench/api/exthostNotebook.test.ts @@ -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'; @@ -24,7 +23,7 @@ suite('ExtHostNotebook Tests', () => { let notebookUri: URI; let notebookProviderMock: TypeMoq.Mock; setup(() => { - mockProxy = TypeMoq.Mock.ofInstance( { + mockProxy = TypeMoq.Mock.ofInstance({ $registerNotebookProvider: (providerId, handle) => undefined, $unregisterNotebookProvider: (handle) => undefined, dispose: () => undefined @@ -106,9 +105,9 @@ suite('ExtHostNotebook Tests', () => { extHostNotebook.registerNotebookProvider(notebookProviderMock.object); mockProxy.verify(p => p.$registerNotebookProvider(TypeMoq.It.isValue(notebookProviderMock.object.providerId), - TypeMoq.It.isAnyNumber()), TypeMoq.Times.once()); - // It shouldn't unregister until requested - mockProxy.verify(p => p.$unregisterNotebookProvider(TypeMoq.It.isValue(savedHandle)), TypeMoq.Times.never()); + TypeMoq.It.isAnyNumber()), TypeMoq.Times.once()); + // It shouldn't unregister until requested + mockProxy.verify(p => p.$unregisterNotebookProvider(TypeMoq.It.isValue(savedHandle)), TypeMoq.Times.never()); }); @@ -122,7 +121,7 @@ suite('ExtHostNotebook Tests', () => { class NotebookProviderStub implements azdata.nb.NotebookProvider { providerId: string = 'TestProvider'; - standardKernels: azdata.nb.IStandardKernel[] = [{name: 'fakeKernel', displayName: 'fakeKernel', connectionProviderIds: ['MSSQL']}]; + standardKernels: azdata.nb.IStandardKernel[] = [{ name: 'fakeKernel', displayName: 'fakeKernel', connectionProviderIds: ['MSSQL'] }]; getNotebookManager(notebookUri: vscode.Uri): Thenable { throw new Error('Method not implemented.'); diff --git a/src/typings/globals/core-js/typings.json b/src/typings/globals/core-js/typings.json deleted file mode 100644 index 8643d5650a..0000000000 --- a/src/typings/globals/core-js/typings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/3c56e866d6edd234416a92c3d35c15ccd7fe6b72/core-js/index.d.ts", - "raw": "registry:dt/core-js#0.9.7+20161130133742", - "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/3c56e866d6edd234416a92c3d35c15ccd7fe6b72/core-js/index.d.ts" - } -} diff --git a/src/typings/globals/slickgrid/typings.json b/src/typings/globals/slickgrid/typings.json deleted file mode 100644 index df96677753..0000000000 --- a/src/typings/globals/slickgrid/typings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5607f54defce88bc52a0440288f434cafffdb5ce/slickgrid/index.d.ts", - "raw": "registry:dt/slickgrid#2.1.0+20160818215330", - "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5607f54defce88bc52a0440288f434cafffdb5ce/slickgrid/index.d.ts" - } -} diff --git a/src/typings/globals/systemjs/typings.json b/src/typings/globals/systemjs/typings.json deleted file mode 100644 index 659c1d308f..0000000000 --- a/src/typings/globals/systemjs/typings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/968736e629cc8052c98c8d5e892e73e0679bec6c/systemjs/index.d.ts", - "raw": "registry:dt/systemjs#0.19.29+20161215140219", - "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/968736e629cc8052c98c8d5e892e73e0679bec6c/systemjs/index.d.ts" - } -} diff --git a/src/typings/globals/underscore/typings.json b/src/typings/globals/underscore/typings.json deleted file mode 100644 index 112908addb..0000000000 --- a/src/typings/globals/underscore/typings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7f8c53f300bb183bd496427f0f955638b1311133/underscore/underscore.d.ts", - "raw": "registry:dt/underscore#1.8.3+20161123125004", - "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7f8c53f300bb183bd496427f0f955638b1311133/underscore/underscore.d.ts" - } -} diff --git a/src/typings/globals/zone.js/typings.json b/src/typings/globals/zone.js/typings.json deleted file mode 100644 index d47c802619..0000000000 --- a/src/typings/globals/zone.js/typings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "npm:zone.js\\dist\\zone.js.d.ts" - } -} diff --git a/src/typings/modules/@angular/common/typings.json b/src/typings/modules/@angular/common/typings.json deleted file mode 100644 index 1708a25f74..0000000000 --- a/src/typings/modules/@angular/common/typings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "npm:@angular/common/common.d.ts" - } -} diff --git a/src/typings/modules/@angular/compiler/typings.json b/src/typings/modules/@angular/compiler/typings.json deleted file mode 100644 index 68c759870a..0000000000 --- a/src/typings/modules/@angular/compiler/typings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "npm:@angular/compiler/compiler.d.ts" - } -} diff --git a/src/typings/modules/@angular/core/typings.json b/src/typings/modules/@angular/core/typings.json deleted file mode 100644 index e74498c7df..0000000000 --- a/src/typings/modules/@angular/core/typings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "npm:@angular/core/core.d.ts" - } -} diff --git a/src/typings/modules/@angular/forms/typings.json b/src/typings/modules/@angular/forms/typings.json deleted file mode 100644 index e44061e318..0000000000 --- a/src/typings/modules/@angular/forms/typings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "npm:@angular/forms/forms.d.ts" - } -} diff --git a/src/typings/modules/@angular/platform-browser-dynamic/typings.json b/src/typings/modules/@angular/platform-browser-dynamic/typings.json deleted file mode 100644 index 45c54d8a3d..0000000000 --- a/src/typings/modules/@angular/platform-browser-dynamic/typings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "npm:@angular/platform-browser-dynamic/platform-browser-dynamic.d.ts" - } -} diff --git a/src/typings/modules/@angular/platform-browser/typings.json b/src/typings/modules/@angular/platform-browser/typings.json deleted file mode 100644 index 31c0789c66..0000000000 --- a/src/typings/modules/@angular/platform-browser/typings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "npm:@angular/platform-browser/platform-browser.d.ts" - } -} diff --git a/src/typings/modules/@angular/router/typings.json b/src/typings/modules/@angular/router/typings.json deleted file mode 100644 index ef921148d4..0000000000 --- a/src/typings/modules/@angular/router/typings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "npm:@angular/router/router.d.ts" - } -} diff --git a/src/typings/modules/@types/htmlparser2/typings.json b/src/typings/modules/@types/htmlparser2/typings.json deleted file mode 100644 index 029e1fdac5..0000000000 --- a/src/typings/modules/@types/htmlparser2/typings.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "C:\\Raj\\CodeBase\\Branch\\azuredatastudio\\node_modules\\@types\\htmlparser2\\package.json", - "raw": "npm:@types/htmlparser2", - "main": "index", - "version": "3.7.31", - "dependencies": { - "@types/node": { - "src": "C:\\Raj\\CodeBase\\Branch\\azuredatastudio\\node_modules\\@types\\node\\package.json", - "raw": "npm:@types/node", - "main": "", - "version": "4.2.22", - "name": "@types/node" - } - }, - "name": "@types/htmlparser2" - } -} diff --git a/src/typings/modules/@types/sanitize-html/typings.json b/src/typings/modules/@types/sanitize-html/typings.json deleted file mode 100644 index d206c11f6c..0000000000 --- a/src/typings/modules/@types/sanitize-html/typings.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "C:\\Raj\\CodeBase\\Branch\\azuredatastudio\\node_modules\\@types\\sanitize-html\\package.json", - "raw": "npm:@types/sanitize-html", - "main": "index", - "version": "1.18.2", - "dependencies": { - "@types/htmlparser2": { - "src": "C:\\Raj\\CodeBase\\Branch\\azuredatastudio\\node_modules\\@types\\htmlparser2\\package.json", - "raw": "npm:@types/htmlparser2", - "main": "", - "version": "3.7.31", - "dependencies": { - "@types/node": { - "src": "C:\\Raj\\CodeBase\\Branch\\azuredatastudio\\node_modules\\@types\\node\\package.json", - "raw": "npm:@types/node", - "main": "", - "version": "4.2.22", - "name": "@types/node" - } - }, - "name": "@types/htmlparser2" - } - }, - "name": "@types/sanitize-html" - } -} diff --git a/src/typings/modules/angular2-grid/typings.json b/src/typings/modules/angular2-grid/typings.json deleted file mode 100644 index a4570f755c..0000000000 --- a/src/typings/modules/angular2-grid/typings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "D:\\code\\carbon\\node_modules\\angular2-grid\\main.d.ts", - "raw": "npm:angular2-grid/main.d.ts", - "typings": "D:\\code\\carbon\\node_modules\\angular2-grid\\main.d.ts" - } -} diff --git a/src/typings/modules/angular2-slickgrid/typings.json b/src/typings/modules/angular2-slickgrid/typings.json deleted file mode 100644 index 2bc7c9495b..0000000000 --- a/src/typings/modules/angular2-slickgrid/typings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "D:\\code\\azuredatastudio\\node_modules\\angular2-slickgrid\\package.json", - "raw": "npm:angular2-slickgrid", - "main": "out/index.js", - "version": "1.4.1", - "name": "angular2-slickgrid" - } -} diff --git a/src/typings/modules/ansi_up/typings.json b/src/typings/modules/ansi_up/typings.json deleted file mode 100644 index 0d81657f54..0000000000 --- a/src/typings/modules/ansi_up/typings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "C:\\Raj\\CodeBase\\Branch\\azuredatastudio\\node_modules\\ansi_up\\dist\\ansi_up.d.ts", - "raw": "npm:ansi_up/dist/ansi_up.d.ts", - "typings": "C:\\Raj\\CodeBase\\Branch\\azuredatastudio\\node_modules\\ansi_up\\dist\\ansi_up.d.ts" - } -} diff --git a/src/typings/modules/html-query-plan/typings.json b/src/typings/modules/html-query-plan/typings.json deleted file mode 100644 index 230a23283f..0000000000 --- a/src/typings/modules/html-query-plan/typings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "npm:html-query-plan" - } -} diff --git a/src/typings/modules/ng2-charts/typings.json b/src/typings/modules/ng2-charts/typings.json deleted file mode 100644 index 0c338a7324..0000000000 --- a/src/typings/modules/ng2-charts/typings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "npm:ng2-charts/ng2-charts.d.ts" - } -} diff --git a/src/typings/modules/rxjs/typings.json b/src/typings/modules/rxjs/typings.json deleted file mode 100644 index 4075ea2393..0000000000 --- a/src/typings/modules/rxjs/typings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "resolution": "main", - "tree": { - "src": "npm:rxjs/Rx.d.ts" - } -} diff --git a/src/vs/base/browser/hash.ts b/src/vs/base/browser/hash.ts index eee8c0f56e..222332b2f8 100644 --- a/src/vs/base/browser/hash.ts +++ b/src/vs/base/browser/hash.ts @@ -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. *--------------------------------------------------------------------------------------------*/ export function createSHA1(content: string): Thenable { diff --git a/src/vs/base/browser/ui/dialog/dialog.css b/src/vs/base/browser/ui/dialog/dialog.css index c909dada79..617f46bf43 100644 --- a/src/vs/base/browser/ui/dialog/dialog.css +++ b/src/vs/base/browser/ui/dialog/dialog.css @@ -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. *--------------------------------------------------------------------------------------------*/ /** Dialog: Modal Block */ .monaco-workbench .dialog-modal-block { diff --git a/src/vs/base/browser/ui/dialog/dialog.ts b/src/vs/base/browser/ui/dialog/dialog.ts index d5884ce09e..15ec0bdcec 100644 --- a/src/vs/base/browser/ui/dialog/dialog.ts +++ b/src/vs/base/browser/ui/dialog/dialog.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import 'vs/css!./dialog'; diff --git a/src/vs/base/common/buffer.ts b/src/vs/base/common/buffer.ts index cf34296e74..ea20ac81a4 100644 --- a/src/vs/base/common/buffer.ts +++ b/src/vs/base/common/buffer.ts @@ -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. *--------------------------------------------------------------------------------------------*/ declare var Buffer: any; @@ -437,4 +437,4 @@ class VSBufferWriteableStreamImpl implements VSBufferWriteableStream { this.listeners.end.length = 0; } } -} \ No newline at end of file +} diff --git a/src/vs/base/node/extpath.ts b/src/vs/base/node/extpath.ts index b3b55b7aae..8b425e6769 100644 --- a/src/vs/base/node/extpath.ts +++ b/src/vs/base/node/extpath.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as fs from 'fs'; diff --git a/src/vs/base/node/watcher.ts b/src/vs/base/node/watcher.ts index b51f73c6ea..5248c2e798 100644 --- a/src/vs/base/node/watcher.ts +++ b/src/vs/base/node/watcher.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { join, basename } from 'vs/base/common/path'; diff --git a/src/vs/base/parts/ipc/common/ipc.net.ts b/src/vs/base/parts/ipc/common/ipc.net.ts index ca5de68c10..f799065774 100644 --- a/src/vs/base/parts/ipc/common/ipc.net.ts +++ b/src/vs/base/parts/ipc/common/ipc.net.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { Event, Emitter } from 'vs/base/common/event'; diff --git a/src/vs/base/test/browser/hash.test.ts b/src/vs/base/test/browser/hash.test.ts index adbedc411f..cff6dbe9b1 100644 --- a/src/vs/base/test/browser/hash.test.ts +++ b/src/vs/base/test/browser/hash.test.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; import { createSHA1 } from 'vs/base/browser/hash'; diff --git a/src/vs/base/test/common/buffer.test.ts b/src/vs/base/test/common/buffer.test.ts index c5a3cd676e..4b1d607fbc 100644 --- a/src/vs/base/test/common/buffer.test.ts +++ b/src/vs/base/test/common/buffer.test.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; diff --git a/src/vs/base/test/node/extpath.test.ts b/src/vs/base/test/node/extpath.test.ts index e435d62480..0359aca322 100644 --- a/src/vs/base/test/node/extpath.test.ts +++ b/src/vs/base/test/node/extpath.test.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; diff --git a/src/vs/base/test/node/pfs/pfs.test.ts b/src/vs/base/test/node/pfs/pfs.test.ts index 4f09ad2b56..a027989e39 100644 --- a/src/vs/base/test/node/pfs/pfs.test.ts +++ b/src/vs/base/test/node/pfs/pfs.test.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; diff --git a/src/vs/code/electron-browser/issue/test/testReporterModel.test.ts b/src/vs/code/electron-browser/issue/test/testReporterModel.test.ts index 2a6b80fdfd..ba315e9583 100644 --- a/src/vs/code/electron-browser/issue/test/testReporterModel.test.ts +++ b/src/vs/code/electron-browser/issue/test/testReporterModel.test.ts @@ -58,7 +58,7 @@ Extensions: none } }); assert.equal(issueReporterModel.serialize(), - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} ` Issue Type: Bug diff --git a/src/vs/editor/common/standaloneStrings.ts b/src/vs/editor/common/standaloneStrings.ts index f0c107c0cb..768168124b 100644 --- a/src/vs/editor/common/standaloneStrings.ts +++ b/src/vs/editor/common/standaloneStrings.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; diff --git a/src/vs/editor/contrib/codelens/codeLensCache.ts b/src/vs/editor/contrib/codelens/codeLensCache.ts index 0119def520..6c878c8b8a 100644 --- a/src/vs/editor/contrib/codelens/codeLensCache.ts +++ b/src/vs/editor/contrib/codelens/codeLensCache.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { ITextModel } from 'vs/editor/common/model'; diff --git a/src/vs/platform/diagnostics/common/diagnosticsService.ts b/src/vs/platform/diagnostics/common/diagnosticsService.ts index 21cd8952e1..d2ebbe7a95 100644 --- a/src/vs/platform/diagnostics/common/diagnosticsService.ts +++ b/src/vs/platform/diagnostics/common/diagnosticsService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { UriComponents } from 'vs/base/common/uri'; @@ -55,4 +55,4 @@ export interface WorkspaceStats { export function isRemoteDiagnosticError(x: any): x is IRemoteDiagnosticError { return !!x.hostName && !!x.errorMessage; -} \ No newline at end of file +} diff --git a/src/vs/platform/diagnostics/node/diagnosticsService.ts b/src/vs/platform/diagnostics/node/diagnosticsService.ts index ae056538ab..bb90d8d243 100644 --- a/src/vs/platform/diagnostics/node/diagnosticsService.ts +++ b/src/vs/platform/diagnostics/node/diagnosticsService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as os from 'os'; import { virtualMachineHint } from 'vs/base/node/id'; diff --git a/src/vs/platform/dialogs/browser/dialogService.ts b/src/vs/platform/dialogs/browser/dialogService.ts index 057ed24c05..c0f5b4b909 100644 --- a/src/vs/platform/dialogs/browser/dialogService.ts +++ b/src/vs/platform/dialogs/browser/dialogService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; diff --git a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts index 0d75128e36..dd704a82a0 100644 --- a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts @@ -537,8 +537,6 @@ export class ExtensionGalleryService implements IExtensionGalleryService { /** * The result of querying the gallery returns all the extensions because it's only reading a static file. * So this method should apply all the filters and return the actual result - * @param query - * @param galleryExtensions */ private createQueryResult(query: Query, galleryExtensions: IRawGalleryExtension[]): { galleryExtensions: IRawGalleryExtension[], total: number; } { @@ -1014,4 +1012,4 @@ export function resolveMarketplaceHeaders(environmentService: IEnvironmentServic 'X-Market-User-Id': uuid }; }); -} \ No newline at end of file +} diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index 94126caeb9..73aace4479 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -231,14 +231,14 @@ export class ExtensionManagementService extends Disposable implements IExtension // {{SQL CARBON EDIT}} // Until there's a gallery for SQL Ops Studio, skip retrieving the metadata from the gallery return this.installExtension({ zipPath, identifierWithVersion, metadata: null }, type, token) - .then( - local => { - this.reportTelemetry(this.getTelemetryEvent(InstallOperation.Install), getLocalExtensionTelemetryData(local), new Date().getTime() - startTime, void 0); - this._onDidInstallExtension.fire({ identifier, zipPath, local, operation: InstallOperation.Install }); - return identifier; - }, - error => { this._onDidInstallExtension.fire({ identifier, zipPath, error, operation: InstallOperation.Install }); return Promise.reject(error); } - ); + .then( + local => { + this.reportTelemetry(this.getTelemetryEvent(InstallOperation.Install), getLocalExtensionTelemetryData(local), new Date().getTime() - startTime, void 0); + this._onDidInstallExtension.fire({ identifier, zipPath, local, operation: InstallOperation.Install }); + return identifier; + }, + error => { this._onDidInstallExtension.fire({ identifier, zipPath, error, operation: InstallOperation.Install }); return Promise.reject(error); } + ); // return this.getMetadata(getGalleryExtensionId(manifest.publisher, manifest.name)) // .then( // metadata => this.installFromZipPath(identifierWithVersion, zipPath, metadata, type, operation, token), diff --git a/src/vs/platform/launch/electron-main/launchService.ts b/src/vs/platform/launch/electron-main/launchService.ts index e7d4c1b71d..45470961db 100644 --- a/src/vs/platform/launch/electron-main/launchService.ts +++ b/src/vs/platform/launch/electron-main/launchService.ts @@ -247,8 +247,7 @@ export class LaunchService implements ILaunchService { // {{SQL CARBON EDIT}} // give the first used window a chance to process the other command line arguments - if (args['reuse-window'] && usedWindows.length > 0 && usedWindows[0]) - { + if (args['reuse-window'] && usedWindows.length > 0 && usedWindows[0]) { let window = usedWindows[0]; usedWindows[0].ready().then(() => window.send('ads:processCommandLine', args)); } diff --git a/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts b/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts index 58a1ef576d..3bc199103c 100644 --- a/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts +++ b/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { ResolvedAuthority, IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver'; diff --git a/src/vs/platform/remote/common/remoteAgentConnection.ts b/src/vs/platform/remote/common/remoteAgentConnection.ts index 4136f3de64..e272dfb225 100644 --- a/src/vs/platform/remote/common/remoteAgentConnection.ts +++ b/src/vs/platform/remote/common/remoteAgentConnection.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { Client, PersistentProtocol, ISocket } from 'vs/base/parts/ipc/common/ipc.net'; diff --git a/src/vs/platform/remote/common/tunnel.ts b/src/vs/platform/remote/common/tunnel.ts index d92f3e45d9..d4f34c9b60 100644 --- a/src/vs/platform/remote/common/tunnel.ts +++ b/src/vs/platform/remote/common/tunnel.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/vs/platform/remote/node/nodeWebSocketFactory.ts b/src/vs/platform/remote/node/nodeWebSocketFactory.ts index 9139f3e999..d2f33c732d 100644 --- a/src/vs/platform/remote/node/nodeWebSocketFactory.ts +++ b/src/vs/platform/remote/node/nodeWebSocketFactory.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as net from 'net'; diff --git a/src/vs/platform/remote/node/tunnelService.ts b/src/vs/platform/remote/node/tunnelService.ts index 2b1e8a1a04..93200f1258 100644 --- a/src/vs/platform/remote/node/tunnelService.ts +++ b/src/vs/platform/remote/node/tunnelService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { ITunnelService, RemoteTunnel } from 'vs/platform/remote/common/tunnel'; diff --git a/src/vs/platform/telemetry/common/errorTelemetry.ts b/src/vs/platform/telemetry/common/errorTelemetry.ts index e33e300334..d691243a70 100644 --- a/src/vs/platform/telemetry/common/errorTelemetry.ts +++ b/src/vs/platform/telemetry/common/errorTelemetry.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { binarySearch } from 'vs/base/common/arrays'; diff --git a/src/vs/platform/telemetry/node/errorTelemetry.ts b/src/vs/platform/telemetry/node/errorTelemetry.ts index 9cf146e5f6..331935bf13 100644 --- a/src/vs/platform/telemetry/node/errorTelemetry.ts +++ b/src/vs/platform/telemetry/node/errorTelemetry.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { onUnexpectedError } from 'vs/base/common/errors'; diff --git a/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts b/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts index 456f33c0df..9ad9bd2bcb 100644 --- a/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts +++ b/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts @@ -225,10 +225,10 @@ suite('TelemetryService', () => { // let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler(); // Errors.setUnexpectedErrorHandler(() => { }); - // try { - // let testAppender = new TestTelemetryAppender(); - // let service = new JoinableTelemetryService({ appender: testAppender }, undefined!); - // const errorTelemetry = new ErrorTelemetry(service); + // try { + // let testAppender = new TestTelemetryAppender(); + // let service = new JoinableTelemetryService({ appender: testAppender }, undefined!); + // const errorTelemetry = new ErrorTelemetry(service); // let e: any = new Error('This is a test.'); @@ -237,13 +237,13 @@ suite('TelemetryService', () => { // e.stack = 'blah'; // } - // Errors.onUnexpectedError(e); - // this.clock.tick(ErrorTelemetry.ERROR_FLUSH_TIMEOUT); - // await service.join(); + // Errors.onUnexpectedError(e); + // this.clock.tick(ErrorTelemetry.ERROR_FLUSH_TIMEOUT); + // await service.join(); - // assert.equal(testAppender.getEventsCount(), 1); - // assert.equal(testAppender.events[0].eventName, 'UnhandledError'); - // assert.equal(testAppender.events[0].data.msg, 'This is a test.'); + // assert.equal(testAppender.getEventsCount(), 1); + // assert.equal(testAppender.events[0].eventName, 'UnhandledError'); + // assert.equal(testAppender.events[0].data.msg, 'This is a test.'); // errorTelemetry.dispose(); // service.dispose(); diff --git a/src/vs/workbench/api/browser/mainThreadDebugService.ts b/src/vs/workbench/api/browser/mainThreadDebugService.ts index 9dfb425e5d..6158538500 100644 --- a/src/vs/workbench/api/browser/mainThreadDebugService.ts +++ b/src/vs/workbench/api/browser/mainThreadDebugService.ts @@ -3,9 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -// {{SQL CARBON EDIT}} -/* - import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { URI as uri } from 'vs/base/common/uri'; import { IDebugService, IConfig, IDebugConfigurationProvider, IBreakpoint, IFunctionBreakpoint, IBreakpointData, ITerminalSettings, IDebugAdapter, IDebugAdapterDescriptorFactory, IDebugSession, IDebugAdapterFactory, IDebugAdapterTrackerFactory } from 'vs/workbench/contrib/debug/common/debug'; @@ -352,9 +349,6 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb /** * DebugAdapter that communicates via extension protocol with another debug adapter. */ - -// {{SQL CARBON EDIT}} -/* class ExtensionHostDebugAdapter extends AbstractDebugAdapter { constructor(private readonly _ds: MainThreadDebugService, private _handle: number, private _proxy: ExtHostDebugServiceShape, private _session: IDebugSession) { @@ -381,5 +375,3 @@ class ExtensionHostDebugAdapter extends AbstractDebugAdapter { return Promise.resolve(this._proxy.$stopDASession(this._handle)); } } -// {{SQL CARBON EDIT}} -*/ diff --git a/src/vs/workbench/api/browser/mainThreadKeytar.ts b/src/vs/workbench/api/browser/mainThreadKeytar.ts index 4955145966..6da34102ec 100644 --- a/src/vs/workbench/api/browser/mainThreadKeytar.ts +++ b/src/vs/workbench/api/browser/mainThreadKeytar.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers'; diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index d6d977c1c0..ad60aa19c3 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -1146,8 +1146,6 @@ export interface ISourceMultiBreakpointDto { }[]; } -// {{SQL CARBON EDIT}} -/* export interface IDebugSessionFullDto { id: DebugSessionUUID; type: string; @@ -1174,8 +1172,6 @@ export interface ExtHostDebugServiceShape { $acceptDebugSessionCustomEvent(session: IDebugSessionDto, event: any): void; $acceptBreakpointsDelta(delta: IBreakpointsDeltaDto): void; } -// {{SQL CARBON EDIT}} -*/ export interface DecorationRequest { readonly id: number; @@ -1237,8 +1233,7 @@ export const MainContext = { MainThreadComments: createMainId('MainThreadComments'), MainThreadConfiguration: createMainId('MainThreadConfiguration'), MainThreadConsole: createMainId('MainThreadConsole'), - // {{SQL CARBON EDIT}} - // MainThreadDebugService: createMainId('MainThreadDebugService'), + MainThreadDebugService: createMainId('MainThreadDebugService'), MainThreadDecorations: createMainId('MainThreadDecorations'), MainThreadDiagnostics: createMainId('MainThreadDiagnostics'), MainThreadDialogs: createMainId('MainThreadDiaglogs'), @@ -1273,8 +1268,7 @@ export const ExtHostContext = { ExtHostCommands: createExtId('ExtHostCommands'), ExtHostConfiguration: createExtId('ExtHostConfiguration'), ExtHostDiagnostics: createExtId('ExtHostDiagnostics'), - // {{SQL CARBON EDIT}} - // ExtHostDebugService: createExtId('ExtHostDebugService'), + ExtHostDebugService: createExtId('ExtHostDebugService'), ExtHostDecorations: createExtId('ExtHostDecorations'), ExtHostDocumentsAndEditors: createExtId('ExtHostDocumentsAndEditors'), ExtHostDocuments: createExtId('ExtHostDocuments'), diff --git a/src/vs/workbench/api/common/extHostMemento.ts b/src/vs/workbench/api/common/extHostMemento.ts index 3921d40d63..3c08b17938 100644 --- a/src/vs/workbench/api/common/extHostMemento.ts +++ b/src/vs/workbench/api/common/extHostMemento.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { IDisposable } from 'vs/base/common/lifecycle'; diff --git a/src/vs/workbench/api/common/extHostOutput.ts b/src/vs/workbench/api/common/extHostOutput.ts index 09ae3c549f..bf8d881743 100644 --- a/src/vs/workbench/api/common/extHostOutput.ts +++ b/src/vs/workbench/api/common/extHostOutput.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { MainContext, MainThreadOutputServiceShape, IMainContext, ExtHostOutputServiceShape } from './extHost.protocol'; diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 6eaf6b5df6..b7be4d7cb2 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -142,7 +142,8 @@ export function createApiFactory( } // Check that no named customers are missing - const expected: ProxyIdentifier[] = values(ExtHostContext); + // {{SQL CARBON EDIT}} filter out the services we don't expose + const expected: ProxyIdentifier[] = values(ExtHostContext).filter(v => v !== ExtHostContext.ExtHostDebugService); rpcProtocol.assertRegistered(expected); // Other instances diff --git a/src/vs/workbench/api/node/extHostDebugService.ts b/src/vs/workbench/api/node/extHostDebugService.ts index aab3c8baf4..283def422d 100644 --- a/src/vs/workbench/api/node/extHostDebugService.ts +++ b/src/vs/workbench/api/node/extHostDebugService.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -// {{SQL CARBON EDIT}} -/* import * as path from 'vs/base/common/path'; import { Schemas } from 'vs/base/common/network'; import { URI, UriComponents } from 'vs/base/common/uri'; @@ -672,7 +670,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape { type: 'implementation', implementation: x.implementation }; - } else */ /* {{SQL CARBON EDIT}} { + } else */ { throw new Error('convertToDto unexpected type'); } } @@ -1050,6 +1048,3 @@ class DirectDebugAdapter extends AbstractDebugAdapter implements IDapTransport { throw new Error('Method not implemented.'); } } - -// {{SQL CARBON EDIT}} -*/ diff --git a/src/vs/workbench/api/node/extHostRequireInterceptor.ts b/src/vs/workbench/api/node/extHostRequireInterceptor.ts index c73c005de9..3e4a5a958a 100644 --- a/src/vs/workbench/api/node/extHostRequireInterceptor.ts +++ b/src/vs/workbench/api/node/extHostRequireInterceptor.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { TernarySearchTree } from 'vs/base/common/map'; diff --git a/src/vs/workbench/api/node/extHostStoragePaths.ts b/src/vs/workbench/api/node/extHostStoragePaths.ts index 0adb497de0..8877554eb8 100644 --- a/src/vs/workbench/api/node/extHostStoragePaths.ts +++ b/src/vs/workbench/api/node/extHostStoragePaths.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as path from 'vs/base/common/path'; diff --git a/src/vs/workbench/common/editor/editorGroup.ts b/src/vs/workbench/common/editor/editorGroup.ts index 8a5afc9965..0e56544f05 100644 --- a/src/vs/workbench/common/editor/editorGroup.ts +++ b/src/vs/workbench/common/editor/editorGroup.ts @@ -660,7 +660,7 @@ export class EditorGroup extends Disposable { // {{SQL CARBON EDIT}} // don't serialize unmodified unitited files if (e instanceof UntitledEditorInput && !e.isDirty() - && !this.configurationService.getValue('sql.promptToSaveGeneratedFiles')) { + && !this.configurationService.getValue('sql.promptToSaveGeneratedFiles')) { return; } // {{SQL CARBON EDIT}} - End diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsSlowActions.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsSlowActions.ts index fece37e6a3..87d5838c89 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsSlowActions.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsSlowActions.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as os from 'os'; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts index 4f72fa5923..477bdb8972 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts @@ -415,7 +415,7 @@ export class ExtensionsListView extends ViewletPanel { return this.getAllRecommendationsModel(query, options, token); } else if (ExtensionsListView.isRecommendedExtensionsQuery(query.value)) { return this.getRecommendationsModel(query, options, token); - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} } else if (ExtensionsListView.isAllMarketplaceExtensionsQuery(query.value)) { return this.getAllMarketplaceModel(query, options, token); } diff --git a/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts b/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts index 3bdede378a..5d162abee6 100644 --- a/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts +++ b/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts @@ -553,7 +553,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, { group: '1_new', command: { id: 'notebook.command.new', - title: nls.localize({key: 'miNewNotebook', comment: ['&& denotes a mnemonic'] }, "&&New Notebook") + title: nls.localize({ key: 'miNewNotebook', comment: ['&& denotes a mnemonic'] }, "&&New Notebook") }, order: 1.1 }); diff --git a/src/vs/workbench/contrib/logs/common/logs.contribution.ts b/src/vs/workbench/contrib/logs/common/logs.contribution.ts index b98d27561a..de9e280ab5 100644 --- a/src/vs/workbench/contrib/logs/common/logs.contribution.ts +++ b/src/vs/workbench/contrib/logs/common/logs.contribution.ts @@ -31,7 +31,7 @@ class LogOutputChannels extends Disposable implements IWorkbenchContribution { outputChannelRegistry.registerChannel({ id: Constants.rendererLogChannelId, label: nls.localize('rendererLog', "Window"), file: URI.file(join(environmentService.logsPath, `renderer${environmentService.configuration.windowId}.log`)), log: true }); // {{SQL CARBON EDIT}} - let toolsServiceLogFile : string = join(environmentService.logsPath, '..', '..', 'mssql', `sqltools_${Date.now()}.log`); + let toolsServiceLogFile: string = join(environmentService.logsPath, '..', '..', 'mssql', `sqltools_${Date.now()}.log`); console.log(`SqlTools Log file is: ${toolsServiceLogFile}`); outputChannelRegistry.registerChannel({ id: Constants.sqlToolsLogChannellId, label: nls.localize('sqlToolsLog', "Log (SqlTools)"), file: URI.file(toolsServiceLogFile), log: true }); // {{SQL CARBON EDIT}} - End diff --git a/src/vs/workbench/contrib/terminal/browser/terminalTypeAheadAddon.ts b/src/vs/workbench/contrib/terminal/browser/terminalTypeAheadAddon.ts index 03eb766019..95f9c387fc 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalTypeAheadAddon.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalTypeAheadAddon.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { Terminal as XTermTerminal } from 'vscode-xterm'; @@ -133,4 +133,4 @@ export function apply(terminalConstructor: typeof XTermTerminal) { (terminalConstructor.prototype).typeAheadInit = function (processManager: ITerminalProcessManager, themeService: IThemeService): void { init(this, processManager, themeService); }; -} \ No newline at end of file +} diff --git a/src/vs/workbench/contrib/webview/browser/webview.contribution.ts b/src/vs/workbench/contrib/webview/browser/webview.contribution.ts index f05591890d..461f1d65d7 100644 --- a/src/vs/workbench/contrib/webview/browser/webview.contribution.ts +++ b/src/vs/workbench/contrib/webview/browser/webview.contribution.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; diff --git a/src/vs/workbench/contrib/webview/common/webview.ts b/src/vs/workbench/contrib/webview/common/webview.ts index 3358c27dc9..7c0bf67e75 100644 --- a/src/vs/workbench/contrib/webview/common/webview.ts +++ b/src/vs/workbench/contrib/webview/common/webview.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { Event } from 'vs/base/common/event'; diff --git a/src/vs/workbench/contrib/webview/electron-browser/pre/electron-index.js b/src/vs/workbench/contrib/webview/electron-browser/pre/electron-index.js index 21e15e0eed..1a300af6ed 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/pre/electron-index.js +++ b/src/vs/workbench/contrib/webview/electron-browser/pre/electron-index.js @@ -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. *--------------------------------------------------------------------------------------------*/ // @ts-check (function () { diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewService.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewService.ts index e341b1864e..5cf75f076c 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewService.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/vs/workbench/services/configuration/node/configurationCache.ts b/src/vs/workbench/services/configuration/node/configurationCache.ts index 67b46a14cb..f98034591c 100644 --- a/src/vs/workbench/services/configuration/node/configurationCache.ts +++ b/src/vs/workbench/services/configuration/node/configurationCache.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as pfs from 'vs/base/node/pfs'; diff --git a/src/vs/workbench/services/configuration/node/configurationExportHelper.ts b/src/vs/workbench/services/configuration/node/configurationExportHelper.ts index 0b33f235de..04d9c2eee8 100644 --- a/src/vs/workbench/services/configuration/node/configurationExportHelper.ts +++ b/src/vs/workbench/services/configuration/node/configurationExportHelper.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { writeFile } from 'vs/base/node/pfs'; diff --git a/src/vs/workbench/services/configuration/node/configurationFileService.ts b/src/vs/workbench/services/configuration/node/configurationFileService.ts index 18690c4404..e5ef5300e9 100644 --- a/src/vs/workbench/services/configuration/node/configurationFileService.ts +++ b/src/vs/workbench/services/configuration/node/configurationFileService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as pfs from 'vs/base/node/pfs'; diff --git a/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts b/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts index 6f434fa44a..318e58687f 100644 --- a/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; @@ -28,4 +28,4 @@ export class ConfigurationResolverService extends BaseConfigurationResolverServi } } -registerSingleton(IConfigurationResolverService, ConfigurationResolverService, true); \ No newline at end of file +registerSingleton(IConfigurationResolverService, ConfigurationResolverService, true); diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 9853da28a2..c94fca9fcd 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -533,7 +533,7 @@ export class EditorService extends Disposable implements EditorServiceImpl { if (!untitledInput.resource || typeof untitledInput.filePath === 'string' || (untitledInput.resource instanceof URI && untitledInput.resource.scheme === Schemas.untitled)) { // {{SQL CARBON EDIT}} - let modeId: string = untitledInput.language ? untitledInput.language : getFileMode( this.instantiationService, untitledInput.resource); + let modeId: string = untitledInput.language ? untitledInput.language : getFileMode(this.instantiationService, untitledInput.resource); return convertEditorInput(this.untitledEditorService.createOrGet( untitledInput.filePath ? URI.file(untitledInput.filePath) : untitledInput.resource, modeId, diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index 253234d0d0..adee0a55a1 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -67,8 +67,7 @@ export class TestEditorInput extends EditorInput implements IFileEditorInput { } } */ -suite('Editor service', () => { -/* +suite('Editor service', () => {/* function registerTestEditorInput(): void { Registry.as(Extensions.Editors).registerEditor(new EditorDescriptor(TestEditorControl, 'MyTestEditorForEditorService', 'My Test Editor For Next Editor Service'), new SyncDescriptor(TestEditorInput)); } @@ -598,6 +597,5 @@ suite('Editor service', () => { let failingEditor = await service.openEditor(failingInput); assert.ok(!failingEditor); - }); - */ + });*/ }); diff --git a/src/vs/workbench/services/environment/common/environmentService.ts b/src/vs/workbench/services/environment/common/environmentService.ts index 84c501ee1e..1cb5c43394 100644 --- a/src/vs/workbench/services/environment/common/environmentService.ts +++ b/src/vs/workbench/services/environment/common/environmentService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/vs/workbench/services/environment/node/environmentService.ts b/src/vs/workbench/services/environment/node/environmentService.ts index db2a229c03..6f49558a4a 100644 --- a/src/vs/workbench/services/environment/node/environmentService.ts +++ b/src/vs/workbench/services/environment/node/environmentService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { EnvironmentService } from 'vs/platform/environment/node/environmentService'; diff --git a/src/vs/workbench/services/extensions/common/extensionHostDebug.ts b/src/vs/workbench/services/extensions/common/extensionHostDebug.ts index 08d14adc77..8f25bca59d 100644 --- a/src/vs/workbench/services/extensions/common/extensionHostDebug.ts +++ b/src/vs/workbench/services/extensions/common/extensionHostDebug.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; @@ -50,4 +50,4 @@ export interface IExtensionHostDebugService { terminateSession(sessionId: string, subId?: string): void; onTerminateSession: Event; -} \ No newline at end of file +} diff --git a/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts b/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts index 6632069611..33f1773a81 100644 --- a/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts +++ b/src/vs/workbench/services/extensions/common/extensionHostProcessManager.ts @@ -202,7 +202,8 @@ export class ExtensionHostProcessManager extends Disposable { } // Check that no named customers are missing - const expected: ProxyIdentifier[] = Object.keys(MainContext).map((key) => (MainContext)[key]); + // {{SQL CARBON EDIT}} filter out services we don't expose + const expected: ProxyIdentifier[] = Object.keys(MainContext).map((key) => (MainContext)[key]).filter(v => v !== MainContext.MainThreadDebugService); this._extensionHostProcessRPCProtocol.assertRegistered(expected); return this._extensionHostProcessRPCProtocol.getProxy(ExtHostContext.ExtHostExtensionService); diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionHostDebugService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionHostDebugService.ts index aa4a35f54d..e9208fa528 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionHostDebugService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionHostDebugService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { Event, Emitter } from 'vs/base/common/event'; diff --git a/src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts b/src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts index cd9d907c66..dadfe21783 100644 --- a/src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts +++ b/src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as nativeWatchdog from 'native-watchdog'; diff --git a/src/vs/workbench/services/files/common/workspaceWatcher.ts b/src/vs/workbench/services/files/common/workspaceWatcher.ts index a16c82e359..0aaa93c437 100644 --- a/src/vs/workbench/services/files/common/workspaceWatcher.ts +++ b/src/vs/workbench/services/files/common/workspaceWatcher.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { IDisposable, Disposable, dispose } from 'vs/base/common/lifecycle'; diff --git a/src/vs/workbench/services/files/electron-browser/diskFileSystemProvider.ts b/src/vs/workbench/services/files/electron-browser/diskFileSystemProvider.ts index 118eb6c762..37f5e31f27 100644 --- a/src/vs/workbench/services/files/electron-browser/diskFileSystemProvider.ts +++ b/src/vs/workbench/services/files/electron-browser/diskFileSystemProvider.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { shell } from 'electron'; diff --git a/src/vs/workbench/services/files/node/watcher/nodejs/watcherService.ts b/src/vs/workbench/services/files/node/watcher/nodejs/watcherService.ts index d3fe855204..73fe914c66 100644 --- a/src/vs/workbench/services/files/node/watcher/nodejs/watcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/nodejs/watcherService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { IDiskFileChange, normalizeFileChanges } from 'vs/workbench/services/files/node/watcher/watcher'; diff --git a/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts b/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts index 8924e1216c..27d92dd0b7 100644 --- a/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { getNextTickChannel } from 'vs/base/parts/ipc/common/ipc'; diff --git a/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts b/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts index 04ce4808a8..1841cb4932 100644 --- a/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { getNextTickChannel } from 'vs/base/parts/ipc/common/ipc'; diff --git a/src/vs/workbench/services/files/node/watcher/win32/watcherService.ts b/src/vs/workbench/services/files/node/watcher/win32/watcherService.ts index 0d27d68313..747f27140a 100644 --- a/src/vs/workbench/services/files/node/watcher/win32/watcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/win32/watcherService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { IDiskFileChange } from 'vs/workbench/services/files/node/watcher/watcher'; diff --git a/src/vs/workbench/services/remote/browser/remoteAgentServiceImpl.ts b/src/vs/workbench/services/remote/browser/remoteAgentServiceImpl.ts index c2e838965b..453e19b095 100644 --- a/src/vs/workbench/services/remote/browser/remoteAgentServiceImpl.ts +++ b/src/vs/workbench/services/remote/browser/remoteAgentServiceImpl.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { IEnvironmentService } from 'vs/platform/environment/common/environment'; diff --git a/src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts b/src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts index 79b10c15b6..79420d8dc8 100644 --- a/src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts +++ b/src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; diff --git a/src/vs/workbench/services/remote/node/tunnelService.ts b/src/vs/workbench/services/remote/node/tunnelService.ts index 498b12773b..33a32d207a 100644 --- a/src/vs/workbench/services/remote/node/tunnelService.ts +++ b/src/vs/workbench/services/remote/node/tunnelService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { ITunnelService, RemoteTunnel } from 'vs/platform/remote/common/tunnel'; diff --git a/src/vs/workbench/services/search/common/searchExtTypes.ts b/src/vs/workbench/services/search/common/searchExtTypes.ts index 6e75b70b49..d76a55bb08 100644 --- a/src/vs/workbench/services/search/common/searchExtTypes.ts +++ b/src/vs/workbench/services/search/common/searchExtTypes.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { CancellationToken } from 'vs/base/common/cancellation'; diff --git a/src/vs/workbench/services/search/node/ripgrepFileSearch.ts b/src/vs/workbench/services/search/node/ripgrepFileSearch.ts index 06400e95be..f791d73c20 100644 --- a/src/vs/workbench/services/search/node/ripgrepFileSearch.ts +++ b/src/vs/workbench/services/search/node/ripgrepFileSearch.ts @@ -144,7 +144,7 @@ function globExprsToRgGlobs(patterns: glob.IExpression, folder?: string, exclude } globArgs.push(fixDriveC(key)); - // {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 cast value because we aren't using strict null checks + // {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 cast value because we aren't using strict null checks } else if (value && (value).when) { siblingClauses[key] = value; } diff --git a/src/vs/workbench/services/textfile/browser/textFileService.ts b/src/vs/workbench/services/textfile/browser/textFileService.ts index d15549e21c..63ef1904ad 100644 --- a/src/vs/workbench/services/textfile/browser/textFileService.ts +++ b/src/vs/workbench/services/textfile/browser/textFileService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { TextFileService } from 'vs/workbench/services/textfile/common/textFileService'; diff --git a/src/vs/workbench/services/textfile/node/textFileService.ts b/src/vs/workbench/services/textfile/node/textFileService.ts index aa80862877..b246b83ff4 100644 --- a/src/vs/workbench/services/textfile/node/textFileService.ts +++ b/src/vs/workbench/services/textfile/node/textFileService.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import { tmpdir } from 'os'; @@ -506,4 +506,4 @@ export class EncodingOracle extends Disposable implements IResourceEncodings { } } -registerSingleton(ITextFileService, NodeTextFileService); \ No newline at end of file +registerSingleton(ITextFileService, NodeTextFileService); diff --git a/src/vs/workbench/services/textfile/test/textFileService.io.test.ts b/src/vs/workbench/services/textfile/test/textFileService.io.test.ts index 12d985b182..8c5fc900d9 100644 --- a/src/vs/workbench/services/textfile/test/textFileService.io.test.ts +++ b/src/vs/workbench/services/textfile/test/textFileService.io.test.ts @@ -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. *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; diff --git a/test/all.js b/test/all.js index a2183621bb..0cee8cdf31 100644 --- a/test/all.js +++ b/test/all.js @@ -48,7 +48,7 @@ function main() { console.error(e.stack || e); }); - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} var loaderConfig = { nodeRequire: require, nodeMain: __filename, @@ -87,7 +87,7 @@ function main() { loaderConfig.nodeInstrumenter = function (contents, source) { seenSources[source] = true; - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} if (minimatch(source, SQL_TEST_GLOB)) { return contents; } @@ -162,7 +162,7 @@ function main() { for (var entryKey in remappedCoverage) { var entry = remappedCoverage[entryKey]; entry.path = fixPath(entry.path); - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} if (!entry.path.includes('\\vs\\') && !entry.path.includes('/vs/')) { finalCoverage[fixPath(entryKey)] = entry; } @@ -179,7 +179,7 @@ function main() { coveragePath += '-single'; reportTypes = ['lcovonly']; } else { - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} reportTypes = ['json', 'lcov', 'html', 'cobertura']; } var reporter = new istanbul.Reporter(null, coveragePath); @@ -199,7 +199,7 @@ function main() { global.Node = global.window.Node; global.navigator = global.window.navigator; global.XMLHttpRequest = global.window.XMLHttpRequest; - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} global.Event = global.window.Event; require('reflect-metadata'); @@ -306,14 +306,14 @@ function main() { } }); }); - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} */ // replace the default unexpected error handler to be useful during tests loader(['vs/base/common/errors'], function (errors) { errors.setUnexpectedErrorHandler(function (err) { let stack = (err && err.stack) || (new Error().stack); - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} //unexpectedErrors.push((err && err.message ? err.message : err) + '\n' + stack); }); diff --git a/test/smoke/src/sql/sqlutils.ts b/test/smoke/src/sql/sqlutils.ts index 08a7f19106..cb604b51f4 100644 --- a/test/smoke/src/sql/sqlutils.ts +++ b/test/smoke/src/sql/sqlutils.ts @@ -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. + *--------------------------------------------------------------------------------------------*/ + import { Code } from '../vscode/code'; export async function waitForNewDialog(code: Code, title: string) { diff --git a/test/smoke/src/sql/testConfig.ts b/test/smoke/src/sql/testConfig.ts index ed64d0217c..cbb1fdb6a6 100644 --- a/test/smoke/src/sql/testConfig.ts +++ b/test/smoke/src/sql/testConfig.ts @@ -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()}`); } } @@ -146,4 +146,4 @@ export async function getTestingServers(): Promise { }); await promise; return promise; -} \ No newline at end of file +} diff --git a/tslint.json b/tslint.json index 4940f999ff..12512ea00b 100644 --- a/tslint.json +++ b/tslint.json @@ -3,22 +3,22 @@ "build/lib/tslint" ], "rules": { - // "no-arg": true, - // "no-construct": true, - // "no-duplicate-super": true, - // "no-duplicate-switch-case": true, - // "no-duplicate-variable": true, - // "no-eval": true, - // "no-redundant-jsdoc": true, - // "no-sparse-arrays": true, - // "no-string-throw": true, - // "no-unsafe-finally": true, - // "no-unused-expression": true, - // "no-var-keyword": true, - // "number-literal-format": true, + "no-arg": true, + "no-construct": true, + "no-duplicate-super": true, + "no-duplicate-switch-case": true, + "no-duplicate-variable": true, + "no-eval": true, + "no-redundant-jsdoc": true, + "no-sparse-arrays": true, + "no-string-throw": true, + "no-unsafe-finally": true, + "no-unused-expression": true, + "no-var-keyword": true, + "number-literal-format": true, "curly": true, "class-name": true, - // "label-position": true, + "label-position": true, "semicolon": [ true, "always" diff --git a/typings.json b/typings.json deleted file mode 100644 index bab86f1ebb..0000000000 --- a/typings.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "dependencies": { - "@angular/animations": "npm:@angular/animations/index.d.ts", - "@angular/common": "npm:@angular/common/common.d.ts", - "@angular/compiler": "npm:@angular/compiler/compiler.d.ts", - "@angular/core": "npm:@angular/core/core.d.ts", - "@angular/forms": "npm:@angular/forms/forms.d.ts", - "@angular/http": "npm:@angular/http/index.d.ts", - "@angular/platform-browser": "npm:@angular/platform-browser/platform-browser.d.ts", - "@angular/platform-browser-dynamic": "npm:@angular/platform-browser-dynamic/platform-browser-dynamic.d.ts", - "@angular/router": "npm:@angular/router/router.d.ts", - "@angular/upgrade": "npm:@angular/upgrade/index.d.ts", - "angular2-slickgrid": "npm:angular2-slickgrid/index.d.ts", - "angular2-grid": "npm:angular2-grid/main.d.ts", - "ng2-chart2": "npm:ng2-charts/ng2-charts.d.ts", - "reflect-metadata": "npm:reflect-metadata/index.d.ts", - "rxjs": "npm:rxjs/Rx.d.ts" - }, - "globalDependencies": { - "systemjs": "registry:dt/systemjs#0.19.29+20161215140219", - "underscore": "registry:dt/underscore#1.8.3+20161123125004", - "zone.js": "npm:zone.js\\dist\\zone.js.d.ts" - } -}