Dampen for VS Code
VS Code extension for the Dampen UI framework with Language Server Protocol (LSP) support.
Features
- Syntax Highlighting: Full XML-based syntax highlighting for
.dampen files
- Language Server Support: Integration with
dampen-lsp for advanced features:
- Autocompletion
- Diagnostics (error checking)
- Hover information
- Go-to-definition
- Code Snippets: Quick insertion of common Dampen widgets
- Automatic LSP Binary Management: Auto-download and cache the LSP server
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Dampen"
- Click Install
From VSIX
- Download the
.vsix file from releases
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Click "..." menu → "Install from VSIX"
- Select the downloaded file
Configuration
The extension provides the following settings:
| Setting |
Default |
Description |
dampen.lspPath |
"" |
Path to the dampen-lsp binary. If not set, the extension will search in PATH or download automatically. |
dampen.autoDownload |
true |
Automatically download the dampen-lsp binary if not found. |
dampen.lspVersion |
"latest" |
Version of dampen-lsp to download (e.g., 'latest' or 'v1.0.0'). |
Commands
The extension provides the following commands:
- Dampen: Check Syntax - Validate the current
.dampen file
- Dampen: Restart Language Server - Restart the LSP server
Access these commands through the Command Palette (Ctrl+Shift+P) and type "Dampen".
Code Snippets
Type the following prefixes and press Tab to insert snippets:
| Prefix |
Description |
button |
Button widget |
column |
Column layout widget |
row |
Row layout widget |
text |
Text widget |
container |
Container widget |
padding |
Padding property |
margin |
Margin property |
width |
Width property |
height |
Height property |
color |
Color property |
bgColor |
Background color property |
Requirements
- VS Code 1.74.0 or higher
dampen-lsp binary (automatically downloaded if not present)
Manual LSP Installation
If you prefer to manually install the LSP server:
- Download the appropriate binary from GitHub Releases
- Place it in your PATH, or
- Set the
dampen.lspPath setting to the binary location
Development
Building from Source
git clone https://github.com/anomalyco/dampen-vscode.git
cd dampen-vscode
npm install
npm run compile
Running in Development Mode
- Open the project in VS Code
- Press F5 to launch the Extension Development Host
- Open a
.dampen file to test
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have questions:
- Check the GitHub Issues
- Create a new issue with details about your problem
Changelog
See CHANGELOG.md for version history.