Proposed Extension APIs
Relevant source files
The following files were used as context for generating this wiki page:
- extensions/vscode-api-tests/package.json
- extensions/github/package.json
- extensions/github-authentication/package.json
- extensions/tunnel-forwarding/package.json
- extensions/simple-browser/package.json
- extensions/npm/package.json
- extensions/json-language-features/package.json
- extensions/search-result/package.json
Proposed Extension APIs are a set of experimental, unstable APIs that VS Code extensions can opt into. This mechanism allows extension authors to test and provide feedback on new, upcoming features before they are finalized and included in the stable extension API. Using these APIs requires an explicit declaration in the extension's package.json manifest.
Because these APIs are not considered stable, they are subject to change or removal in future versions of VS Code. Extensions that use them are typically for testing purposes or are developed in close coordination with the VS Code team. The vscode-api-tests extension serves as a primary example, enabling a wide range of proposed APIs for testing purposes.
Enabling Proposed APIs
To use a proposed API, an extension developer must add the enabledApiProposals property to their package.json file. This property holds an array of strings, where each string is the name of the proposed API to be enabled for that extension.
The following diagram illustrates the workflow for an extension to enable and use a proposed API.
This diagram shows the process from a developer modifying the manifest to the VS Code runtime enabling the feature.
Sources: extensions/vscode-api-tests/package.json:6-43, extensions/github/package.json:28-37
For example, the simple-browser extension enables the externalUriOpener API with the following configuration:
{
"name": "simple-browser",
"enabledApiProposals": [
"externalUriOpener"
],
"activationEvents": [
"onOpenExternalUri:http",
"onOpenExternalUri:https"
]
}
Sources: extensions/simple-browser/package.json:4-6, extensions/simple-browser/package.json:23-27
Catalog of Proposed APIs
The VS Code repository contains numerous extensions that opt into various proposed APIs. The vscode-api-tests extension is particularly notable for enabling a large and diverse set of these APIs for testing. The following table provides a categorized sample of proposed APIs found across different extensions.
| Category | API Proposal Name | Description (Inferred from name and usage) | Consuming Extensions |
|---|---|---|---|
| Chat / AI | chatProvider, defaultChatParticipant, embeddings | APIs for integrating with VS Code's chat and AI features. | vscode-api-tests |
| SCM / Git | scmActionButton, scmHistoryProvider, timeline | APIs for enhancing Source Control Management integration. | vscode-api-tests, github |
| Terminal | terminalDataWriteEvent, terminalDimensions, terminalQuickFixProvider | APIs for deeper interaction with the integrated terminal. | vscode-api-tests, npm |
| Notebooks | notebookMessaging, notebookMime, notebookDeprecated | APIs for creating and managing notebook content and renderers. | vscode-api-tests |
| Authentication | authSession, authIssuers, authProviderSpecific | APIs for providing authentication services and managing sessions. | vscode-api-tests, github-authentication |
| Tunnels | tunnels, tunnelFactory, resolvers | APIs for managing remote tunnels and port forwarding. | vscode-api-tests, tunnel-forwarding |
| Filesystem | fileSearchProvider, textSearchProvider, fsChunks | APIs for providing custom search and file system capabilities. | vscode-api-tests |
| UI / Window | editorInsets, treeViewReveal, contribStatusBarItems | APIs for customizing the editor and general workbench UI. | vscode-api-tests |
Sources: extensions/vscode-api-tests/package.json:6-43, extensions/github/package.json:28-37, extensions/github-authentication/package.json:19-22, extensions/tunnel-forwarding/package.json:15-18, extensions/npm/package.json:16-18
Extension Implementations
Different first-party extensions leverage proposed APIs to deliver integrated features. The diagram below shows how several extensions consume specific categories of proposed APIs from the VS Code core.
This diagram illustrates the consumer relationship between extensions and the proposed APIs they enable.
Sources: extensions/github-authentication/package.json:19-22, extensions/github/package.json:28-37, extensions/tunnel-forwarding/package.json:15-18, extensions/npm/package.json:16-18
vscode-api-tests
This extension is a comprehensive testbed for new APIs. It enables a vast number of proposals to ensure their stability and functionality.
"enabledApiProposals": [
"activeComment",
"authSession",
"chatParticipantPrivate",
"chatProvider",
"contribStatusBarItems",
"contribViewsRemote",
"customEditorMove",
"defaultChatParticipant",
"diffCommand",
"documentFiltersExclusive",
"editorInsets",
"embeddings",
"extensionRuntime",
"extensionsAny",
"externalUriOpener",
"fileSearchProvider",
"findFiles2",
"findTextInFiles",
"fsChunks",
"interactive",
"languageStatusText",
"nativeWindowHandle",
"notebookDeprecated",
"notebookLiveShare",
"notebookMessaging",
"notebookMime",
"portsAttributes",
"quickPickSortByLabel",
"resolvers",
"scmActionButton",
"scmSelectedProvider",
"scmTextDocument",
"scmValidation",
"taskPresentationGroup",
"telemetry",
"terminalDataWriteEvent",
"terminalDimensions",
"testObserver",
"textSearchProvider",
"timeline",
"tokenInformation",
"treeViewActiveItem",
"treeViewReveal",
"tunnels",
"workspaceTrust"
]
Sources: extensions/vscode-api-tests/package.json:6-43
github and github-authentication
The github-authentication extension focuses purely on authentication, enabling proposals like authIssuers and authProviderSpecific. This allows it to contribute GitHub and GitHub Enterprise authentication providers to VS Code.
"enabledApiProposals": [
"authIssuers",
"authProviderSpecific"
]
Sources: extensions/github-authentication/package.json:19-22
The main github extension, in contrast, uses a different set of proposals for features like viewing timelines, sharing links, and integrating with the SCM history view.
"enabledApiProposals": [
"canonicalUriProvider",
"contribEditSessions",
"contribShareMenu",
"contribSourceControlHistoryItemMenu",
"scmHistoryProvider",
"shareProvider",
"timeline"
]
Sources: extensions/github/package.json:28-37
tunnel-forwarding
This extension provides tunneling capabilities and enables the resolvers and tunnelFactory APIs to integrate with VS Code's remote infrastructure. Its activation is triggered onTunnel.
"enabledApiProposals": [
"resolvers",
"tunnelFactory"
],
"activationEvents": [
"onTunnel"
]
Sources: extensions/tunnel-forwarding/package.json:15-21
npm
The npm extension enhances the terminal experience by enabling terminalQuickFixProvider. This allows it to offer quick fixes for failed npm commands directly in the terminal, as defined in its terminalQuickFixes contribution.
"enabledApiProposals": [
"terminalQuickFixProvider"
],
"contributes": {
"terminalQuickFixes": [
{
"id": "ms-vscode.npm-command",
"commandLineMatcher": "npm",
"commandExitResult": "error",
"outputMatcher": {
"anchor": "bottom",
"length": 8,
"lineMatcher": "Did you mean (?:this|one of these)\\?((?:\\n.+?npm .+ #.+)+)",
"offset": 2
}
}
]
}
Sources: extensions/npm/package.json:16-18, extensions/npm/package.json:216-228
Other Examples
json-language-features: EnablesextensionsAnyto likely interact with a broader set of extensions or configurations.search-result: EnablesdocumentFiltersExclusive, suggesting a more advanced way to specify which documents its features apply to.
Sources: extensions/json-language-features/package.json:11-13, extensions/search-result/package.json:24-26
Conclusion
The Proposed Extension API system is a fundamental aspect of VS Code's iterative development process. By allowing extensions to opt into experimental features via the enabledApiProposals manifest property, the VS Code team can gather valuable feedback and real-world usage data. This collaborative approach ensures that new APIs are robust, well-designed, and meet the needs of the developer community before they become part of the stable API surface.