Oak Hover
A flexible hover information provider for the Oak ecosystem, enabling rich documentation and type information display on mouse hover.
🎯 Overview
Oak Hover provides the infrastructure for displaying context-aware information when a user hovers over code elements. It defines standard structures for hover content (Markdown support) and a trait-based system for language-specific hover implementations.
✨ Features
- Markdown Support: Rich text formatting for hover tooltips.
- Context Awareness: Provides information based on the exact AST node under the cursor.
- Range Highlighting: Optional ability to highlight the specific code range the hover applies to.
- LSP Ready: Fully compatible with the Language Server Protocol
textDocument/hoverrequest. - Language Extensible: Simple trait to implement for any Oak-supported language.
🚀 Quick Start
Basic usage of the Hover structure:
use Hover;
use Range;
let hover = Hover ;
📋 Examples
Implementing a Hover Provider
use ;
use ;
use Range;
;
🔧 Advanced Features
Rich Markdown Formatting
Oak Hover encourages the use of Markdown for beautiful presentation:
let hover = Hover
"#.to_string(), range: None, };
## 🏗️ Integration
Oak Hover is designed to work with:
- **Oak LSP**: Maps `HoverProvider` results to LSP `Hover` responses.
- **Oak Documentation**: Can be used to generate tooltip-like documentation in static docs.
- **IDE Tooltips**: Powers the "Peek Definition" and documentation popups.
## 📊 Performance
- **Fast Node Lookup**: Efficiently identifies the relevant AST node for any given coordinate.
- **Lazy Content Generation**: Hover content is only generated when requested.
## 🤝 Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
---
**Oak Hover** - Beautiful hover information for every language 🚀