You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add tree-sitter extractor + LSP enrichment support for three enterprise/scientific languages: Fortran, Ada, and COBOL.
All three have actively maintained LSP servers and tree-sitter grammars available. None have SCIP indexers, so the implementation path is the standard tree-sitter + LSP enrichment pipeline.
Create src/indexer/extractors/fortran.ts — extract program, subroutine, function, module, type declarations; extract call statements and function references as call refs; extract use statements as imports
Register in SourceIndexStage EXTRACTORS map and ParserPool LANG_PACKAGES
Add fortls to src/indexer/lsp/registry.ts ({ command: 'fortls', args: ['--notify_init'] })
Ada has specs (.ads) and bodies (.adb) — both should be indexed
with Package_Name; use Package_Name; is the import pattern
Package hierarchy defines the namespace: Package.Child.Procedure_Name
AdaCore's LSP server requires a GPR project file; may need config guidance
COBOL
LSP server:Broadcom COBOL Language Support (Eclipse, active, enterprise-grade) Alternative: IBM Z Open Editor (commercial) Tree-sitter grammar:tree-sitter-cobol Demand: Banking, insurance, mainframe modernization
What to implement
Add tree-sitter-cobol as a dependency
Create src/indexer/extractors/cobol.ts — extract PROGRAM-ID, SECTION, PARAGRAPH declarations; extract PERFORM and CALL statements as call refs; extract COPY statements as imports
Register in SourceIndexStage EXTRACTORS map and ParserPool LANG_PACKAGES
Add Broadcom COBOL LS to LSP registry
Add file extensions: .cob, .cbl, .cpy, .cobol
Add test fixtures in tests/fixtures/cobol/
Add extractor tests
Notes
COBOL has divisions (IDENTIFICATION, ENVIRONMENT, DATA, PROCEDURE) — focus extraction on PROCEDURE DIVISION
PERFORM paragraph-name and CALL 'program-name' are the primary call patterns
COPY copybook-name is the include/import mechanism
Summary
Add tree-sitter extractor + LSP enrichment support for three enterprise/scientific languages: Fortran, Ada, and COBOL.
All three have actively maintained LSP servers and tree-sitter grammars available. None have SCIP indexers, so the implementation path is the standard tree-sitter + LSP enrichment pipeline.
Fortran
LSP server:
fortls(Python,pip install fortls, 500+ stars, active)Tree-sitter grammar:
tree-sitter-fortranDemand: HPC, scientific computing, national labs, weather modeling
What to implement
tree-sitter-fortranas a dependencysrc/indexer/extractors/fortran.ts— extractprogram,subroutine,function,module,typedeclarations; extractcallstatements and function references as call refs; extractusestatements as importsSourceIndexStageEXTRACTORS map andParserPoolLANG_PACKAGESfortlstosrc/indexer/lsp/registry.ts({ command: 'fortls', args: ['--notify_init'] }).f,.f90,.f95,.f03,.f08,.for,.fpptests/fixtures/fortran/Notes
.f90+) and fixed-form (.f) syntax; tree-sitter-fortran handles bothCALL subroutine_name(args)is the primary call pattern; function calls appear as expressionsUSE module_nameis the import mechanismTYPE :: TypeNamedefines derived types (similar to structs)Ada
LSP server:
ada_language_server(AdaCore, production-grade, used in GNAT Studio)Tree-sitter grammar:
tree-sitter-adaDemand: Aerospace, defense, safety-critical systems, embedded
What to implement
tree-sitter-adaas a dependencysrc/indexer/extractors/ada.ts— extractprocedure,function,package,task,protected,typedeclarations; extract procedure/function calls as call refs; extractwith/useclauses as importsSourceIndexStageEXTRACTORS map andParserPoolLANG_PACKAGESada_language_serverto LSP registry ({ command: 'ada_language_server', args: [] }).ads,.adb,.adatests/fixtures/ada/Notes
.ads) and bodies (.adb) — both should be indexedwith Package_Name; use Package_Name;is the import patternPackage.Child.Procedure_NameCOBOL
LSP server: Broadcom COBOL Language Support (Eclipse, active, enterprise-grade)
Alternative: IBM Z Open Editor (commercial)
Tree-sitter grammar:
tree-sitter-cobolDemand: Banking, insurance, mainframe modernization
What to implement
tree-sitter-cobolas a dependencysrc/indexer/extractors/cobol.ts— extractPROGRAM-ID,SECTION,PARAGRAPHdeclarations; extractPERFORMandCALLstatements as call refs; extractCOPYstatements as importsSourceIndexStageEXTRACTORS map andParserPoolLANG_PACKAGES.cob,.cbl,.cpy,.coboltests/fixtures/cobol/Notes
PERFORM paragraph-nameandCALL 'program-name'are the primary call patternsCOPY copybook-nameis the include/import mechanism.lore.configsupportImplementation order
Recommended: Fortran → Ada → COBOL (in order of decreasing tooling maturity and setup simplicity)
References
src/indexer/extractors/c.tsorsrc/indexer/extractors/python.tsas templates