feat(haskell): add tree-sitter-haskell language support#1439
Open
alexbiehl wants to merge 1 commit into
Open
Conversation
Wire Haskell (.hs) into the extractor: _HASKELL_CONFIG, _import_haskell, a Haskell branch in walk_calls for nested `apply` application + higher-order references, extract_haskell, _DISPATCH/.hs registration, CODE_EXTENSIONS, the tree-sitter-haskell core dep, a fixture, and 7 tests. Verified on the pulse repo: 471/472 real .hs files extract cleanly (the lone gap, Password.hs, is a pre-existing file-node-id collision bug under investigation, not a Haskell-extractor issue). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Haskell (
.hs) as a first-class extracted language, following the existingLanguageConfig/_extract_genericpattern (modeled on Kotlin).What's included
tree-sitter-haskell>=0.23,<0.24as a core dependency (abi3 wheels exist for all platforms)._HASKELL_CONFIG— mapsdata_type/newtype/type_synomym/class/instance→ containers,function/bind→ functions,import→ imports,apply/variable/qualified→ calls._import_haskell— reads theimportnode'smodulefield (Haskell-specific; Kotlin usespath).walk_calls— Haskell application nests (f x y→apply(apply(f, x), y)), so it descends the leftmostfunctionfield for the direct callee, and also treats barevariable/qualifiedleaves as calls so higher-order uses (theareainmap area xs) attribute to the caller.extract_haskell,.hsin_DISPATCH,.hsindetect.CODE_EXTENSIONS.tests/fixtures/sample.hs+ 7 tests (skipif when the grammar is absent).Two grammar gotchas handled
Shape -> Double) is also afunctionnode (nested undersignature). A naïve config emits a spuriousDouble()"function". Fixed byname_fallback_child_types=()so type-level nodes (which lack anamefield) are skipped. Regression test included.type_synomymis the grammar's real (misspelled) node-type string — kept verbatim, not "corrected".Verification
test_languages.py= 257 passed, 13 skipped (optionaltree-sitter-dm), no regressions..hsfiles): clean parse, with data types, classes, functions, imports, and cross-function call edges (e.g.updateS7TagMonitor → resolveUpdateDataType).🤖 Generated with Claude Code