Development
API Reference
Overview of the Land extension API: commands, configuration, views, and webviews.
API Reference
Land implements the VS Code extension API with full type compatibility. Extensions written against @types/vscode compile and run without modification. This page provides an overview of the major API surfaces.
Commands
Register a command with vscode.commands.registerCommand:
const Disposable = vscode.commands.registerCommand(
"MyExtension.SayHello",
() => {
vscode.window.showInformationMessage("Hello from Land!");
},
);Commands declared in package.json under contributes.commands appear in the command palette automatically.
Configuration
Extensions read and write settings through the WorkspaceConfiguration API:
const Config = vscode.workspace.getConfiguration("MyExtension");
const FontSize = Config.get<number>("FontSize", 14);Configuration keys are declared in contributes.configuration in your extension manifest. Land validates configuration values against the JSON Schema you provide.
Keybindings
Declare keybindings in contributes.keybindings:
{
"command": "MyExtension.SayHello",
"key": "ctrl+shift+h",
"mac": "cmd+shift+h",
"when": "editorTextFocus"
}The when clause supports the same context keys as VS Code, including editorLangId, resourceScheme, and custom context keys set by your extension.
Tree Views
Register a tree view provider to add a custom panel in the sidebar:
vscode.window.registerTreeDataProvider(
"MyExtension.TreeView",
MyTreeDataProvider,
);Declare the view container and view in contributes.viewsContainers and contributes.views.
Webview Panels
Create rich HTML-based UI panels:
const Panel = vscode.window.createWebviewPanel(
"MyExtension.Preview",
"Preview",
vscode.ViewColumn.Beside,
{ enableScripts: true },
);
Panel.webview.html = "<html><body><h1>Preview</h1></body></html>";Webview panels run in a sandboxed iframe with a Content Security Policy. Use Panel.webview.postMessage() and Panel.webview.onDidReceiveMessage for bidirectional communication.
Language Server Protocol
Land supports LSP servers out of the box through the vscode-languageclient package. Point your extension at a language server binary and the LSP client handles initialization, capabilities negotiation, and shutdown automatically.
Rust API Documentation
Generated rustdoc output for the Rust crates:
- Mountain Crates — Mountain, Echo, Common, CommonLibrary, Air, AirLibrary, SideCar, Download
- Common Crate — Abstract traits, ActionEffect system, DTOs
- Echo Crate — Work-stealing scheduler
- Air Crate — Background daemon
- SideCar Crate — Node.js binary distribution
- Rest Crates — OXC-powered TypeScript compiler
- Maintain Crates — Build orchestrator
- Land Workspace — Top-level workspace
Crate Index
| Crate | Description | Element |
|---|---|---|
Mountain | Tauri native backend | Architecture |
Echo | Work-stealing task executor | Architecture |
Common | Abstract traits and DTOs | Architecture |
CommonLibrary | Shared utility functions | Architecture |
Air | Background daemon | Local-First Protocol |
AirLibrary | Air shared library | Local-First Protocol |
Download | Binary download logic | Local-First Protocol |
SideCar | Node.js binary management | Architecture |
Maintain | CI/CD scripts | Contributing |
grove | WASM extension host | Extension Development |
See Also
Further Reading
- VS Code API Documentation
- the upstream reference that Land implements.
