Add Haskell language support#572
Conversation
PR Overview: Add Haskell Language SupportSummaryThis PR adds comprehensive first-class Haskell language support to Probe, following the established Crystal integration pattern. It implements complete tree-sitter-based parsing, symbol extraction, and LSP integration for both Key ChangesCore Language Implementation
Dependency & Parser Integration
Language Detection & Registration
Symbol Extraction & Analysis
Test Detection
LSP & Indexing Integration
Documentation
Architecture & ImpactComponent Relationshipsgraph TB
A[Haskell Source Files .hs/.lhs] --> B[Parser Pool]
B --> C[HaskellLanguage Impl]
C --> D[Symbol Extraction]
D --> E[TreeSitter Analyzer]
E --> F[LSP Database Adapter]
F --> G[UID Generator]
G --> H[Indexing Pipelines]
H --> I[Search & Query]
J[CLI Commands] --> K[Language Factory]
K --> C
L[Test Detection] --> M[Test File Patterns]
M --> A
Data FlowsequenceDiagram
participant User as CLI/User
participant Factory as Language Factory
participant Pool as Parser Pool
participant Haskell as HaskellLanguage
participant Analyzer as TreeSitter Analyzer
participant LSP as LSP Adapter
User->>Factory: get_language_impl(".hs")
Factory->>Haskell: HaskellLanguage::new()
User->>Pool: parse_with_pool()
Pool->>Haskell: get_tree_sitter_language()
Haskell-->>Pool: tree_sitter_haskell::LANGUAGE
Pool->>Analyzer: analyze_file()
Analyzer->>Haskell: is_symbol_node(), get_symbol_signature()
Analyzer->>LSP: store symbols
LSP->>LSP: generate_uid() with Haskell rules
Files ChangedCore Implementation (1 new file)
Dependency Updates (2 files)
Language Integration (6 files)
Symbol Extraction (3 files)
LSP Daemon Integration (16 files)
Documentation (1 file)
Testing & ValidationThe PR includes:
Scope & ImpactDirect Impact
Cross-Module Boundaries
Related ComponentsBased on the Crystal integration pattern, future work may include:
ReferencesCore Implementation
LSP Integration
Testing
Metadata
Powered by Visor from Probelabs Last updated: 2026-06-02T10:38:44.476Z | Triggered by: pr_updated | Commit: be8117b 💡 TIP: You can chat with Visor using |
Architecture Issues (8)
Performance Issues (4)
Architecture Issues (8)
No quality issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2026-06-02T10:21:30.322Z | Triggered by: pr_updated | Commit: be8117b 💡 TIP: You can chat with Visor using |
Summary
Adds first-class Haskell support across Probe's language-aware paths, following the Crystal integration pattern:
tree-sitter-haskellbackedHaskellLanguageimplementation for.hsand.lhsfind_symbol_at_position()tree-sitter selection, and Haskell operator extractionDogfood
Validated on real Haskell projects cloned under
/tmp/tmp.WnZvUXswwUand/tmp/tmp.bVINF8U3oI:cabalata51c4ee(Merge pull request #11479 from omarjatoi/11269-warnings-in-reverse)haskell-language-serverat2a30435(Avoid relying on OccNames when generating class methods (#4932))shellcheckat764802b(Merge pull request #3443 from dotysan/printf_dashv_nospace)pandocate16f501(cabal.project: ensure we use latest doclayout for build.)xmonadata618fb3(ci: Regenerate haskell-ci)Edge cases exercised:
Ide/Plugin/Properties.hs, CabalSetupHooks/Rule.hsManageHook.hsHlsPlugins.hs.lhs: HLS eval-plugin/manual literate fixtureslang:haskell,lang:hs,lang:lhs--with-contexton real HLS sourceCommands exercised included:
probe symbolson Cabal, HLS, xmonad, Pandoc, and.lhsfilesprobe extract ...#ToHsTypefor a type familyprobe extract ...#RuleCommandsfor a multiline GADT declarationprobe extract ...#(<+>)andprobe extract ...#(-->)for Haskell operatorsprobe extract ...#PluginMethodon HLS typeclass-heavy codeprobe query ... --language hs --with-context --format jsonprobe query ... --language lhson bird-style and LaTeX-style literate Haskellprobe search 'KnownExtension AND lang:haskell',probe search 'HandlerM AND lang:hs', andprobe search 'prod AND lang:lhs'Dogfood found and fixed a real gap: operator extraction was falling back to text search for xmonad operators and could pick up comments. The fix adds Haskell
prefix_idsupport and lets Haskell signature nodes participate in structural symbol lookup while preferring concrete definitions when available.Local Haskell LSP tool availability was also checked. This environment does not have
haskell-language-server-wrapper,haskell-language-server,ghc,cabal, orstackinstalled, so live HLS startup/version validation was not possible here. Tree-sitter/LSP integration paths are covered by unit tests.Validation
cargo fmt --all -- --checkcargo test --test haskell_language_testscargo test -p lsp-daemon haskellcargo check -p probe-codecargo check -p lsp-daemoncargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningsRUST_BACKTRACE=1 cargo test --libRUST_BACKTRACE=1 cargo test --test integration_tests