larc-vscode
v2.0.0
Published
LARC framework support for Visual Studio Code
Downloads
95
Readme
LARC VS Code Extension
Official Visual Studio Code extension for the LARC framework.
Features
Code Snippets
- Component boilerplate - Type
larc-componentto create a full web component - PAN bus integration - Type
larc-pan-componentfor PAN-enabled components - PAN utilities - Quick snippets for
pan-subscribeandpan-publish - Import maps - Type
larc-importmapfor import map setup - HTML elements - Quick insertion of LARC components in HTML
Commands
- LARC: New Component - Interactive component generation
- LARC: Add Component from Registry - Browse and add components from the registry
- LARC: View Documentation - Open LARC documentation
IntelliSense
- Auto-completion for component names
- Component descriptions in hover tooltips
- Registry-powered suggestions
Installation
From VS Code Marketplace
- Open VS Code
- Press
Ctrl+Shift+X(orCmd+Shift+Xon Mac) - Search for "LARC"
- Click Install
From VSIX
code --install-extension larc-vscode-1.0.0.vsixUsage
Creating a Component
- Open Command Palette (
Ctrl+Shift+PorCmd+Shift+P) - Type "LARC: New Component"
- Enter component name (kebab-case)
- Component file is created and opened
Or use the snippet:
// Type 'larc-component' and press TabAdding from Registry
- Open Command Palette
- Type "LARC: Add Component from Registry"
- Select a component from the list
- Component is added to your project
Code Snippets
JavaScript
| Trigger | Description |
|---------|-------------|
| larc-component | Full web component boilerplate |
| larc-pan-component | Component with PAN bus integration |
| pan-subscribe | Subscribe to PAN bus topic |
| pan-publish | Publish to PAN bus topic |
| import-larc | Import LARC core utilities |
HTML
| Trigger | Description |
|---------|-------------|
| larc-importmap | Import map script tag |
| larc-import | Module script tag |
| pan-bus | PAN bus element |
| larc-comp | Generic LARC component element |
Settings
Configure the extension in your VS Code settings:
{
"larc.autoImport": true,
"larc.snippetsEnabled": true,
"larc.registryUrl": "https://raw.githubusercontent.com/larcjs/registry/main/registry.json"
}Available Settings
larc.autoImport- Automatically add imports for LARC components (default:true)larc.snippetsEnabled- Enable LARC code snippets (default:true)larc.registryUrl- URL to the LARC component registry
Requirements
- Visual Studio Code 1.80.0 or higher
- Node.js 18+ (for CLI commands)
Example Workflow
Create a new LARC project:
npx create-larc-app my-app code my-appUse Command Palette to add a component from registry:
Ctrl+Shift+P→ "LARC: Add Component from Registry"
Generate a custom component:
Ctrl+Shift+P→ "LARC: New Component"
Use snippets for quick coding:
- Type
larc-componentand press Tab - Type
pan-subscribefor PAN bus subscriptions
- Type
Known Issues
- Registry loading may take a few seconds on first activation
- Auto-completion works best with JavaScript and HTML files
Release Notes
1.0.0
- Initial release
- Component snippets
- Registry integration
- Commands for component generation
- IntelliSense support
Contributing
See CONTRIBUTING.md
License
MIT
