Skip to content

Commit 0123f70

Browse files
authored
Merge branch 'main' into lukas/grn-5040-fix-view-container-x-does-not-exist-errors-on-startup
2 parents 5affbbc + 7cde864 commit 0123f70

30 files changed

+4894
-580
lines changed

CONTRIBUTING.md

Lines changed: 94 additions & 40 deletions
Original file line numberDiff line numberDiff 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.
24

35
---
46

@@ -7,8 +9,6 @@
79

810
## | ![Main Build](https://github.com/deepnote/vscode-deepnote/actions/workflows/ci.yml/badge.svg?branch=main)
911

10-
[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]
11-
1212
## Contributing a pull request
1313

1414
### Prerequisites
@@ -29,10 +29,9 @@
2929
```shell
3030
git clone https://github.com/deepnote/vscode-deepnote
3131
cd vscode-deepnote
32-
3332
```
3433

35-
#### Install Recommended Extensions
34+
#### Install recommended extensions
3635

3736
First, install all the recommended VS Code extensions. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and run:
3837

@@ -42,25 +41,6 @@ Extensions: Show Recommended Extensions
4241

4342
Then install all the extensions listed under "Workspace Recommendations".
4443

45-
#### Configure Access to @deepnote/blocks Package
46-
47-
The `@deepnote/blocks` package is published on GitHub Packages. To install it, you'll need to authenticate with GitHub:
48-
49-
1. Create a GitHub Personal Access Token (classic) with `read:packages` scope:
50-
51-
- Go to https://github.com/settings/tokens
52-
- Click "Generate new token (classic)"
53-
- Select the `read:packages` scope
54-
- Generate and copy the token
55-
56-
2. Add the token to your global `.npmrc` file:
57-
```shell
58-
echo "//npm.pkg.github.com/:_authToken=YOUR_TOKEN_HERE" >> ~/.npmrc
59-
```
60-
Replace `YOUR_TOKEN_HERE` with your actual token.
61-
62-
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-
6444
On Apple Silicon, you will have to use system versions of `libsodium` and `libzmq` instead of the bundled ones:
6545

6646
```shell
@@ -92,7 +72,7 @@ python -m pip install black
9272

9373
```
9474

95-
### Incremental Build
75+
### Incremental build
9676

9777
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).
9878

@@ -118,7 +98,85 @@ npm run watch-all
11898
Sometimes you will need to run `npm run clean` and even `rm -r out dist`.
11999
This is especially true if you have added or removed files.
120100

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
122180

123181
TypeScript errors and warnings will be displayed in the `Problems` window of Visual Studio Code.
124182

@@ -129,7 +187,7 @@ Then, open the debug panel by clicking the `Run and Debug` icon on the sidebar,
129187
option from the top menu, and click start. A new window will launch with the title
130188
`[Extension Development Host]`.
131189

132-
### Running Unit Tests
190+
### Running unit tests
133191

134192
Note: Unit tests are those in files with extension `.unit.test.ts`.
135193

@@ -157,7 +215,7 @@ Alter the `launch.json` file in the `"Debug Unit Tests"` section by setting the
157215

158216
...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).
159217

160-
### Running Integration Tests (with VS Code)
218+
### Running integration tests (with VS Code)
161219

162220
Note: Integration tests are those in files with extension `*.vscode.test*.ts`.
163221

@@ -172,7 +230,7 @@ You can also run the tests from the command-line (after compiling):
172230
npm run testVSCode # will launch the VSC UI
173231
```
174232

175-
#### Customising the Test Run
233+
#### Customising the test run
176234

177235
If you want to change which tests are run or which version of Python is used,
178236
you can do this by setting environment variables. The same variables work when
@@ -235,7 +293,7 @@ setting a single variable for a subprocess:
235293
VSC_JUPYTER_CI_TEST_GREP=Sorting npm run testVSCode
236294
```
237295

238-
### Testing Python Scripts
296+
### Testing Python scripts
239297

240298
The extension has a number of scripts in ./pythonFiles. Tests for these
241299
scripts are found in ./pythonFiles/tests. To run those tests:
@@ -251,13 +309,13 @@ To run only the functional tests:
251309

252310
`python3 -m pythonFiles.tests --functional`
253311

254-
### Standard Debugging
312+
### Standard debugging
255313

256314
Clone the repo into any directory, open that directory in VSCode, and use the `Extension` launch option within VSCode.
257315

258-
### Coding Standards
316+
### Coding standards
259317

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.
261319

