Go to Definition
Jump directly to where symbols are defined, whether in the same file or across your entire project.Basic Usage
Navigate to Definition
Use
GoToDefinition to jump to the definition of the symbol under your cursor. Glass uses LSP to provide accurate results across languages.Open in Split
Use
GoToDefinitionSplit to open the definition in a new split pane, keeping your current context visible.Glass’s go to definition feature works seamlessly across multiple language servers, automatically choosing the most appropriate server for each file type.
Find References
Locate all usages of a symbol across your project to understand its impact and relationships.How It Works
- LSP Integration: Glass queries language servers for reference information
- Multi-file Search: Results span your entire workspace
- Contextual Display: See each reference with surrounding code for context
Symbol Navigation
Quickly jump between symbols in your current file or across your project.Document Symbols
- Functions and methods
- Classes and structs
- Constants and variables
- Imports and modules
Outline View
Glass provides an outline view showing the hierarchical structure of your code:Hover Information
Get instant information about symbols without leaving your editor.Hover Popover
- Type Information
- Documentation
- Diagnostics
Hover over variables and expressions to see their types, inferred by the language server.
Inlay Hints
Glass supports LSP inlay hints for additional inline information:- Parameter names in function calls
- Type annotations for inferred types
- Return types for closures
- Chaining hints for method chains
You can hover over inlay hints to get additional information and context about the displayed information.
Language Server Protocol
Glass’s navigation features are powered by LSP, providing consistent functionality across programming languages.LSP Capabilities
- textDocument/definition - Go to definition
- textDocument/references - Find all references
- textDocument/documentSymbol - Document outline
- textDocument/hover - Hover information
- textDocument/signatureHelp - Function signatures
- textDocument/implementation - Find implementations
- textDocument/typeDefinition - Go to type definition
Server Management
- Automatic server startup and shutdown
- Per-language configuration
- Workspace folder awareness
- Request timeout handling
Code Actions
Access context-aware refactorings and quick fixes directly from the editor.Toggle Code Actions
- Diagnostic indicators - Quick fixes for errors
- Run menu - Execute or debug code
- Quick action bar - Common refactorings
Available Code Actions
Depending on your language server:- Extract function/variable
- Rename symbol
- Organize imports
- Generate code (constructors, getters, etc.)
- Apply quick fixes for diagnostics
Breadcrumbs
Glass displays breadcrumbs showing your current location in the code hierarchy:- Current file path
- Symbol hierarchy (class → method → nested function)
- Click to navigate to any level
Diagnostic Navigation
Quickly jump between errors and warnings in your code.Go to Diagnostic
Navigate through diagnostics with filtering:- All diagnostics - Errors, warnings, and info
- Errors only - Focus on breaking issues
- Warnings and errors - Skip informational messages
Hover Links
Glass supports clickable links in hover information:- Open referenced files
- Navigate to related symbols
- View external documentation
- Follow URLs in documentation
Search Settings
- Case sensitivity in symbol search
- Whole word matching
- Regular expression support
- Search scope (current file, workspace, etc.)
Performance Considerations
LSP Request Timeouts
- Default 120-second timeout for LSP requests
- Graceful fallback when servers are slow
- Request cancellation on navigation away
Caching
Glass caches navigation results for performance:- Symbol indices for quick lookup
- Reference results for repeated queries
- Hover information for responsive UI
Best Practices
- Use breadcrumbs to understand your current context in large files
- Enable inlay hints for better code comprehension, especially in languages with type inference
- Configure go to definition fallback for robustness when LSP is unavailable
- Use find references before major refactorings to assess impact
- Leverage code actions for safe, language-aware refactorings
- Navigate diagnostics systematically to ensure code quality
Related Features
- Code Editing - Text manipulation and multi-cursor editing
- Debugging - Debug your code with breakpoints and inspection
- Testing - Run tests and tasks from the editor