diff --git a/_quarto.yml b/_quarto.yml index 06f5df7..94d442b 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -64,6 +64,7 @@ website: - connections-pane.qmd - run-interactive-apps.qmd - updating.qmd + - extension-development.qmd - title: "Help" style: "docked" diff --git a/extension-development.qmd b/extension-development.qmd new file mode 100644 index 0000000..aaf4a9d --- /dev/null +++ b/extension-development.qmd @@ -0,0 +1,26 @@ +--- +title: "Extension Development" +--- + +Positron is compatible with VS Code extensions so you can create extensions [as you would for VS Code](https://code.visualstudio.com/api/get-started/your-first-extension). You can use Positron to develop your extension and run it in a new **Extension Development Host** window. + +## Context keys + +When defining your extension's manifest, you can use `isPositron` for enablement or in a `when` clause. + +```json +"commands": [ + { + "category": "My Extension", + "command": "myExtension.myCommand", + "title": "My Extension Command", + "enablement": "isPositron" + } +] +``` + +This allows your extension to enable commands, keybindings, menu items, and any other contribution points only for Positron. + +## Positron API + +Positron provides [all the normal contribution points and the VS Code API](https://code.visualstudio.com/api/extension-capabilities/overview) to extensions, but also additionally new APIs to use. We plan to make the extension development experience better (for example, [safely wrapping](https://github.com/posit-dev/positron/issues/458) and [providing typing for](https://github.com/posit-dev/positron/issues/809) the Positron API), but in the meantime, we recommend you [take a look at the Positron API details directly](https://github.com/posit-dev/positron/tree/main/src/positron-dts). diff --git a/extensions.qmd b/extensions.qmd index c5c2e74..fdb3d6e 100644 --- a/extensions.qmd +++ b/extensions.qmd @@ -35,3 +35,5 @@ if (interactive() && Sys.getenv("RSTUDIO") == "" && Sys.getenv("POSITRON") == "" - [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python): Positron bundles a fork of this extension that's built to work with Positron and offers support for the console, help, and other features. If there is anything from the original Python extension that doesn't work for you, please let us know. There may be extensions that aren't available for Positron for licensing rather than technical reasons. These extensions would typically contain proprietary Microsoft code and are only licensed for use with Microsoft's proprietary VS Code product. + +See [Extension Development](extension-development.qmd) for creating extensions for Positron.