Skip to content

Commit 2bc6b2e

Browse files
authored
#1228 multi root master (#2)
* Add support for multi roots for formatting and linting (#1281) * update to use latest api * config changes for multiroot workspace * linting support with multi roots * multi root support for formatters * determine workspace root path * revert change * support multiple configs per workspace folder * modify formatters to use resource specific settings * modified to settings are resolved using document uri * 1228 multi root master (#1) * fix #1280 handle env in shebang (#1290) * handle shebangs that resolve paths from env * oops * make test more specific * handle promise * fix #1282 use PYTHONIOENCODING variable (#1291) * fix #1270 debugger contribution changes (#1288) * add onDebug activation * use debug config provider for non workspace debugging * forgot to save file before commiting a merge * ability to opt out of telemetry using vscode settings (#1297) * Fix #1284 debugging parameterized tests (#1299) * fix #1298 remove vscode.startDebug command (#1300) * fix #1298 remove vscode.startDebug command * fix code review comments * added period as per code review comments * #1288 installer config and tests (#1302) * update to use latest api * config changes for multiroot workspace * linting support with multi roots * multi root support for formatters * determine workspace root path * revert change * support multiple configs per workspace folder * modify formatters to use resource specific settings * modified installer to pass resource for workspace resolution * null test in installer * canges to config settings to support multiroot workspace * changes to code refactoring to support workspace symbols * oops * modified to settings are resolved using document uri * unit tests for multi root support * fix unittests for multiroot * exclude files * add new line * config changes for multiroot workspace * new lines and enabled multi root linter tests * fix sys variables * added unit test to resolve ${workspaceRoot} in settings.json * fixed code review comments * fixed code review comments * fix #1276 Pre-commit hooks to ensure code complies with standards (#1277) * sanitize code * gulp file to check code hygiene * fix preLaunchTask in launch.json * added missing packages * enabled pre-commit using husky * enabled a few checks for precommit hook * fix tslint warnings when running tslint via gulp * exclude webpack building, else tries to pull in tests as well * improved checks for commits (strict) * added new lines * 1228 multi root workspace symbols (#1307) * update to use latest api * config changes for multiroot workspace * linting support with multi roots * multi root support for formatters * determine workspace root path * revert change * support multiple configs per workspace folder * modify formatters to use resource specific settings * modified installer to pass resource for workspace resolution * null test in installer * canges to config settings to support multiroot workspace * changes to code refactoring to support workspace symbols * oops * modified to settings are resolved using document uri * unit tests for multi root support * fix unittests for multiroot * exclude files * add new line * config changes for multiroot workspace * new lines and enabled multi root linter tests * fix sys variables * added unit test to resolve ${workspaceRoot} in settings.json * #1228 workspace symbols with multiroot support * fix test * added some data for workspace symbol tests * data for unit tests * fixed to add support for multit roots with unit tests * account for mutiroot files in sub directory * disable all but multiroot tests * fixed tests * include files for tests * Fixed travis tests for multi root workspace symbols (#1306) * added logging * more logging * yay * fixed * more fixes * fix tests * removed logging * enable all tests * uncommented * Added brackets around print statements (for p3) * Fixed travis unit tests (#1308) * update to use latest api * config changes for multiroot workspace * linting support with multi roots * multi root support for formatters * determine workspace root path * revert change * support multiple configs per workspace folder * modify formatters to use resource specific settings * modified installer to pass resource for workspace resolution * null test in installer * canges to config settings to support multiroot workspace * changes to code refactoring to support workspace symbols * oops * modified to settings are resolved using document uri * unit tests for multi root support * fix unittests for multiroot * exclude files * add new line * config changes for multiroot workspace * new lines and enabled multi root linter tests * fix sys variables * added unit test to resolve ${workspaceRoot} in settings.json * #1228 workspace symbols with multiroot support * fix test * added some data for workspace symbol tests * data for unit tests * fixed to add support for multit roots with unit tests * account for mutiroot files in sub directory * disable all but multiroot tests * fixed tests * fix tests * test where failing * properly determine root workspace * fix pytest unit test * delete files * add awaiter * use a path that works on multiple os * fixes * uncomment * invert * debug statements * use default workspace * reverted unwanted changes * oops * test unittests only * more logging * partial fixes to unit tests * run all tests * changes not to set paths for shebang tests * remove comments * update settings only if necessary * fix test * include files for tests * Fixed travis tests for multi root workspace symbols (#1306) * added logging * more logging * yay * fixed * more fixes * fix tests * removed logging * enable all tests * uncommented * Added brackets around print statements (for p3) * use resource when getting settings * fix #1315 unit tests need to wait for extension to activate (#1316) * fix #1314 allow for simultaneous language features (#1317) * #1228 support multi roots in language service (#1309) * update to use latest api * config changes for multiroot workspace * linting support with multi roots * multi root support for formatters * determine workspace root path * revert change * support multiple configs per workspace folder * modify formatters to use resource specific settings * modified installer to pass resource for workspace resolution * null test in installer * canges to config settings to support multiroot workspace * changes to code refactoring to support workspace symbols * oops * modified to settings are resolved using document uri * unit tests for multi root support * fix unittests for multiroot * exclude files * add new line * config changes for multiroot workspace * new lines and enabled multi root linter tests * fix sys variables * added unit test to resolve ${workspaceRoot} in settings.json * #1228 workspace symbols with multiroot support * fix test * added some data for workspace symbol tests * data for unit tests * fixed to add support for multit roots with unit tests * account for mutiroot files in sub directory * disable all but multiroot tests * fixed tests * fix tests * test where failing * properly determine root workspace * fix pytest unit test * delete files * add awaiter * use a path that works on multiple os * fixes * uncomment * invert * debug statements * use default workspace * reverted unwanted changes * oops * test unittests only * more logging * partial fixes to unit tests * run all tests * changes not to set paths for shebang tests * remove comments * update settings only if necessary * fix test * include files for tests * Fixed travis tests for multi root workspace symbols (#1306) * added logging * more logging * yay * fixed * more fixes * fix tests * removed logging * enable all tests * uncommented * Added brackets around print statements (for p3) * use resource when getting settings * support multiroot in language services * add additional tests for #1314 (#1318) * #1228 run all tests under multiroot (#1322) * modifications to fix tests to run under multi root setup * log errors * fix return type * fix linter messages * fix linter errors * changes to ensure code is formatted correctly * fixed comments * delete unwanted file * hide unwanted folders * fixes to linters to run on multiroot setup * udpate settings sequentially * log the output * show errors in deleting dir * removed prospector test, to be completed in #1319 * fixes to tests and sorting provider * fixed test for interpreter display * undo commenting of code * add new line * fix code review issues * ensure else is properly formatted * fix code review comments * fix #1304 preserve empty lines (#1329) * #1228 multiroot interpreter display (#1339) * modifications to fix tests to run under multi root setup * log errors * fix return type * fix linter messages * fix linter errors * changes to ensure code is formatted correctly * fixed comments * delete unwanted file * hide unwanted folders * fixes to linters to run on multiroot setup * udpate settings sequentially * log the output * show errors in deleting dir * removed prospector test, to be completed in #1319 * fixes to tests and sorting provider * fixed test for interpreter display * undo commenting of code * add new line * support multi root in interpreter display * fix linter * changed package version * disabled multiroot test * backwards compatible change * fix nose tests * revert change * enable test but disable it * multi root support in utils.ts * fixed #1328 * retries for flaky unit tests * retry beforeEach * common retry decorator * enable telemetry for extension loads * disable jupyter tests in multiroot tests * clean up python Path before and after testsclean up python Path before and after tests * rename test env variable * dispose cfg settings * dispose cfg settings * update comment * clean up * rearrange to ensurfe launching ext is first debug option * bug fix for display name * resolved code review comment * Fixed typp * 1228 multiroot interpreter ui changes (#1345) * fixes to unit tests and forgotten multiroot * globally retry all tests 3 times * refactor changing interpreters * added tests * fixed linter * removed redundant files * removed unwanted grep * remove blank line * fix 948 remove hardcoding of port number (#1353) * fix #1041 when debugging a test do not cancel it when re-discovering tests (#1354) * fix 1041 when debugging a test do not cancel it when re-discovering tests * create enum for creation of cancellation token * dispose correct cancellationToken * bug fix - in unit tests * bug fix - in unit tests * #1228 multiroot unit test runner (#1357) * fixes to unit tests and forgotten multiroot * globally retry all tests 3 times * refactor changing interpreters * added tests * fixed linter * removed redundant files * temp changes * more changes * lots of refactoring * adding support for multiroot workspaces * removed grep * copy changes for #948 and #1353 into multroot * replicate solution for #1041 and #1354 * #1041 create enum for creation of cancellation token * multiroot support for unit tests * remove empty line (linter warning) * delete pyc before making changes to py file * delete pyc file in teardown * merged multiroot master * pass uri of workspace when displaing prompt for configuration * pass uri to commands * fixed typos based on code review * prefix path with forward slash, as is done in the extension unit tests
1 parent 45a456b commit 2bc6b2e

File tree

226 files changed

+8264
-4016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+8264
-4016
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ root = true
88
indent_style = space
99
indent_size = 4
1010
trim_trailing_whitespace = true
11+
insert_final_newline = true
1112

1213
# The indent size used in the `package.json` file cannot be changed
1314
# https://github.com/npm/npm/pull/3180#issuecomment-16336516

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
out
33
node_modules
44
*.pyc
5-
.vscode/.ropeproject/**
6-
src/test/.vscode/**
5+
**/.vscode/.ropeproject/**
76
**/testFiles/**/.cache/**
87
*.noseids
8+
.vscode-test
9+
__pycache__
10+
npm-debug.log
11+
**/.mypy_cache/**

.jshintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.jshintrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ before_install: |
4848
pyenv install $PYTHON
4949
pyenv global $PYTHON
5050
fi
51+
export TRAVIS_PYTHON_PATH=`which python`
5152
install:
5253
- pip install --upgrade -r requirements.txt
5354
- npm install

.vscode/launch.json

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
// A launch configuration that compiles the extension and then opens it inside a new window
22
{
33
"version": "0.1.0",
4-
"configurations": [{
5-
"name": "CompletionServer.ppy",
6-
"type": "python",
7-
"request": "launch",
8-
"stopOnEntry": true,
9-
"pythonPath": "python",
10-
"program": "${workspaceRoot}/pythonFiles/completionServer.py",
11-
"cwd": "${workspaceRoot}",
12-
"env": {},
13-
"args": [
14-
"123"
15-
],
16-
"envFile": "${workspaceRoot}/.env",
17-
"debugOptions": [
18-
"WaitOnAbnormalExit",
19-
"WaitOnNormalExit",
20-
"RedirectOutput"
21-
]
22-
},
4+
"configurations": [
235
{
246
"name": "Launch Extension",
257
"type": "extensionHost",
@@ -30,7 +12,9 @@
3012
],
3113
"stopOnEntry": false,
3214
"sourceMaps": true,
33-
"outDir": "${workspaceRoot}/out",
15+
"outFiles": [
16+
"${workspaceRoot}/out/**/*.js"
17+
],
3418
"preLaunchTask": "compile"
3519
},
3620
{
@@ -43,7 +27,9 @@
4327
"--server=4711"
4428
],
4529
"sourceMaps": true,
46-
"outDir": "${workspaceRoot}/out/client",
30+
"outFiles": [
31+
"${workspaceRoot}/out/client/**/*.js"
32+
],
4733
"cwd": "${workspaceRoot}"
4834
},
4935
{
@@ -58,33 +44,36 @@
5844
],
5945
"stopOnEntry": false,
6046
"sourceMaps": true,
61-
"xxoutDir": "${workspaceRoot}/out/test",
6247
"outFiles": [
6348
"${workspaceRoot}/out/**/*.js"
6449
],
6550
"preLaunchTask": "compile"
6651
},
6752
{
68-
"name": "Python",
69-
"type": "python",
53+
"name": "Launch Multiroot Tests",
54+
"type": "extensionHost",
7055
"request": "launch",
71-
"stopOnEntry": true,
72-
"pythonPath": "python",
73-
"program": "${file}",
74-
"console": "integratedTerminal",
75-
"args": [],
76-
"debugOptions": [
77-
"WaitOnAbnormalExit",
78-
"WaitOnNormalExit",
79-
"RedirectOutput"
56+
"runtimeExecutable": "${execPath}",
57+
"args": [
58+
"${workspaceRoot}/src/testMultiRootWkspc/multi.code-workspace",
59+
"--extensionDevelopmentPath=${workspaceRoot}",
60+
"--extensionTestsPath=${workspaceRoot}/out/test"
8061
],
81-
"cwd": "${workspaceRoot}"
62+
"stopOnEntry": false,
63+
"sourceMaps": true,
64+
"outFiles": [
65+
"${workspaceRoot}/out/**/*.js"
66+
],
67+
"preLaunchTask": "compile"
8268
}
8369
],
84-
"compounds": [{
85-
"name": "Extension + Debugger",
86-
"configurations": [
87-
"Launch Extension", "Launch Extension as debugServer"
88-
]
89-
}]
70+
"compounds": [
71+
{
72+
"name": "Extension + Debugger",
73+
"configurations": [
74+
"Launch Extension",
75+
"Launch Extension as debugServer"
76+
]
77+
}
78+
]
9079
}

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
"out": true, // set this to true to hide the "out" folder with the compiled JS files
55
"**/*.pyc": true,
66
"**/__pycache__": true,
7-
"node_modules": true
7+
"node_modules": true,
8+
".vscode-test": true,
9+
"**/.mypy_cache/**": true,
10+
"**/.ropeproject/**": true
811
},
912
"search.exclude": {
1013
"out": true // set this to false to include "out" folder in search results

.vscode/tasks.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@
5353
"fileLocation": "relative"
5454
}
5555
]
56+
},
57+
{
58+
"label": "lint-staged",
59+
"type": "npm",
60+
"script": "lint-staged",
61+
"problemMatcher": [
62+
"$tsc",
63+
{
64+
"base": "$tslint5",
65+
"fileLocation": "relative"
66+
}
67+
]
5668
}
5769
]
5870
}

