You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+94-40Lines changed: 94 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,6 @@
1
-
# Contributing to the Jupyter extension for Visual Studio Code
1
+
# Contributing to the Deepnote extension for Visual Studio Code
2
+
3
+
Thank you for your interest in contributing to the Deepnote VS Code extension! This guide will help you set up your development environment and understand the contribution workflow.
[For contributing to the [Microsoft Python Language Server](https://github.com/Microsoft/python-language-server) see its own repo; for [Pylance](https://github.com/microsoft/pylance-release) see its own repo; for [debugpy](https://github.com/microsoft/debugpy) see its own repo]
After completing these steps, you can install dependencies normally with `npm install`. The project's `.npmrc` file is already configured to use GitHub Packages for the `@deepnote` scope.
63
-
64
44
On Apple Silicon, you will have to use system versions of `libsodium` and `libzmq` instead of the bundled ones:
65
45
66
46
```shell
@@ -92,7 +72,7 @@ python -m pip install black
92
72
93
73
```
94
74
95
-
### Incremental Build
75
+
### Incremental build
96
76
97
77
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).
98
78
@@ -118,7 +98,85 @@ npm run watch-all
118
98
Sometimes you will need to run `npm run clean` and even `rm -r out dist`.
119
99
This is especially true if you have added or removed files.
120
100
121
-
### Errors and Warnings
101
+
### Running the extension
102
+
103
+
After completing the setup steps, you can run the Deepnote extension in development mode:
104
+
105
+
#### Quick start
106
+
107
+
1.**Open the project in VS Code**
108
+
109
+
```bash
110
+
code .
111
+
```
112
+
113
+
2.**Start the watch task** (for automatic recompilation)
114
+
- Press `Ctrl+Shift+B` (Windows/Linux) or `⇧⌘B` (macOS)
115
+
- Select `watch` from the task list
116
+
- This will continuously compile your changes in the background
117
+
118
+
3.**Launch the Extension Development Host**
119
+
- Press `F5` or click the Run and Debug icon in the sidebar
120
+
- Select `Extension` from the dropdown menu
121
+
- Click the green play button
122
+
- A new VS Code window will open with `[Extension Development Host]` in the title
123
+
124
+
4.**Test your changes**
125
+
- The Extension Development Host has the Deepnote extension loaded
126
+
- Open a Deepnote project or notebook file (`.deepnote`)
127
+
- Test the functionality you're working on
128
+
- Check the Debug Console in your main VS Code window for logs
129
+
130
+
5.**Reload after making changes**
131
+
- The watch task automatically recompiles when you save files
132
+
- In the Extension Development Host window, press `Ctrl+R` (Windows/Linux) or `Cmd+R` (macOS) to reload
133
+
- Or restart the debug session with `Ctrl+Shift+F5` / `Cmd+Shift+F5`
134
+
135
+
#### Available debug configurations
136
+
137
+
The project includes several launch configurations in `.vscode/launch.json`:
138
+
139
+
-**Extension** - Run the extension in a new VS Code window (most common for development)
140
+
-**Extension (web)** - Test the web version of the extension
141
+
-**Extension inside container** - Test in a containerized environment
142
+
-**Unit Tests** - Run unit tests without VS Code
143
+
-**Tests (Jupyter+Python Extension installed)** - Run integration tests
144
+
145
+
#### Debugging tips
146
+
147
+
<details>
148
+
<summary>Click to expand debugging tips</summary>
149
+
150
+
**Enable detailed logging:**
151
+
152
+
Edit `.vscode/launch.json` and add environment variables:
153
+
154
+
```json
155
+
"env": {
156
+
"VSC_JUPYTER_FORCE_LOGGING": "1",
157
+
"VSC_JUPYTER_LOG_TELEMETRY": "1",
158
+
"VSC_JUPYTER_LOG_IPYWIDGETS": "1"
159
+
}
160
+
```
161
+
162
+
**Set breakpoints:**
163
+
- Click in the gutter next to line numbers in your TypeScript code
164
+
- Breakpoints will pause execution in the Extension Development Host
165
+
- Inspect variables in the Debug sidebar
166
+
167
+
**View logs:**
168
+
- Debug Console: Shows console.log output and errors
169
+
- Output panel: Select "Deepnote" from the dropdown to see extension-specific logs
170
+
- Terminal: Shows build output from the watch task
171
+
172
+
**Common issues:**
173
+
- If changes don't appear, try `npm run clean` and restart the watch task
174
+
- If breakpoints don't work, ensure source maps are enabled (they are by default)
175
+
- If the extension doesn't load, check the Debug Console for errors
176
+
177
+
</details>
178
+
179
+
### Errors and warnings
122
180
123
181
TypeScript errors and warnings will be displayed in the `Problems` window of Visual Studio Code.
124
182
@@ -129,7 +187,7 @@ Then, open the debug panel by clicking the `Run and Debug` icon on the sidebar,
129
187
option from the top menu, and click start. A new window will launch with the title
130
188
`[Extension Development Host]`.
131
189
132
-
### Running Unit Tests
190
+
### Running unit tests
133
191
134
192
Note: Unit tests are those in files with extension `.unit.test.ts`.
135
193
@@ -157,7 +215,7 @@ Alter the `launch.json` file in the `"Debug Unit Tests"` section by setting the
157
215
158
216
...this will only run the suite with the tests you care about during a test run (be sure to set the debugger to run the `Debug Unit Tests` launcher).
159
217
160
-
### Running Integration Tests (with VS Code)
218
+
### Running integration tests (with VS Code)
161
219
162
220
Note: Integration tests are those in files with extension `*.vscode.test*.ts`.
163
221
@@ -172,7 +230,7 @@ You can also run the tests from the command-line (after compiling):
172
230
npm run testVSCode # will launch the VSC UI
173
231
```
174
232
175
-
#### Customising the Test Run
233
+
#### Customising the test run
176
234
177
235
If you want to change which tests are run or which version of Python is used,
178
236
you can do this by setting environment variables. The same variables work when
@@ -235,7 +293,7 @@ setting a single variable for a subprocess:
235
293
VSC_JUPYTER_CI_TEST_GREP=Sorting npm run testVSCode
236
294
```
237
295
238
-
### Testing Python Scripts
296
+
### Testing Python scripts
239
297
240
298
The extension has a number of scripts in ./pythonFiles. Tests for these
241
299
scripts are found in ./pythonFiles/tests. To run those tests:
@@ -251,13 +309,13 @@ To run only the functional tests:
251
309
252
310
`python3 -m pythonFiles.tests --functional`
253
311
254
-
### Standard Debugging
312
+
### Standard debugging
255
313
256
314
Clone the repo into any directory, open that directory in VSCode, and use the `Extension` launch option within VSCode.
257
315
258
-
### Coding Standards
316
+
### Coding standards
259
317
260
-
Messages displayed to the user must be localized using/created constants from/in the [localize.ts](https://github.com/Microsoft/vscode-jupyter/blob/main/src/platform/common/utils/localize.ts) file.
318
+
Messages displayed to the user must be localized using/created constants from/in the [localize.ts](https://github.com/Microsoft/vscode-deepnote/blob/main/src/platform/common/utils/localize.ts) file.
261
319
262
320
## Development process
263
321
@@ -268,10 +326,6 @@ smoothly, but it allows you to help out by noticing when a step is
268
326
missed or to learn in case someday you become a project maintainer as
269
327
well!
270
328
271
-
### Folder Structure
272
-
273
-
At a high level we have a bunch of folders. Each high level is described in this wiki [page](https://github.com/deepnote/vscode-deepnote/wiki/Source-Code-Organization)
274
-
275
329
### Typical workflow
276
330
277
331
Here's an example of a typical workflow:
@@ -287,12 +341,12 @@ Here's an example of a typical workflow:
287
341
1. Test with [`Extension`](https://github.com/deepnote/vscode-deepnote/blob/29c4be79f64df1858692321b43c3079bb77bdd69/.vscode/launch.json#L6) launch task
288
342
1. Repeat until works in normal extension
289
343
1. Test with [`Extension (web)`](https://github.com/deepnote/vscode-deepnote/blob/29c4be79f64df1858692321b43c3079bb77bdd69/.vscode/launch.json#L34) launch task
290
-
1. Run [jupyter notebook server](https://github.com/deepnote/vscode-deepnote/wiki/Connecting-to-a-remote-Jupyter-server-from-vscode.dev) to use in web testing
344
+
1. Run [jupyter notebook server](https://github.com/microsoft/vscode-jupyter/wiki/Connecting-to-a-remote-Jupyter-server-from-vscode.dev-or-github.dev) to use in web testing
291
345
1. Repeat until works in web extension
292
346
1. Write integration tests and [run](https://github.com/deepnote/vscode-deepnote/blob/29c4be79f64df1858692321b43c3079bb77bdd69/.vscode/launch.json#L216) locally.
293
347
1. Submit PR
294
348
1. Check PR output to make sure tests don't fail.
295
-
1. Debug [CI test failures](https://github.com/deepnote/vscode-deepnote/wiki/Tests)
349
+
1. Debug [CI test failures](https://github.com/microsoft/vscode-jupyter/wiki/tests)
296
350
297
351
### Helping others
298
352
@@ -348,7 +402,7 @@ Overall steps for releasing are covered in the
348
402
349
403
To create a release _build_, follow the steps outlined in the [release plan](https://github.com/Microsoft/vscode-jupyter/labels/release%20plan) (which has a [template](https://github.com/Microsoft/vscode-jupyter/blob/main/.github/release_plan.md)).
350
404
351
-
## Local Build
405
+
## Local build
352
406
353
407
Steps to build the extension on your machine once you've cloned the repo:
0 commit comments