- 68% of nodes appeared gray due to insufficient location information for colorization
- LSP semantic analysis only covered ~30 nodes out of 94 total nodes in dataflow graphs
- Tree-sitter found all operators but lacked semantic type information for location assignment
- Replaced old LSP-first approach with hybrid tree-sitter + LSP enhancement strategy
- Tree-sitter provides reliable structure: All operator nodes and dataflow edges
- Multi-source LSP enhancement: Semantic tokens + hover analysis + type definitions
- Default location assignment: Ensures 100% node coverage with reasonable fallbacks
-
Primary LSP Analysis (
locationAnalyzer.analyzeDocument())- Semantic token analysis for high-quality type information
- ~30 locations with precise type data
-
Hover-Based LSP Extraction ✨ NEW
vscode.executeHoverProviderqueries at operator positions- Parses concrete instantiated types from hover responses
- Handles patterns:
Stream<T, Process<Leader>, Bounded>→Process<Leader> - Expected: Additional 20-40 locations from hover data
-
Default Location Assignment ✨ NEW
- Operator-based heuristics for remaining nodes
- Networking ops →
Cluster<Leader>, Sources →Process<Leader>, etc. - Guarantees: All nodes get location assignment for proper coloring
- Moved from hardcoded lists to VS Code settings (
hydroIde.operators.*) - Hot-swappable configuration without extension restart
- Comprehensive operator categories: networking, core dataflow, sinks, collection types
- Utility script (
updateOperators.js) to scan Hydro codebase and update settings
- Robust variable binding parsing including destructuring patterns
- Standalone chain detection for method chains not assigned to variables
- Inter-variable edge creation for complex dataflow patterns
- Network edge analysis with semantic tagging for distributed system visualization
- Location Hierarchy: Groups nodes by Hydro location types (Process, Cluster, Tick)
- Code Hierarchy: Groups by file → function → variable structure
- Nested Tick support: Handles
Tick<Tick<Process<Leader>>>patterns - Smart container collapsing: Reduces visual clutter in hierarchy
- Before: 30 locations (32% of nodes colored)
- After: 50-70 locations (53-74% of nodes colored)
- Guaranteed: 100% of nodes get location assignment with defaults
- Better network visualization: Proper tagging of distributed communication edges
- Improved debugging: Dual hierarchy for both location and code structure views
// Extracts location patterns from LSP hover responses
const locationPatterns = [
/Stream<[^,]+,\s*([^,>]+)(?:,\s*[^>]+)?>/, // Stream types
/Singleton<[^,]+,\s*([^>]+)>/, // Singleton types
/(Process<[^>]+>|Cluster<[^>]+>)/, // Direct location types
];- Position-based keys prevent duplicate location entries
- Prioritizes primary LSP analysis over hover results
- Combines multiple sources without conflicts
- Handles complex generic types with nested angle brackets
- Extracts boundedness, ordering, and keyedness information
- Supports associated types and where clause constraints
src/analysis/lspGraphExtractor.ts: Core hybrid architecture implementationsrc/analysis/locationAnalyzer.ts: Multi-strategy coordination layersrc/analysis/lspAnalyzer.ts: Enhanced with hover analysis and type definition queriessrc/analysis/treeSitterParser.ts: Improved variable binding and chain parsingpackage.json: Added comprehensive operator configuration settingsscripts/updateOperators.js: Utility for scanning Hydro codebase
- Significantly fewer gray nodes in dataflow visualizations
- Better location grouping with proper hierarchy containers
- Network edge highlighting for distributed system boundaries
- Clearer Paxos visualization with proper consensus phase coloring
This implementation provides a robust foundation for accurate Hydro dataflow visualization with comprehensive location information coverage and enhanced debugging capabilities.