diff --git a/.vscode/launch.json b/.vscode/launch.json index 81f3a0936ff..40e8dfc7fe0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -17,7 +17,7 @@ "${workspaceFolder}/dist/**/*", "!${workspaceFolder}/**/node_modules**/*" ], - "preLaunchTask": "Compile", + "preLaunchTask": "watch", "skipFiles": [ "/**" ], @@ -49,58 +49,7 @@ "${workspaceFolder}/dist/**/*", "!${workspaceFolder}/**/node_modules**/*" ], - "preLaunchTask": "Compile", - "presentation": { - "group": "1_extension", - "order": 1 - } - }, - { - "name": "Extension (web with daemon compilation)", - "type": "extensionHost", - "debugWebWorkerHost": true, - "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}", - "--extensionDevelopmentKind=web" - ], - "outFiles": [ - "${workspaceFolder}/dist/**/*", - "!${workspaceFolder}/**/node_modules**/*" - ], - "presentation": { - "group": "1_extension", - "order": 1 - } - }, - { - "name": "Extension (with daemon compilation)", - "type": "extensionHost", - "request": "launch", - "runtimeExecutable": "${execPath}", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}", - "--enable-proposed-api" - ], - "smartStep": true, - "sourceMaps": true, - "outFiles": [ - "${workspaceFolder}/dist/**/*", - "!${workspaceFolder}/**/node_modules**/*" - ], - "skipFiles": [ - "/**" - ], - "env": { - // Disable this to turoff on redux & console logging during debugging - "VSC_JUPYTER_FORCE_LOGGING": "1", - // Enable this to log telemetry to the output during debugging - "XVSC_JUPYTER_LOG_TELEMETRY": "1", - // Enable this to log IPYWIDGET messages - "XVSC_JUPYTER_LOG_IPYWIDGETS": "1", - // Enable this to log debugger output. Directory must exist ahead of time - "XDEBUGPY_LOG_DIR": "${workspaceRoot}/tmp/Debug_Output_Ex" - }, + "preLaunchTask": "watch", "presentation": { "group": "1_extension", "order": 1 @@ -121,7 +70,7 @@ "${workspaceFolder}/dist/**/*", "!${workspaceFolder}/**/node_modules**/*" ], - "preLaunchTask": "Compile", + "preLaunchTask": "watch", "presentation": { "group": "1_extension", "order": 3 @@ -191,7 +140,7 @@ "${workspaceFolder}/out/**/*.js", "!${workspaceFolder}/**/node_modules**/*" ], - "preLaunchTask": "Compile", + "preLaunchTask": "watch", "skipFiles": [ "/**" ], @@ -261,7 +210,7 @@ "${workspaceFolder}/out/**/*.js", "!${workspaceFolder}/**/node_modules**/*" ], - "preLaunchTask": "Compile", + "preLaunchTask": "watch", "skipFiles": [ "/**" ], @@ -465,7 +414,7 @@ }, { "name": "Python: Current File with iPython", - "type": "python", + "type": "debugpy", "request": "launch", "module": "IPython", "console": "integratedTerminal", @@ -479,7 +428,7 @@ }, { "name": "Python: Current File", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${file}", "console": "integratedTerminal", diff --git a/.vscode/settings.json b/.vscode/settings.json index dad99fd75b2..6153cce8760 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -42,7 +42,10 @@ "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "git.branchProtection": ["main", "release*"], + "git.branchProtection": [ + "main", + "release*" + ], "git.branchProtectionPrompt": "alwaysCommitToNewBranch", "javascript.preferences.quoteStyle": "single", "typescript.tsdk": "./node_modules/typescript/lib", // we want to use the TS server from our node_modules folder to control its version @@ -58,6 +61,12 @@ "mochaExplorer.files": "./out/test/**/*.unit.test.js", "mochaExplorer.configFile": "./build/.mocha.unittests.js.json", "mochaExplorer.ui": "tdd", - "mochaExplorer.nodeArgv": ["--enable-source-maps"], - "testExplorer.useNativeTesting": true -} + "mochaExplorer.nodeArgv": [ + "--enable-source-maps" + ], + "testExplorer.useNativeTesting": true, + "python.analysis.enablePytestSupport": false, + "python.analysis.exclude": [ + "*.ipynb" + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 48c0d89972d..91c3c74fbc0 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -8,33 +8,44 @@ }, "tasks": [ { - "label": "Compile", - "type": "npm", - "script": "compile", - "isBackground": true, - "problemMatcher": [ - { - "applyTo": "closedDocuments", - "fileLocation": "relative", - "source": "esbuild + tsc", - "pattern": [ - { - "regexp": ": ([A-Za-z0-9]*) ([A-Za-z0-9]*): (.*)", - "severity": 1, - "message": 3 - }, - { - "regexp": "\\[[0-9]*\\] (.*)\\(([0-9]*),([0-9]*)\\)", - "file": 1, - "line": 2, - "column": 3 - } - ] - } + "label": "watch", + "dependsOn": [ + "npm: compile-esbuild-watch", + "npm: compile-tsc-watch" ], + "presentation": { + "reveal": "never", + }, "group": { "kind": "build", "isDefault": true + }, + "runOptions": { + "runOn": "folderOpen" + } + }, + { + "type": "npm", + "script": "compile-esbuild-watch", + "group": "build", + "problemMatcher": "$esbuild-watch", + "isBackground": true, + "label": "npm: compile-esbuild-watch", + "presentation": { + "group": "watch", + "reveal": "never" + } + }, + { + "type": "npm", + "script": "compile-tsc-watch", + "group": "build", + "problemMatcher": "$tsc-watch", + "isBackground": true, + "label": "npm: compile-tsc-watch", + "presentation": { + "group": "watch", + "reveal": "never" } }, { diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 72cb826fcb7..6c1b61cc781 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,7 +43,7 @@ python -m pip install black ### Incremental Build -Run the `Compile` build Tasks from the [Run Build Task...](https://code.visualstudio.com/docs/editor/tasks) command picker (short cut `CTRL+SHIFT+B` or `⇧⌘B`). This will leave build tasks running in the background and which will re-run as files are edited and saved. You can see the output from either task in the Terminal panel (use the selector to choose which output to look at). +Run the `watch` build Tasks from the [Run Build Task...](https://code.visualstudio.com/docs/editor/tasks) command picker (short cut `CTRL+SHIFT+B` or `⇧⌘B`). This will leave build tasks running in the background and which will re-run as files are edited and saved. You can see the output from either task in the Terminal panel (use the selector to choose which output to look at). You can also compile from the command-line. For a full compile you can use: @@ -51,10 +51,12 @@ You can also compile from the command-line. For a full compile you can use: npx gulp prePublishNonBundle ``` -For incremental builds you can use the following commands depending on your needs: +For incremental builds it is recommended you use the `watch` build task (for better integration with VS Code). +Optionally you can use the following commands depending on your needs: ```shell -# This will compile everthing, but only watch for changes to the desktop bundle. +# This will compile everything, but only watch for changes to the desktop bundle. +# Note: Its advisable to use the `watch` task instead of this one (for integration with VS Code, e.g. view errors in problems window). npm run compile # This watches changes to all files, webviews, web version of extension, node version of extension, etc # This can be resource intensive, as there are a number of bundles created, thus requiring monitoring of files for each of these numerous bundles. @@ -230,7 +232,7 @@ Here's an example of a typical workflow: 1. `npm ci` 1. `npm run clean` 1. Start VS code Insiders root -1. CTRL+SHIFT+B and build `Compile Web Views` and `Compile` +1. CTRL+SHIFT+B (run the task `compile`) 1. Make code changes 1. Write and [run](https://github.com/microsoft/vscode-jupyter/blob/29c4be79f64df1858692321b43c3079bb77bdd69/.vscode/launch.json#L252) unit tests if appropriate 1. Test with [`Extension`](https://github.com/microsoft/vscode-jupyter/blob/29c4be79f64df1858692321b43c3079bb77bdd69/.vscode/launch.json#L6) launch task diff --git a/package.json b/package.json index f9434caef01..87c84630c3d 100644 --- a/package.json +++ b/package.json @@ -2078,17 +2078,17 @@ "prePublishBundle": "concurrently npm:compile-release npm:updatePackageJsonForBundle", "preprePublishNonBundle": "gulp clean", "updatePackageJsonForBundle": "gulp updatePackageJsonForBundle", - "prePublishNonBundle": "npm run compile-no-watch", + "prePublishNonBundle": "concurrently npm:compile-out npm:esbuild-all", "compile": "concurrently \"tsc -watch -p ./\" \"npx tsx build/esbuild/build.ts --watch\"", + "compile-esbuild-watch": "npx tsx build/esbuild/build.ts --watch", + "compile-tsc-watch": "tsc -p . -watch", "compile-watch-all": "concurrently \"tsc -watch -p ./\" \"npx tsx build/esbuild/build.ts --watch-all\"", - "compile-no-watch": "concurrently npm:compile-out npm:esbuild-all", "compile-out": "tsc -p ./", "compile-web-test": "webpack --mode development --config ./build/webpack/webpack.extension.web.config.js", "compile-web-test-watch": "webpack --mode development --config ./build/webpack/webpack.extension.web.config.js --stats-error-details --watch --progress", - "esbuild-all": "npx tsx build/esbuild/build.ts", "compile-release": "concurrently npm:compile-out npm:esbuild-release", + "esbuild-all": "npx tsx build/esbuild/build.ts", "esbuild-release": "npx tsx build/esbuild/build.ts --production", - "esbuild-watch": "npx tsx build/esbuild/build.ts --watch", "checkDependencies": "gulp checkDependencies", "postinstall": "npm run download-api && node ./build/ci/postInstall.js", "test:unittests": "mocha --config ./build/.mocha.unittests.js.json ./out/**/*.unit.test.js", diff --git a/src/test/datascience/widgets/standardWidgets.vscode.common.test.ts b/src/test/datascience/widgets/standardWidgets.vscode.common.test.ts index 346f5f0686d..6b727f71030 100644 --- a/src/test/datascience/widgets/standardWidgets.vscode.common.test.ts +++ b/src/test/datascience/widgets/standardWidgets.vscode.common.test.ts @@ -329,7 +329,8 @@ suite('Standard IPyWidget Tests @widgets', function () { // Run the 3rd cell to add a nested output. // Also display the same nested output and the widget in the 3rd cell. await Promise.all([runCell(cell3), waitForCellExecutionToComplete(cell3)]); - await assertOutputContainsHtml(cell1, comms, ['