Skip to content

Commit

Permalink
Removing some unnecessary differences (microsoft#9495)
Browse files Browse the repository at this point in the history
* work on removing some unncessary differences

* fix compile

* skip another test
  • Loading branch information
Anthony Dresser authored Apr 18, 2020
1 parent 6f066e9 commit dd6b958
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 163 deletions.
5 changes: 0 additions & 5 deletions build/.nativeignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/**
Expand Down
39 changes: 0 additions & 39 deletions build/azure-pipelines/exploration-merge.yml

This file was deleted.

3 changes: 1 addition & 2 deletions build/gulpfile.hygiene.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const indentationFilter = [

// except multiple specific files
'!**/package.json',
'!**/package-lock.json', // {{SQL CARBON EDIT}}
'!**/yarn.lock',
'!**/yarn-error.log',

Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions build/lib/optimize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || []
Expand Down
149 changes: 71 additions & 78 deletions extensions/git/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean> {
// if (folder.uri.scheme !== 'file') {
// return false;
// }

// const dotGit = path.join(folder.uri.fsPath, '.git');

// try {
// const dotGitStat = await new Promise<fs.Stats>((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<void> {
// const config = workspace.getConfiguration('git');
// const shouldIgnore = config.get<boolean>('ignoreMissingGitWarning') === true;

// if (shouldIgnore) {
// return;
// }

// if (!workspace.workspaceFolders) {
// return;
// }

// const areGitRepositories = await Promise.all(workspace.workspaceFolders.map(isGitRepository));

// 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
// );

// if (choice === download) {
// commands.executeCommand('vscode.open', Uri.parse('https://git-scm.com/'));
// } else if (choice === neverShowAgain) {
// await config.update('ignoreMissingGitWarning', true, true);
// }
// }
/* {{SQL CARBON EDIT}} - Comment out function that is unused due to our edit below
async function isGitRepository(folder: WorkspaceFolder): Promise<boolean> {
if (folder.uri.scheme !== 'file') {
return false;
}
const dotGit = path.join(folder.uri.fsPath, '.git');
try {
const dotGitStat = await new Promise<fs.Stats>((c, e) => fs.stat(dotGit, (err, stat) => err ? e(err) : c(stat)));
return dotGitStat.isDirectory();
} catch (err) {
return false;
}
}
async function warnAboutMissingGit(): Promise<void> {
const config = workspace.getConfiguration('git');
const shouldIgnore = config.get<boolean>('ignoreMissingGitWarning') === true;
if (shouldIgnore) {
return;
}
if (!workspace.workspaceFolders) {
return;
}
const areGitRepositories = await Promise.all(workspace.workspaceFolders.map(isGitRepository));
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
);
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<GitExtension> {
const disposables: Disposable[] = [];
Expand Down Expand Up @@ -174,9 +173,8 @@ export async function activate(context: ExtensionContext): Promise<GitExtension>
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
Expand All @@ -187,36 +185,31 @@ export async function activate(context: ExtensionContext): Promise<GitExtension>

// {{SQL CARBON EDIT}} - Rename info to _info to prevent error due to unused variable
async function checkGitVersion(_info: IGit): Promise<void> {
return; /* {{SQL CARBON EDIT}} return immediately
// {{SQL CARBON EDIT}}
// remove Git version check for azuredatastudio

return;

// const config = workspace.getConfiguration('git');
// const shouldIgnore = config.get<boolean>('ignoreLegacyWarning') === true;
const config = workspace.getConfiguration('git');
const shouldIgnore = config.get<boolean>('ignoreLegacyWarning') === true;
// if (shouldIgnore) {
// return;
// }
if (shouldIgnore) {
return;
}
// if (!/^[01]/.test(info.version)) {
// return;
// }
if (!/^[01]/.test(info.version)) {
return;
}
// const update = localize('updateGit', "Update Git");
// const neverShowAgain = localize('neverShowAgain', "Don't Show Again");
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
// );
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);
}*/
}
2 changes: 1 addition & 1 deletion resources/darwin/bin/code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" \
Expand Down
2 changes: 0 additions & 2 deletions scripts/watch.sh

This file was deleted.

10 changes: 0 additions & 10 deletions src/typings/semver-umd.d.ts

This file was deleted.

33 changes: 33 additions & 0 deletions src/vs/platform/telemetry/test/browser/telemetryService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
(<any>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);
Expand Down
38 changes: 19 additions & 19 deletions src/vs/workbench/contrib/snippets/browser/configureSnippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
// });

// MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
// group: '3_snippets',
// command: {
// id,
// title: nls.localize('userSnippets', "User Snippets")
// },
// order: 1
// });
// {{SQL CARBON EDIT}} - End
/* {{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
});
*/
4 changes: 1 addition & 3 deletions test/automation/src/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ export class Code {
}

async waitForWindowIds(fn: (windowIds: number[]) => boolean): Promise<void> {
// {{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<void> {
Expand Down

0 comments on commit dd6b958

Please sign in to comment.