gulpfile.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function reportFailures(failures) {
8080
const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line;
8181
const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character;
8282

83-
// Output in format similar to tslint for the linter to pickup
83+
// Output in format similar to tslint for the linter to pickup.
8484
console.error(`ERROR: (${failure.ruleName}) ${relative(__dirname, name)}[${line + 1}, ${character + 1}]: ${failure.failure}`);
8585
});
8686
}
@@ -103,9 +103,9 @@ const hygiene = exports.hygiene = (some, options) => {
103103
.split(/\r\n|\r|\n/)
104104
.forEach((line, i) => {
105105
if (/^\s*$/.test(line)) {
106-
// empty or whitespace lines are OK
106+
// Empty or whitespace lines are OK.
107107
} else if (/^(\s\s\s\s)+.*/.test(line)) {
108-
// good indent
108+
// Good indent.
109109
} else if (/^[\t]+.*/.test(line)) {
110110
console.error(file.relative + '(' + (i + 1) + ',1): Bad whitespace indentation');
111111
errorCount++;
@@ -118,9 +118,10 @@ const hygiene = exports.hygiene = (some, options) => {
118118
const formatting = es.map(function (file, cb) {
119119
tsfmt.processString(file.path, file.contents.toString('utf8'), {
120120
verify: true,
121-
tsfmt: true,
122-
editorconfig: true
123-
// verbose: true
121+
tsconfig: true,
122+
tslint: true,
123+
editorconfig: true,
124+
tsfmt: true
124125
}).then(result => {
125126
if (result.error) {
126127
console.error(result.message);
@@ -176,7 +177,7 @@ const hygiene = exports.hygiene = (some, options) => {
176177
console.error(error.message);
177178
},
178179
finish: function () {
179-
// forget the summary
180+
// forget the summary.
180181
}
181182
};
182183
}
@@ -213,7 +214,7 @@ const hygiene = exports.hygiene = (some, options) => {
213214

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

216-
// this allows us to run hygiene as a git pre-commit hook
217+
// this allows us to run hygiene as a git pre-commit hook.
217218
if (require.main === module) {
218219
const cp = require('child_process');
219220

0 commit comments

Comments
 (0)