-
Notifications
You must be signed in to change notification settings - Fork 293
Extensibility for other extensions
Rich Chiodo edited this page May 3, 2022
·
4 revisions
The ms-toolsai.jupyter extension has a number of extensibility points for external partners to interface with. The definition of these extensibility points can be found here:
Some of the sub parts of that API are described in more detail below.
This api is called by an external extension to register a remote Jupyter server URI provider. This provider has the capability to inject UI into this command here:
(in that example, the Azure Compute entry was added).
When implementing the IJupyterUriQuickPicker
, you have a number of responsibilities:
- Add a
jupyterRemoteServerProvider
to your package.jsoncontributes
section. Like so:
"contributes": {
"jupyterRemoteServerProvider": []
},
- Call
registerRemoteServerProvider
in your extension'sactivate
function. - Provide an entry point for the dialog above. You do this with the call to
getQuickPickEntryItems
. - Provide
handleQuickPick
. This function is called if the user picks one of your entries you provided ingetQuickPickEntryItems
. -
handleQuickPick
can put up more UI to ask the user to pick from a number of choices. Its end result should be a handle to a choice or 'back'. That handle is a string value that will be used later to identify the choices the user made in your UI. -
getServerUri
should be able to take a handle returned fromhandleNextSteps
and provide an authorization header and a URL for final connection to a Jupyter server. At this point you might ask for a user name/password.
An example of implementing IJupyterUriQuickPicker
can be found here:
The jupyter extension defines a number of context keys that can be used in when
clauses for keybindings. These include:
Context Key | When is it true |
---|---|
jupyter.isnativeactive | true if the currently active notebook is a jupyter notebook (as opposed to say a github issues notebook) |
jupyter.notebookeditor.canrestartNotebookkernel | true when the current kernel for a notebook is active |
jupyter.notebookeditor.canInterruptNotebookKernel | true when the current kernel for a notebook is not busy |
jupyter.interactive.canRestartNotebookKernel | true when the current kernel for an interactive window is active |
jupyter.interactive.canInterruptNotebookKernel | true when the current kernel for an interactive window is not busy |
jupyter.isinteractiveactive | true when an interactive window is the active editor |
jupyter.isinteractiveornativeactive | true when the active editor is a notebook or an interactive window |
jupyter.ispythonornativeactive | true when the active editor is a python file or a notebook |
jupyter.ispythonorinteractiveeactive | true when the active editor is a python file or an interactive window |
jupyter.ispythonorinteractiveornativeeactive | true when the active editor is a python file, a notebook, or an interactive window |
jupyter.havenativecells | true when a notebook has any cells |
jupyter.ispythonnotebook | true when the kernel for a notebook is python based |
jupyter.kernel.isjupyter | true when the kernel for a notebook comes from the jupyter extension |
jupyter.hasNativeNotebookOrInteractiveWindowOpen | true when a notebook or an interactive window is open |
jupyter.notebookeditor.debuggingInProgress | true when debugging a notebook cell |
jupyter.notebookeditor.runByLineInProgress | true when running by line is active in a notebook cell |
jupyter.dataViewerActive | true when the dataviewer panel is open |
jupyter.ownsSelection | true when the setting jupyter.sendSelectionToInteractiveWindow is true |
jupyter.hascodecells | true when cell markers are present in the active python editor |
jupyter.zmqavailable | true when ZMQ support is enabled on the user's machine (determines how kernels are started) |
jupyter.replayLogLoaded | used for debugging pylance LSP output |
jupyter.development | true if building extension from command line |
jupyter.webExtension | true if running in the web version of the extension |
jupyter.vscode.channel | set to vscode channel (insiders or stable) |
- Contribution
- Source Code Organization
- Coding Standards
- Profiling
- Coding Guidelines
- Component Governance
- Writing tests
- Kernels
- Intellisense
- Debugging
- IPyWidgets
- Extensibility
- Module Dependencies
- Errors thrown
- Jupyter API
- Variable fetching
- Import / Export
- React Webviews: Variable Viewer, Data Viewer, and Plot Viewer
- FAQ
- Kernel Crashes
- Jupyter issues in the Python Interactive Window or Notebook Editor
- Finding the code that is causing high CPU load in production
- How to install extensions from VSIX when using Remote VS Code
- How to connect to a jupyter server for running code in vscode.dev
- Jupyter Kernels and the Jupyter Extension