Oak Navigation
Core navigation traits and structures for the Oak ecosystem, providing "Go to Definition" and "Find References" capabilities.
🎯 Overview
Oak Navigation defines the standard interfaces for navigating through source code. It provides the abstractions needed for cross-referencing symbols across files and projects, supporting the primary navigation features expected in modern IDEs.
✨ Features
- Standardized Traits:
DefinitionProviderandReferencesProviderfor consistent implementation across languages. - LSP Compatibility: Directly maps to LSP
textDocument/definitionandtextDocument/references. - Location Mapping: Uses standard
LocationandPositiontypes for precise navigation. - Language Agnostic: Works with any language that implements the Oak
Languagetrait.
🚀 Quick Start
Basic implementation of a definition provider:
use ;
use RedNode;
use MyLanguage;
;
📋 Examples
Finding References
use ;
use RedNode;
🏗️ Integration
Oak Navigation is a key part of:
- Oak LSP: Powers the navigation requests in language servers.
- Oak Symbols: Often works in tandem with symbol providers to build a complete index.
- IDE Plugins: Enables "Jump to Definition" (F12) and "Find All References" (Shift+F12).
📊 Performance
- Fast Indexing: Designed to work with global symbol indexes for rapid lookup.
- Lazy Resolution: Navigation targets are resolved only when requested.
🤝 Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Oak Navigation - Seamless code navigation for every language 🚀