Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add how to use isPositron context #27

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ website:
- connections-pane.qmd
- run-interactive-apps.qmd
- updating.qmd
- extension-development.qmd

- title: "Help"
style: "docked"
Expand Down
26 changes: 26 additions & 0 deletions extension-development.qmd
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 2 additions & 0 deletions extensions.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading