Skip to content

Commit 3aed3f8

Browse files
committed
Add keybindings
1 parent 917b68b commit 3aed3f8

File tree

2 files changed

+43
-25
lines changed

2 files changed

+43
-25
lines changed

package.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
"commands": [
2222
{
2323
"command": "vscode-jupyter-python.run-inferred-block",
24-
"title": "Run inferred code block"
24+
"title": "Jupyter Python: Run inferred code block"
2525
},
2626
{
2727
"command": "vscode-jupyter-python.run-inferred-block-and-move-down",
28-
"title": "Run inferred code block and move down"
28+
"title": "Jupyter Python: Run inferred code block and move down"
2929
}
3030
],
3131
"configuration": {
@@ -54,7 +54,20 @@
5454
"description": "If the above setting is enabled, this list will be passed to a regex. Any of these items in the list need to occur on the same intentation level as the first line. You may define your own custom elements to modify the code to your preferred behaviour. In the default setting, else, elif, except, finally, as well as all closing braces are expanded on."
5555
}
5656
}
57-
}
57+
},
58+
"keybindings": [
59+
{
60+
"command": "vscode-jupyter-python.run-inferred-block",
61+
"key": "ctrl+enter",
62+
"mac": "cmd+enter",
63+
"when": "editorTextFocus && editorLangId == python && !findInputFocussed && !replaceInputFocussed && jupyter.ownsSelection && !notebookEditorFocused"
64+
},
65+
{
66+
"command": "vscode-jupyter-python.run-inferred-block-and-move-down",
67+
"key": "shift+enter",
68+
"when": "editorTextFocus && editorLangId == python && !findInputFocussed && !replaceInputFocussed && jupyter.ownsSelection && !notebookEditorFocused"
69+
}
70+
]
5871
},
5972
"extensionDependencies": [
6073
"ms-toolsai.jupyter"

vsc-extension-quickstart.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
11
# Welcome to your first VS Code Extension
22

33
## What's in the folder
4-
* This folder contains all of the files necessary for your extension
5-
* `package.json` - this is the manifest file in which you declare your extension and command.
6-
The sample plugin registers a command and defines its title and command name. With this information
7-
VS Code can show the command in the command palette. It doesn’t yet need to load the plugin.
8-
* `src/extension.ts` - this is the main file where you will provide the implementation of your command.
9-
The file exports one function, `activate`, which is called the very first time your extension is
10-
activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.
11-
We pass the function containing the implementation of the command as the second parameter to
12-
`registerCommand`.
4+
5+
- This folder contains all of the files necessary for your extension
6+
- `package.json` - this is the manifest file in which you declare your extension and command.
7+
The sample plugin registers a command and defines its title and command name. With this information
8+
VS Code can show the command in the command palette. It doesn’t yet need to load the plugin.
9+
- `src/extension.ts` - this is the main file where you will provide the implementation of your command.
10+
The file exports one function, `activate`, which is called the very first time your extension is
11+
activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.
12+
We pass the function containing the implementation of the command as the second parameter to
13+
`registerCommand`.
1314

1415
## Get up and running straight away
15-
* press `F5` to open a new window with your extension loaded
16-
* run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`
17-
* set breakpoints in your code inside `src/extension.ts` to debug your extension
18-
* find output from your extension in the debug console
16+
17+
- press `F5` to open a new window with your extension loaded
18+
- run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`
19+
- set breakpoints in your code inside `src/extension.ts` to debug your extension
20+
- find output from your extension in the debug console
1921

2022
## Make changes
21-
* you can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`
22-
* you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes
23+
24+
- you can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`
25+
- you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes
2326

2427
## Explore the API
25-
* you can open the full set of our API when you open the file `node_modules/vscode/vscode.d.ts`
28+
29+
- you can open the full set of our API when you open the file `node_modules/vscode/vscode.d.ts`
2630

2731
## Run tests
28-
* open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Launch Tests`
29-
* press `F5` to run the tests in a new window with your extension loaded
30-
* see the output of the test result in the debug console
31-
* make changes to `test/extension.test.ts` or create new test files inside the `test` folder
32-
* by convention, the test runner will only consider files matching the name pattern `**.test.ts`
33-
* you can create folders inside the `test` folder to structure your tests any way you want
32+
33+
- open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Launch Tests`
34+
- press `F5` to run the tests in a new window with your extension loaded
35+
- see the output of the test result in the debug console
36+
- make changes to `test/extension.test.ts` or create new test files inside the `test` folder
37+
- by convention, the test runner will only consider files matching the name pattern `**.test.ts`
38+
- you can create folders inside the `test` folder to structure your tests any way you want

0 commit comments

Comments
 (0)