diff --git a/build/.nativeignore b/build/.nativeignore index c6e5ed5b21..3d6e939e2e 100644 --- a/build/.nativeignore +++ b/build/.nativeignore @@ -83,11 +83,6 @@ node-pty/deps/** !node-pty/build/Release/*.dll !node-pty/build/Release/*.node -emmet/node_modules/** - -pty.js/build/** -!pty.js/build/Release/** - # START SQL Modules @angular/**/src/** diff --git a/build/azure-pipelines/exploration-merge.yml b/build/azure-pipelines/exploration-merge.yml deleted file mode 100644 index e43c7db35e..0000000000 --- a/build/azure-pipelines/exploration-merge.yml +++ /dev/null @@ -1,39 +0,0 @@ -trigger: - branches: - include: ['master'] -pr: none - -jobs: - - job: ExplorationMerge - pool: - vmImage: Ubuntu-16.04 - steps: - - task: NodeTool@0 - inputs: - versionSpec: "10.15.1" - - - script: | - set -e - - cat << EOF > ~/.netrc - machine mssqltools.visualstudio.com - login azuredatastudio - password $(DEVOPS_PASSWORD) - EOF - - git config user.email "andresse@microsoft.com" - git config user.name "AzureDataStudio" - - git remote add explore "$ADS_EXPLORE_REPO" - git fetch explore - - git checkout -b merge-branch explore/master - - git merge origin/master - - git push explore HEAD:master - - displayName: Sync & Merge Explore - env: - ADS_EXPLORE_REPO: $(ADS_EXPLORE_REPO) - DEVOPS_PASSWORD: $(DEVOPS_PASSWORD) diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index fa024420b0..1223ae2774 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -67,7 +67,6 @@ const indentationFilter = [ // except multiple specific files '!**/package.json', - '!**/package-lock.json', // {{SQL CARBON EDIT}} '!**/yarn.lock', '!**/yarn-error.log', @@ -406,7 +405,7 @@ function createGitIndexVinyls(paths) { return e(err); } - cp.exec(`git show ":${relativePath}"`, { maxBuffer: 2000 * 1024, encoding: 'buffer' }, (err, out) => { + cp.exec(`git show :${relativePath}`, { maxBuffer: 2000 * 1024, encoding: 'buffer' }, (err, out) => { if (err) { return e(err); } diff --git a/build/lib/optimize.ts b/build/lib/optimize.ts index f58283f461..1e56a9ea68 100644 --- a/build/lib/optimize.ts +++ b/build/lib/optimize.ts @@ -32,12 +32,11 @@ function log(prefix: string, message: string): void { fancyLog(ansiColors.cyan('[' + prefix + ']'), message); } -// {{SQL CARBON EDIT}} export function loaderConfig(emptyPaths?: string[]) { const result: any = { paths: { 'vs': 'out-build/vs', - 'sql': 'out-build/sql', + 'sql': 'out-build/sql', // {{SQL CARBON EDIT}} 'vscode': 'empty:' }, nodeModules: emptyPaths || [] diff --git a/extensions/git/src/main.ts b/extensions/git/src/main.ts index 2bb2e81904..04748bbbb5 100644 --- a/extensions/git/src/main.ts +++ b/extensions/git/src/main.ts @@ -92,55 +92,54 @@ async function createModel(context: ExtensionContext, outputChannel: OutputChann return model; } -// {{SQL CARBON EDIT}} - Comment out function that is unused due to our edit below -// async function isGitRepository(folder: WorkspaceFolder): Promise { -// if (folder.uri.scheme !== 'file') { -// return false; -// } +/* {{SQL CARBON EDIT}} - Comment out function that is unused due to our edit below +async function isGitRepository(folder: WorkspaceFolder): Promise { + if (folder.uri.scheme !== 'file') { + return false; + } -// const dotGit = path.join(folder.uri.fsPath, '.git'); + const dotGit = path.join(folder.uri.fsPath, '.git'); -// try { -// const dotGitStat = await new Promise((c, e) => fs.stat(dotGit, (err, stat) => err ? e(err) : c(stat))); -// return dotGitStat.isDirectory(); -// } catch (err) { -// return false; -// } -// } + try { + const dotGitStat = await new Promise((c, e) => fs.stat(dotGit, (err, stat) => err ? e(err) : c(stat))); + return dotGitStat.isDirectory(); + } catch (err) { + return false; + } +} -// {{SQL CARBON EDIT}} - Comment out function that is unused due to our edit below -// async function warnAboutMissingGit(): Promise { -// const config = workspace.getConfiguration('git'); -// const shouldIgnore = config.get('ignoreMissingGitWarning') === true; +async function warnAboutMissingGit(): Promise { + const config = workspace.getConfiguration('git'); + const shouldIgnore = config.get('ignoreMissingGitWarning') === true; -// if (shouldIgnore) { -// return; -// } + if (shouldIgnore) { + return; + } -// if (!workspace.workspaceFolders) { -// return; -// } + if (!workspace.workspaceFolders) { + return; + } -// const areGitRepositories = await Promise.all(workspace.workspaceFolders.map(isGitRepository)); + const areGitRepositories = await Promise.all(workspace.workspaceFolders.map(isGitRepository)); -// if (areGitRepositories.every(isGitRepository => !isGitRepository)) { -// return; -// } + if (areGitRepositories.every(isGitRepository => !isGitRepository)) { + return; + } -// const download = localize('downloadgit', "Download Git"); -// const neverShowAgain = localize('neverShowAgain', "Don't Show Again"); -// const choice = await window.showWarningMessage( -// localize('notfound', "Git not found. Install it or configure it using the 'git.path' setting."), -// download, -// neverShowAgain -// ); + const download = localize('downloadgit', "Download Git"); + const neverShowAgain = localize('neverShowAgain', "Don't Show Again"); + const choice = await window.showWarningMessage( + localize('notfound', "Git not found. Install it or configure it using the 'git.path' setting."), + download, + neverShowAgain + ); -// if (choice === download) { -// commands.executeCommand('vscode.open', Uri.parse('https://git-scm.com/')); -// } else if (choice === neverShowAgain) { -// await config.update('ignoreMissingGitWarning', true, true); -// } -// } + if (choice === download) { + commands.executeCommand('vscode.open', Uri.parse('https://git-scm.com/')); + } else if (choice === neverShowAgain) { + await config.update('ignoreMissingGitWarning', true, true); + } +}*/ export async function activate(context: ExtensionContext): Promise { const disposables: Disposable[] = []; @@ -174,9 +173,8 @@ export async function activate(context: ExtensionContext): Promise throw err; } - // {{SQL CARBON EDIT}} turn-off Git missing prompt - // console.warn(err.message); - // outputChannel.appendLine(err.message); + // console.warn(err.message); {{SQL CARBON EDIT}} turn-off Git missing prompt + // outputChannel.appendLine(err.message); {{SQL CARBON EDIT}} turn-off Git missing prompt commands.executeCommand('setContext', 'git.missing', true); // warnAboutMissingGit(); {{SQL CARBON EDIT}} turn-off Git missing prompt @@ -187,36 +185,31 @@ export async function activate(context: ExtensionContext): Promise // {{SQL CARBON EDIT}} - Rename info to _info to prevent error due to unused variable async function checkGitVersion(_info: IGit): Promise { + return; /* {{SQL CARBON EDIT}} return immediately - // {{SQL CARBON EDIT}} - // remove Git version check for azuredatastudio + const config = workspace.getConfiguration('git'); + const shouldIgnore = config.get('ignoreLegacyWarning') === true; - return; + if (shouldIgnore) { + return; + } - // const config = workspace.getConfiguration('git'); - // const shouldIgnore = config.get('ignoreLegacyWarning') === true; + if (!/^[01]/.test(info.version)) { + return; + } - // if (shouldIgnore) { - // return; - // } + const update = localize('updateGit', "Update Git"); + const neverShowAgain = localize('neverShowAgain', "Don't Show Again"); - // if (!/^[01]/.test(info.version)) { - // return; - // } + const choice = await window.showWarningMessage( + localize('git20', "You seem to have git {0} installed. Code works best with git >= 2", info.version), + update, + neverShowAgain + ); - // const update = localize('updateGit', "Update Git"); - // const neverShowAgain = localize('neverShowAgain', "Don't Show Again"); - - // const choice = await window.showWarningMessage( - // localize('git20', "You seem to have git {0} installed. Code works best with git >= 2", info.version), - // update, - // neverShowAgain - // ); - - // if (choice === update) { - // commands.executeCommand('vscode.open', Uri.parse('https://git-scm.com/')); - // } else if (choice === neverShowAgain) { - // await config.update('ignoreLegacyWarning', true, true); - // } - // {{SQL CARBON EDIT}} - End + if (choice === update) { + commands.executeCommand('vscode.open', Uri.parse('https://git-scm.com/')); + } else if (choice === neverShowAgain) { + await config.update('ignoreLegacyWarning', true, true); + }*/ } diff --git a/resources/darwin/bin/code.sh b/resources/darwin/bin/code.sh index acdbd7f39d..6d1cd91cce 100755 --- a/resources/darwin/bin/code.sh +++ b/resources/darwin/bin/code.sh @@ -3,7 +3,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Source EULA. See License.txt in the project root for license information. -function realpath() { /usr/bin/python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$0"; } +function realpath() { python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$0"; } CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")" ELECTRON="$CONTENTS/MacOS/Electron" CLI="$CONTENTS/Resources/app/out/cli.js" diff --git a/scripts/test.sh b/scripts/test.sh index 31008811e1..57d725606e 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -10,7 +10,7 @@ fi cd $ROOT -if [[ "$OSTYPE" == "darwin"* ]] || [[ "$AGENT_OS" == "Darwin"* ]]; then +if [[ "$OSTYPE" == "darwin"* ]]; then NAME=`node -p "require('./product.json').nameLong"` CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron" else @@ -32,7 +32,7 @@ test -d node_modules || yarn yarn electron # Unit Tests -if [[ "$OSTYPE" == "darwin"* ]] || [[ "$AGENT_OS" == "Darwin"* ]]; then +if [[ "$OSTYPE" == "darwin"* ]]; then cd $ROOT ; ulimit -n 4096 ; \ ELECTRON_ENABLE_LOGGING=1 \ "$CODE" \ diff --git a/scripts/watch.sh b/scripts/watch.sh deleted file mode 100755 index 139f3ab469..0000000000 --- a/scripts/watch.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -gulp --max_old_space_size=2000 watch || { echo 'gulp electron failed' ; exit 1; } diff --git a/src/typings/semver-umd.d.ts b/src/typings/semver-umd.d.ts deleted file mode 100644 index 702dd75420..0000000000 --- a/src/typings/semver-umd.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare module 'semver-umd' { - - export * from "semver"; - -} \ No newline at end of file diff --git a/src/vs/platform/telemetry/test/browser/telemetryService.test.ts b/src/vs/platform/telemetry/test/browser/telemetryService.test.ts index e463fc32dd..e9eba03ee4 100644 --- a/src/vs/platform/telemetry/test/browser/telemetryService.test.ts +++ b/src/vs/platform/telemetry/test/browser/telemetryService.test.ts @@ -695,6 +695,39 @@ suite('TelemetryService', () => { this.clock.tick(ErrorTelemetry.ERROR_FLUSH_TIMEOUT); await service.join(); + assert.notEqual(testAppender.events[0].data.msg.indexOf(settings.noSuchFilePrefix), -1); + assert.equal(testAppender.events[0].data.msg.indexOf(settings.personalInfo), -1); + assert.equal(testAppender.events[0].data.msg.indexOf(settings.filePrefix), -1); + assert.notEqual(testAppender.events[0].data.callstack.indexOf(settings.noSuchFilePrefix), -1); + assert.equal(testAppender.events[0].data.callstack.indexOf(settings.personalInfo), -1); + assert.equal(testAppender.events[0].data.callstack.indexOf(settings.filePrefix), -1); + assert.notEqual(testAppender.events[0].data.callstack.indexOf(settings.stack[4].replace(settings.randomUserFile, settings.anonymizedRandomUserFile)), -1); + assert.equal(testAppender.events[0].data.callstack.split('\n').length, settings.stack.length); + errorTelemetry.dispose(); + service.dispose(); + } finally { + Errors.setUnexpectedErrorHandler(origErrorHandler); + } + })); + test.skip('Uncaught Error Telemetry removes PII but preserves No Such File error message', sinon.test(async function (this: any) { // {{SQL CARBON EDIT}} skip tests + let origErrorHandler = Errors.errorHandler.getUnexpectedErrorHandler(); + Errors.setUnexpectedErrorHandler(() => { }); + try { + let errorStub = sinon.stub(); + window.onerror = errorStub; + let settings = new ErrorTestingSettings(); + let testAppender = new TestTelemetryAppender(); + let service = new JoinableTelemetryService({ appender: testAppender }, undefined!); + const errorTelemetry = new ErrorTelemetry(service); + let noSuchFileError: any = new Error('noSuchFileMessage'); + noSuchFileError.stack = settings.stack; + (window.onerror)(settings.noSuchFileMessage, 'test.js', 2, 42, noSuchFileError); + this.clock.tick(ErrorTelemetry.ERROR_FLUSH_TIMEOUT); + await service.join(); + assert.equal(errorStub.callCount, 1); + // Test that no file information remains, but this particular + // error message does (ENOENT: no such file or directory) + Errors.onUnexpectedError(noSuchFileError); assert.notEqual(testAppender.events[0].data.msg.indexOf(settings.noSuchFilePrefix), -1); assert.equal(testAppender.events[0].data.msg.indexOf(settings.personalInfo), -1); assert.equal(testAppender.events[0].data.msg.indexOf(settings.filePrefix), -1); diff --git a/src/vs/workbench/contrib/snippets/browser/configureSnippets.ts b/src/vs/workbench/contrib/snippets/browser/configureSnippets.ts index 655eca2457..d57ceb07a5 100644 --- a/src/vs/workbench/contrib/snippets/browser/configureSnippets.ts +++ b/src/vs/workbench/contrib/snippets/browser/configureSnippets.ts @@ -263,22 +263,22 @@ MenuRegistry.appendMenuItem(MenuId.CommandPalette, { } }); -// {{SQL CARBON EDIT}} - Disable unused menu item -// MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, { -// group: '3_snippets', -// command: { -// id, -// title: nls.localize({ key: 'miOpenSnippets', comment: ['&& denotes a mnemonic'] }, "User &&Snippets") -// }, -// order: 1 -// }); +/* {{SQL CARBON EDIT}} - Disable unused menu item +MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, { + group: '3_snippets', + command: { + id, + title: nls.localize({ key: 'miOpenSnippets', comment: ['&& denotes a mnemonic'] }, "User &&Snippets") + }, + order: 1 +}); -// MenuRegistry.appendMenuItem(MenuId.GlobalActivity, { -// group: '3_snippets', -// command: { -// id, -// title: nls.localize('userSnippets', "User Snippets") -// }, -// order: 1 -// }); -// {{SQL CARBON EDIT}} - End +MenuRegistry.appendMenuItem(MenuId.GlobalActivity, { + group: '3_snippets', + command: { + id, + title: nls.localize('userSnippets', "User Snippets") + }, + order: 1 +}); +*/ diff --git a/test/automation/src/code.ts b/test/automation/src/code.ts index ae9ddcbe26..b994e280b3 100644 --- a/test/automation/src/code.ts +++ b/test/automation/src/code.ts @@ -256,9 +256,7 @@ export class Code { } async waitForWindowIds(fn: (windowIds: number[]) => boolean): Promise { - // {{SQL CARBON EDIT}} - await poll(() => this.driver.getWindowIds(), fn, `get window ids`, 600, 100); - // {{END}} + await poll(() => this.driver.getWindowIds(), fn, `get window ids`, 600, 100); // {{SQL CARBON EDIT}} } async dispatchKeybinding(keybinding: string): Promise {