Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master:
  Fixes #22 to Detect anaconda from known locations  (#221)
  Use workspaceFolder token instead of workspaceRoot (#267)
  Fix registry lookup response (#224)
  Fix issues when running without debugging and debugged code terminates (#249)
  • Loading branch information
DonJayamanne committed Nov 22, 2017
2 parents 4b30f2c + fa820fe commit e396752
Show file tree
Hide file tree
Showing 36 changed files with 2,394 additions and 2,198 deletions.
26 changes: 13 additions & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,44 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}"
"--extensionDevelopmentPath=${workspaceFolder}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/**/*.js"
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "compile"
},
{
"name": "Launch Extension as debugServer", // https://code.visualstudio.com/docs/extensions/example-debuggers
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/out/client/debugger/Main.js",
"program": "${workspaceFolder}/out/client/debugger/Main.js",
"stopOnEntry": false,
"args": [
"--server=4711"
],
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/client/**/*.js"
"${workspaceFolder}/out/client/**/*.js"
],
"cwd": "${workspaceRoot}"
"cwd": "${workspaceFolder}"
},
{
"name": "Launch Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceRoot}/src/test",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test"
"${workspaceFolder}/src/test",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/**/*.js"
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "compile"
},
Expand All @@ -55,14 +55,14 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceRoot}/src/testMultiRootWkspc/multi.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test"
"${workspaceFolder}/src/testMultiRootWkspc/multi.code-workspace",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/**/*.js"
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "compile"
}
Expand Down
18 changes: 18 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,24 @@
"fileLocation": "relative"
}
]
},
{
"type": "gulp",
"task": "hygiene-watch",
"isBackground": true,
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": [
"$tsc",
{
"base": "$tslint5",
"fileLocation": "relative"
}
]
}
]
}
48 changes: 27 additions & 21 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const tsfmt = require('typescript-formatter');
const tslint = require('tslint');
const relative = require('relative');
const ts = require('gulp-typescript');
const watch = require('gulp-watch');
const cp = require('child_process');

/**
* Hygiene works by creating cascading subsets of all our files and
Expand Down Expand Up @@ -212,47 +214,51 @@ const hygiene = exports.hygiene = (some, options) => {

gulp.task('hygiene', () => hygiene());

// this allows us to run hygiene as a git pre-commit hook.
if (require.main === module) {
const cp = require('child_process');
gulp.task('hygiene-watch', function () {
return watch(all, function () {
run(true, true);
});
});

function run(lintOnlyModifiedFiles, doNotExit) {
function exitProcessOnError(ex) {
console.error();
console.error(ex);
if (!doNotExit) {
process.exit(1);
}
}
process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
process.exit(1);
exitProcessOnError();
});

cp.exec('git config core.autocrlf', (err, out) => {
const skipEOL = out.trim() === 'true';

if (process.argv.length > 2) {
if (!lintOnlyModifiedFiles && process.argv.length > 2) {
return hygiene(process.argv.slice(2), {
skipEOL: skipEOL
}).on('error', err => {
console.error();
console.error(err);
process.exit(1);
});
}).on('error', exitProcessOnError);
}

cp.exec('git diff --cached --name-only', {
const cmd = lintOnlyModifiedFiles ? 'git diff --name-only' : 'git diff --cached --name-only';
cp.exec(cmd, {
maxBuffer: 2000 * 1024
}, (err, out) => {
if (err) {
console.error();
console.error(err);
process.exit(1);
exitProcessOnError(err);
}

const some = out
.split(/\r?\n/)
.filter(l => !!l);

hygiene(some, {
skipEOL: skipEOL
}).on('error', err => {
console.error();
console.error(err);
process.exit(1);
});
}).on('error', exitProcessOnError);
});
});
}
// this allows us to run hygiene as a git pre-commit hook.
if (require.main === module) {
run();
}
Loading

0 comments on commit e396752

Please sign in to comment.