262320
## Development process
263321

@@ -268,10 +326,6 @@ smoothly, but it allows you to help out by noticing when a step is
268326
missed or to learn in case someday you become a project maintainer as
269327
well!
270328

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-
275329
### Typical workflow
276330

277331
Here's an example of a typical workflow:
@@ -287,12 +341,12 @@ Here's an example of a typical workflow:
287341
1. Test with [`Extension`](https://github.com/deepnote/vscode-deepnote/blob/29c4be79f64df1858692321b43c3079bb77bdd69/.vscode/launch.json#L6) launch task
288342
1. Repeat until works in normal extension
289343
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
291345
1. Repeat until works in web extension
292346
1. Write integration tests and [run](https://github.com/deepnote/vscode-deepnote/blob/29c4be79f64df1858692321b43c3079bb77bdd69/.vscode/launch.json#L216) locally.
293347
1. Submit PR
294348
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)
296350

297351
### Helping others
298352

@@ -348,7 +402,7 @@ Overall steps for releasing are covered in the
348402

349403
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)).
350404

351-
## Local Build
405+
## Local build
352406

353407
Steps to build the extension on your machine once you've cloned the repo:
354408

build/esbuild/build.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ async function buildAll() {
379379
path.join(extensionFolder, 'src', 'webviews', 'webview-side', 'integrations', 'index.tsx'),
380380
path.join(extensionFolder, 'dist', 'webviews', 'webview-side', 'integrations', 'index.js'),
381381
{ target: 'web', watch: watchAll }
382+
),
383+
build(
384+
path.join(extensionFolder, 'src', 'webviews', 'webview-side', 'selectInputSettings', 'index.tsx'),
385+
path.join(extensionFolder, 'dist', 'webviews', 'webview-side', 'selectInputSettings', 'index.js'),
386+
{ target: 'web', watch: watchAll }
382387
)
383388
);
384389

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,11 @@
857857
}
858858
],
859859
"notebook/toolbar": [
860+
{
861+
"command": "deepnote.openInDeepnote",
862+
"group": "navigation@-1",
863+
"when": "notebookType == 'deepnote'"
864+
},
860865
{
861866
"command": "deepnote.manageIntegrations",
862867
"group": "navigation@0",
@@ -1439,7 +1444,7 @@
14391444
"view/item/context": [
14401445
{
14411446
"command": "deepnote.revealInExplorer",
1442-
"when": "view == deepnoteExplorer",
1447+
"when": "view == deepnoteExplorer && viewItem != loading",
14431448
"group": "inline@2"
14441449
}
14451450
]
@@ -2099,7 +2104,8 @@
20992104
"viewsWelcome": [
21002105
{
21012106
"view": "deepnoteExplorer",
2102-
"contents": "Welcome to Deepnote for VS Code!\nExplore your data with SQL and Python. Build interactive notebooks, collaborate with your team, and share your insights.\n\n\n\n[$(new-file) New Project](command:deepnote.newProject)\n[$(folder-opened) Import Notebook](command:deepnote.importNotebook)"
2107+
"contents": "Welcome to Deepnote for VS Code!\nExplore your data with SQL and Python. Build interactive notebooks, collaborate with your team, and share your insights.\n\n\n\n[$(new-file) New Project](command:deepnote.newProject)\n[$(folder-opened) Import Notebook](command:deepnote.importNotebook)",
2108+
"when": "deepnote.explorerInitialScanComplete"
21032109
}
21042110
],
21052111
"debuggers": [

src/messageTypes.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,24 @@ export type LocalizedMessages = {
235235
integrationsRequiredField: string;
236236
integrationsOptionalField: string;
237237
integrationsUnnamedIntegration: string;
238+
// Select input settings strings
239+
selectInputSettingsTitle: string;
240+
allowMultipleValues: string;
241+
allowEmptyValue: string;
242+
valueSourceTitle: string;
243+
fromOptions: string;
244+
fromOptionsDescription: string;
245+
addOptionPlaceholder: string;
246+
addButton: string;
247+
fromVariable: string;
248+
fromVariableDescription: string;
249+
variablePlaceholder: string;
250+
optionNameLabel: string;
251+
variableNameLabel: string;
252+
removeOptionAriaLabel: string;
253+
saveButton: string;
254+
cancelButton: string;
255+
failedToSave: string;
238256
};
239257
// Map all messages to specific payloads
240258
export class IInteractiveWindowMapping {

0 commit comments

Comments
 (0)