|
21 | 21 | ]
|
22 | 22 | },
|
23 | 23 | "settings": {
|
| 24 | + "window.title": "PowerShell VS Code Extension Development", |
| 25 | + "debug.onTaskErrors": "prompt", |
24 | 26 | "editor.tabSize": 4,
|
25 | 27 | "editor.insertSpaces": true,
|
26 | 28 | "files.trimTrailingWhitespace": true,
|
|
44 | 46 | "powershell.codeFormatting.whitespaceBetweenParameters": true,
|
45 | 47 | "powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline",
|
46 | 48 | // Lock the TypeScript SDK path to the version we use
|
47 |
| - "typescript.tsdk": "Client/node_modules/typescript/lib" |
| 49 | + "typescript.tsdk": "Client/node_modules/typescript/lib", |
| 50 | + // Code actions like "organize imports" ignore ESLint, so we need this here |
| 51 | + "typescript.format.semicolons": "insert", |
| 52 | + // Enable ESLint as defaut formatter so quick fixes can be applied directly |
| 53 | + "eslint.format.enable": true, |
| 54 | + "[typescript]": { |
| 55 | + "editor.defaultFormatter": "dbaeumer.vscode-eslint", |
| 56 | + "editor.formatOnPaste": true, |
| 57 | + "editor.formatOnSave": true, |
| 58 | + "editor.formatOnSaveMode": "modificationsIfAvailable" |
| 59 | + } |
48 | 60 | },
|
49 | 61 | "tasks": {
|
50 | 62 | "version": "2.0.0",
|
|
90 | 102 | "options": {
|
91 | 103 | "cwd": "${workspaceFolder:Client}"
|
92 | 104 | },
|
93 |
| - "command": "Invoke-Build Build", |
| 105 | + "command": "./build.ps1", |
94 | 106 | "problemMatcher": [
|
95 | 107 | "$msCompile",
|
96 | 108 | "$tsc"
|
|
106 | 118 | "options": {
|
107 | 119 | "cwd": "${workspaceFolder:Client}"
|
108 | 120 | },
|
109 |
| - "command": "Invoke-Build Test", |
| 121 | + "command": "./build.ps1 -Test", |
110 | 122 | "problemMatcher": [
|
111 | 123 | "$msCompile",
|
112 | 124 | "$tsc"
|
|
148 | 160 | },
|
149 | 161 | "command": "Invoke-Build ${input:serverBuildCommand}",
|
150 | 162 | "group": "build"
|
151 |
| - } |
| 163 | + }, |
| 164 | + // HACK: Can't use task type npm in workspace config: https://github.com/microsoft/vscode/issues/96086 |
| 165 | + { |
| 166 | + "label": "test-watch", |
| 167 | + "icon": { |
| 168 | + "color": "terminal.ansiCyan", |
| 169 | + "id": "sync" |
| 170 | + }, |
| 171 | + "type": "shell", |
| 172 | + "options": { |
| 173 | + "cwd": "${workspaceFolder:Client}" |
| 174 | + }, |
| 175 | + "command": "npm run-script build-test-watch", |
| 176 | + "group": "test", |
| 177 | + "problemMatcher": "$tsc-watch", |
| 178 | + "isBackground": true, |
| 179 | + "dependsOn": "build-watch" // We need to also build main.js extension for testing or it leads to sourcemap errors |
| 180 | + }, |
| 181 | + { |
| 182 | + "label": "build-watch", |
| 183 | + "icon": { |
| 184 | + "color": "terminal.ansiCyan", |
| 185 | + "id": "sync" |
| 186 | + }, |
| 187 | + "type": "shell", |
| 188 | + "options": { |
| 189 | + "cwd": "${workspaceFolder:Client}" |
| 190 | + }, |
| 191 | + "command": "npm run-script build-watch", |
| 192 | + "group": "build", |
| 193 | + "problemMatcher": "$esbuild-watch", |
| 194 | + "isBackground": true, |
| 195 | + }, |
152 | 196 | ],
|
153 | 197 | "inputs": [
|
154 | 198 | {
|
|
184 | 228 | },
|
185 | 229 | "launch": {
|
186 | 230 | "version": "0.2.0",
|
| 231 | + "compounds": [ |
| 232 | + { |
| 233 | + "name": "Test Extension", |
| 234 | + "configurations": [ |
| 235 | + "ExtensionTests", |
| 236 | + "ExtensionTestRunner", |
| 237 | + ], |
| 238 | + "stopAll": true, |
| 239 | + "presentation": { |
| 240 | + "group": "test", |
| 241 | + "order": 1 |
| 242 | + }, |
| 243 | + // This is here so instead of under TestRunner so that the attach doesn't start until the compile is complete |
| 244 | + "preLaunchTask": "test-watch" |
| 245 | + } |
| 246 | + ], |
187 | 247 | "configurations": [
|
| 248 | + { |
| 249 | + "name": "Launch Extension", |
| 250 | + "type": "extensionHost", |
| 251 | + "request": "launch", |
| 252 | + "runtimeExecutable": "${execPath}", |
| 253 | + "args": [ |
| 254 | + "--extensionDevelopmentPath=${workspaceFolder:Client}" |
| 255 | + ], |
| 256 | + "env": { |
| 257 | + "__TEST_WORKSPACE_PATH": "${workspaceFolder:Client}/examples", |
| 258 | + }, |
| 259 | + "sourceMaps": true, |
| 260 | + // This speeds up source map detection and makes smartStep work correctly |
| 261 | + "outFiles": [ |
| 262 | + "${workspaceFolder:Client}/out/**/*.js", |
| 263 | + "!**/node_modules/**", |
| 264 | + "!**/.vscode-test/**" |
| 265 | + ], |
| 266 | + "skipFiles": [ |
| 267 | + "<node_internals>/**", |
| 268 | + "**/node_modules/**", |
| 269 | + "**/.vscode-test/**" |
| 270 | + ], |
| 271 | + "presentation": { |
| 272 | + "hidden": false, |
| 273 | + "group": "test", |
| 274 | + "order": 2 |
| 275 | + } |
| 276 | + }, |
188 | 277 | {
|
189 | 278 | // https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
190 | 279 | "name": "Attach to Editor Services",
|
|
197 | 286 | "searchPaths": [],
|
198 | 287 | "searchMicrosoftSymbolServer": true,
|
199 | 288 | "searchNuGetOrgSymbolServer": true
|
| 289 | + }, |
| 290 | + "presentation": { |
| 291 | + "hidden": false, |
| 292 | + "group": "test", |
| 293 | + "order": 3 |
200 | 294 | }
|
201 | 295 | },
|
202 | 296 | {
|
203 |
| - "name": "Launch Extension", |
| 297 | + // Runs the extension in an empty temp profile that is automatically cleaned up after use |
| 298 | + // Undocumented: https://github.com/microsoft/vscode-docs/issues/6220 |
| 299 | + "name": "Launch Extension - Temp Profile", |
204 | 300 | "type": "extensionHost",
|
205 | 301 | "request": "launch",
|
206 | 302 | "runtimeExecutable": "${execPath}",
|
207 | 303 | "args": [
|
208 |
| - "--disable-extensions", |
209 |
| - "--extensionDevelopmentPath=${workspaceFolder:Client}" |
| 304 | + "--profile-temp", |
| 305 | + "--extensionDevelopmentPath=${workspaceFolder:Client}", |
| 306 | + "${workspaceFolder:Client}/examples" |
210 | 307 | ],
|
211 | 308 | "sourceMaps": true,
|
| 309 | + // This speeds up source map detection and makes smartStep work correctly |
212 | 310 | "outFiles": [
|
213 |
| - "${workspaceFolder:Client}/out/main.js" |
| 311 | + "${workspaceFolder:Client}/out/**/*.js", |
| 312 | + "!**/node_modules/**", |
| 313 | + "!**/.vscode-test/**" |
| 314 | + ], |
| 315 | + "skipFiles": [ |
| 316 | + "<node_internals>/**", |
| 317 | + "**/node_modules/**", |
| 318 | + "**/.vscode-test/**" |
214 | 319 | ],
|
215 |
| - "preLaunchTask": "${defaultBuildTask}", |
| 320 | + "presentation": { |
| 321 | + "hidden": false, |
| 322 | + "group": "test", |
| 323 | + "order": 2 |
| 324 | + } |
216 | 325 | },
|
217 | 326 | {
|
218 |
| - "name": "Launch Extension Tests", |
| 327 | + // Runs the extension in an isolated but persistent profile separate from the user settings |
| 328 | + // Undocumented: https://github.com/microsoft/vscode-docs/issues/6220 |
| 329 | + "name": "Launch Extension - Isolated Profile", |
219 | 330 | "type": "extensionHost",
|
220 | 331 | "request": "launch",
|
221 | 332 | "runtimeExecutable": "${execPath}",
|
222 | 333 | "args": [
|
223 |
| - // The tests require Code be opened with a workspace, which exists in |
224 |
| - // `test`, but this has to be passed as a CLI argument, not just `cwd`. |
225 |
| - "${workspaceFolder:Client}/test", |
226 |
| - "--disableExtensions", |
| 334 | + "--profile=debug", |
227 | 335 | "--extensionDevelopmentPath=${workspaceFolder:Client}",
|
228 |
| - "--extensionTestsPath=${workspaceFolder:Client}/out/test/index.js", |
| 336 | + "${workspaceFolder:Client}/examples" |
229 | 337 | ],
|
230 | 338 | "sourceMaps": true,
|
| 339 | + // This speeds up source map detection and makes smartStep work correctly |
231 | 340 | "outFiles": [
|
232 |
| - "${workspaceFolder:Client}/out/test/**/*.js" |
| 341 | + "${workspaceFolder:Client}/out/**/*.js", |
| 342 | + "!**/node_modules/**", |
| 343 | + "!**/.vscode-test/**" |
| 344 | + ], |
| 345 | + "skipFiles": [ |
| 346 | + "<node_internals>/**", |
| 347 | + "**/node_modules/**", |
| 348 | + "**/.vscode-test/**" |
| 349 | + ], |
| 350 | + "presentation": { |
| 351 | + "hidden": false, |
| 352 | + "group": "test", |
| 353 | + "order": 2 |
| 354 | + } |
| 355 | + }, |
| 356 | + { |
| 357 | + "name": "ExtensionTestRunner", |
| 358 | + "type": "node", |
| 359 | + "request": "launch", |
| 360 | + "program": "${workspaceFolder:Client}/out/test/runTests.js", |
| 361 | + "cascadeTerminateToConfigurations": [ |
| 362 | + "ExtensionTests", |
| 363 | + ], |
| 364 | + // This speeds up source map detection and makes smartStep work correctly |
| 365 | + "outFiles": [ |
| 366 | + "${workspaceFolder:Client}/out/**/*.js", |
| 367 | + "!**/node_modules/**", |
| 368 | + "!**/.vscode-test/**" |
| 369 | + ], |
| 370 | + "skipFiles": [ |
| 371 | + "<node_internals>/**", |
| 372 | + "**/node_modules/**", |
| 373 | + "**/.vscode-test/**" |
| 374 | + ], |
| 375 | + "args": [ |
| 376 | + "59229" // Wait on this port for the separate debugger task to attach |
| 377 | + ], |
| 378 | + "presentation": { |
| 379 | + "hidden": true, |
| 380 | + }, |
| 381 | + "internalConsoleOptions": "neverOpen", |
| 382 | + "console": "integratedTerminal", |
| 383 | + "autoAttachChildProcesses": false // Doesnt work with the extension host for whatever reason, hence the separate attach. |
| 384 | + }, |
| 385 | + { |
| 386 | + "name": "ExtensionTests", |
| 387 | + "type": "node", |
| 388 | + "request": "attach", |
| 389 | + "port": 59229, |
| 390 | + "autoAttachChildProcesses": true, |
| 391 | + "outputCapture": "console", |
| 392 | + "continueOnAttach": true, |
| 393 | + // Sometimes we may need to install extensions or reload the window which requires reconnecting |
| 394 | + "restart": { |
| 395 | + "delay": 1000, |
| 396 | + "maxAttempts": 3 |
| 397 | + }, |
| 398 | + "presentation": { |
| 399 | + "hidden": true, |
| 400 | + }, |
| 401 | + // This speeds up source map detection and makes smartStep work correctly |
| 402 | + "outFiles": [ |
| 403 | + "${workspaceFolder:Client}/out/**/*.js", |
| 404 | + "!**/node_modules/**", |
| 405 | + "!**/.vscode-test/**" |
| 406 | + ], |
| 407 | + "skipFiles": [ |
| 408 | + "<node_internals>/**", |
| 409 | + "**/node_modules/**", |
| 410 | + "**/.vscode-test/**" |
233 | 411 | ],
|
234 |
| - "preLaunchTask": "${defaultBuildTask}", |
235 |
| - "internalConsoleOptions": "openOnSessionStart" |
236 | 412 | }
|
237 | 413 | ]
|
238 | 414 | }
|
|
0 commit comments