Skip to content

feat: Add dampen-lsp server#1

Merged
mattdef merged 9 commits intomasterfrom
001-lsp-server
Jan 31, 2026
Merged

feat: Add dampen-lsp server#1
mattdef merged 9 commits intomasterfrom
001-lsp-server

Conversation

@mattdef
Copy link
Copy Markdown
Owner

@mattdef mattdef commented Jan 31, 2026

Summary

Add a Language Server Protocol (LSP) implementation for Dampen UI framework to provide IDE features like autocompletion and hover information.

Changes

  • Initial LSP server implementation with tower-lsp
  • Autocompletion for widgets, attributes, and values
  • Hover support for documentation
  • Text document synchronization
  • Comprehensive test suite including benchmarks

Testing

  • Unit tests for all handlers
  • Integration tests
  • Benchmark tests for performance validation

New Crate

  • crates/dampen-lsp/ - Full LSP server implementation

This commit adds the initial implementation of the Dampen LSP server,
including:

- Basic server infrastructure using tower-lsp
- Document cache management
- XML validation and error reporting
- Basic completion and hover handlers
- Type conversion utilities
- Test fixtures and integration tests

The implementation follows the architecture outlined in the LSP
implementation plan, with all core modules in place and basic
functionality working.
Implement widget and attribute detection for completion context

Add tests for completion context analysis

Update roxmltree dependency to 0.21
Implement context-aware completion for:
- Widget names when typing `<`
- Attribute names when inside widget tags
- Attribute values when inside quotes

Add completion handler to LSP server
Add integration tests for completion scenarios
Implement value suggestions for common attribute types
Add widget schema support for attribute completion
Add tests for widget, attribute, and value completion in LSP handler

Add test fixtures for completion scenarios

Add completion test module

Add handlers test module
This commit adds comprehensive hover support to the Dampen LSP server,
enabling detailed documentation for widgets and attributes. The
implementation includes:

1. A new hover handler in main.rs that processes hover requests
2. Expanded schema data with detailed documentation for all core widgets
   and common attributes
3. Support for analyzing document context to determine what element is
   being hovered over
4. Performance monitoring for hover responses
5. Unit tests for the hover functionality

The documentation now includes:
- Detailed descriptions of each widget's purpose
- Required and optional attributes with examples
- Event attributes with usage examples
- Style attributes with formatting examples
- Code examples for each widget
- See Also sections with related widgets

The hover implementation follows the LSP protocol and provides
context-aware documentation based on the position in the document.
Add edge case tests for LSP server

Add hover tests for LSP server

Add editor integration guide
Add support for border styles, transforms, and improved layout
attributes

Update theme inheritance documentation and examples

Add responsive layout properties and flexbox-like alignment

Standardize style class syntax to use `<class>` instead of `<style>`

Add new widget attributes for images, inputs, and other controls

Update XML schema documentation with current attribute requirements

Remove deprecated attributes and update examples

Add new state variant syntax options

Improve documentation of layout and alignment properties
Update tracing to use stderr and remove diagnostic provider capability
in favor of push diagnostics
@mattdef mattdef merged commit fb27c58 into master Jan 31, 2026
4 checks passed
@mattdef mattdef deleted the 001-lsp-server branch January 31, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant