Skip to content

Commit e396752

Browse files
committed
Merge remote-tracking branch 'upstream/master'
* 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)
2 parents 4b30f2c + fa820fe commit e396752

36 files changed

+2394
-2198
lines changed

.vscode/launch.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,44 @@
88
"request": "launch",
99
"runtimeExecutable": "${execPath}",
1010
"args": [
11-
"--extensionDevelopmentPath=${workspaceRoot}"
11+
"--extensionDevelopmentPath=${workspaceFolder}"
1212
],
1313
"stopOnEntry": false,
1414
"sourceMaps": true,
1515
"outFiles": [
16-
"${workspaceRoot}/out/**/*.js"
16+
"${workspaceFolder}/out/**/*.js"
1717
],
1818
"preLaunchTask": "compile"
1919
},
2020
{
2121
"name": "Launch Extension as debugServer", // https://code.visualstudio.com/docs/extensions/example-debuggers
2222
"type": "node",
2323
"request": "launch",
24-
"program": "${workspaceRoot}/out/client/debugger/Main.js",
24+
"program": "${workspaceFolder}/out/client/debugger/Main.js",
2525
"stopOnEntry": false,
2626
"args": [
2727
"--server=4711"
2828
],
2929
"sourceMaps": true,
3030
"outFiles": [
31-
"${workspaceRoot}/out/client/**/*.js"
31+
"${workspaceFolder}/out/client/**/*.js"
3232
],
33-
"cwd": "${workspaceRoot}"
33+
"cwd": "${workspaceFolder}"
3434
},
3535
{
3636
"name": "Launch Tests",
3737
"type": "extensionHost",
3838
"request": "launch",
3939
"runtimeExecutable": "${execPath}",
4040
"args": [
41-
"${workspaceRoot}/src/test",
42-
"--extensionDevelopmentPath=${workspaceRoot}",
43-
"--extensionTestsPath=${workspaceRoot}/out/test"
41+
"${workspaceFolder}/src/test",
42+
"--extensionDevelopmentPath=${workspaceFolder}",
43+
"--extensionTestsPath=${workspaceFolder}/out/test"
4444
],
4545
"stopOnEntry": false,
4646
"sourceMaps": true,
4747
"outFiles": [
48-
"${workspaceRoot}/out/**/*.js"
48+
"${workspaceFolder}/out/**/*.js"
4949
],
5050
"preLaunchTask": "compile"
5151
},
@@ -55,14 +55,14 @@
5555
"request": "launch",
5656
"runtimeExecutable": "${execPath}",
5757
"args": [
58-
"${workspaceRoot}/src/testMultiRootWkspc/multi.code-workspace",
59-
"--extensionDevelopmentPath=${workspaceRoot}",
60-
"--extensionTestsPath=${workspaceRoot}/out/test"
58+
"${workspaceFolder}/src/testMultiRootWkspc/multi.code-workspace",
59+
"--extensionDevelopmentPath=${workspaceFolder}",
60+
"--extensionTestsPath=${workspaceFolder}/out/test"
6161
],
6262
"stopOnEntry": false,
6363
"sourceMaps": true,
6464
"outFiles": [
65-
"${workspaceRoot}/out/**/*.js"
65+
"${workspaceFolder}/out/**/*.js"
6666
],
6767
"preLaunchTask": "compile"
6868
}

.vscode/tasks.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@
6565
"fileLocation": "relative"
6666
}
6767
]
68+
},
69+
{
70+
"type": "gulp",
71+
"task": "hygiene-watch",
72+
"isBackground": true,
73+
"presentation": {
74+
"echo": true,
75+
"reveal": "always",
76+
"focus": false,
77+
"panel": "shared"
78+
},
79+
"problemMatcher": [
80+
"$tsc",
81+
{
82+
"base": "$tslint5",
83+
"fileLocation": "relative"
84+
}
85+
]
6886
}
6987
]
7088
}

gulpfile.js

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ const tsfmt = require('typescript-formatter');
1212
const tslint = require('tslint');
1313
const relative = require('relative');
1414
const ts = require('gulp-typescript');
15+
const watch = require('gulp-watch');
16+
const cp = require('child_process');
1517

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

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

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

223+
function run(lintOnlyModifiedFiles, doNotExit) {
224+
function exitProcessOnError(ex) {
225+
console.error();
226+
console.error(ex);
227+
if (!doNotExit) {
228+
process.exit(1);
229+
}
230+
}
219231
process.on('unhandledRejection', (reason, p) => {
220232
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
221-
process.exit(1);
233+
exitProcessOnError();
222234
});
223235

224236
cp.exec('git config core.autocrlf', (err, out) => {
225237
const skipEOL = out.trim() === 'true';
226-
227-
if (process.argv.length > 2) {
238+
if (!lintOnlyModifiedFiles && process.argv.length > 2) {
228239
return hygiene(process.argv.slice(2), {
229240
skipEOL: skipEOL
230-
}).on('error', err => {
231-
console.error();
232-
console.error(err);
233-
process.exit(1);
234-
});
241+
}).on('error', exitProcessOnError);
235242
}
236243

237-
cp.exec('git diff --cached --name-only', {
244+
const cmd = lintOnlyModifiedFiles ? 'git diff --name-only' : 'git diff --cached --name-only';
245+
cp.exec(cmd, {
238246
maxBuffer: 2000 * 1024
239247
}, (err, out) => {
240248
if (err) {
241-
console.error();
242-
console.error(err);
243-
process.exit(1);
249+
exitProcessOnError(err);
244250
}
245-
246251
const some = out
247252
.split(/\r?\n/)
248253
.filter(l => !!l);
254+
249255
hygiene(some, {
250256
skipEOL: skipEOL
251-
}).on('error', err => {
252-
console.error();
253-
console.error(err);
254-
process.exit(1);
255-
});
257+
}).on('error', exitProcessOnError);
256258
});
257259
});
258260
}
261+
// this allows us to run hygiene as a git pre-commit hook.
262+
if (require.main === module) {
263+
run();
264+
}

0 commit comments

Comments
 (0)