Use when the user asks about VS Code API definitions, methods, interfaces, events, types, or wants to understand what VS Code APIs are available...
This skill helps look up VS Code API definitions from official TypeScript declaration files and documentation.
The VS Code API type definitions come from the official repository:
Current version (matching project's @types/vscode):
https://raw.githubusercontent.com/microsoft/vscode/{version}/src/vscode-dts/vscode.d.ts
Latest (main branch):
https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.d.ts
The official documentation at https://code.visualstudio.com/api provides richer context including
screenshots, examples, and guides. Start with overview pages and navigate to subsections as needed:
| Section | Entry Point | Use For |
|---|---|---|
| UX Guidelines | /api/ux-guidelines/overview |
UI/UX best practices, visual patterns |
| Extension Capabilities | /api/extension-capabilities/overview |
Common capabilities, extending workbench |
| Extension Guides | /api/extension-guides/overview |
Implementation guides (tree views, webviews, commands, etc.) |
| Language Extensions | /api/language-extensions/overview |
LSP, syntax highlighting, language features |
| References | /api/references/vscode-api |
API docs, contribution points, activation events |
| Testing & Publishing | /api/working-with-extensions/testing-extension |
Testing strategies, bundling |
| Advanced Topics | /api/advanced-topics/extension-host |
Extension host, remote development |
Read the project's package.json to find the @types/vscode version:
grep -A1 '"@types/vscode"' package.json
The version will be something like "^1.96.0" - extract the base version number (e.g., 1.96.0).
Use vscode.d.ts when:
Use the documentation website when:
Use both when:
Use WebFetch to retrieve the vscode.d.ts file:
For the project's current version:
https://raw.githubusercontent.com/microsoft/vscode/{version}/src/vscode-dts/vscode.d.ts
For the latest main branch:
https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.d.ts
Start with top-level section pages and explore subsections as needed. This approach generally stays current as documentation evolves.
Top-level entry points:
https://code.visualstudio.com/api/ux-guidelines/overview
https://code.visualstudio.com/api/extension-capabilities/overview
https://code.visualstudio.com/api/extension-guides/overview
https://code.visualstudio.com/api/language-extensions/overview
https://code.visualstudio.com/api/references/vscode-api
https://code.visualstudio.com/api/working-with-extensions/testing-extension
https://code.visualstudio.com/api/advanced-topics/extension-host
Navigation strategy:
When the user asks about a specific API (e.g., TreeView, workspace.onDidChangeConfiguration):
When the user wants to check for API changes or new features:
When presenting API definitions from vscode.d.ts:
// From vscode.d.ts (version X.X.X)
/**
* [JSDoc description from the file]
*/
interface/class/function ApiName {
// ... relevant members
}
When presenting both type definitions and documentation context:
## API: [name]
### Type Definition
[TypeScript definition from vscode.d.ts]
### Documentation
[Summary from code.visualstudio.com/api]
### Key Points
- [Important usage notes]
- [Best practices from UX guidelines if applicable]
- [Related APIs or patterns]
If comparing versions, show both with a summary of changes:
## API: [name]
### Current (v1.96.0)
[definition]
### Latest (main)
[definition]
### Changes
- [list of differences]
TreeDataProvider, TextDocument, Uri, Position, Rangevscode.window, vscode.workspace, vscode.commandsonDid* patterns like onDidChangeConfigurationDisposableTreeItemCollapsibleState, DiagnosticSeverity@deprecated tags