Skip to content

Add Ada language support via tree-sitter-ada#1493

Open
guglxni wants to merge 1 commit into
Graphify-Labs:v8from
guglxni:feat/ada-language-support
Open

Add Ada language support via tree-sitter-ada#1493
guglxni wants to merge 1 commit into
Graphify-Labs:v8from
guglxni:feat/ada-language-support

Conversation

@guglxni

@guglxni guglxni commented Jun 27, 2026

Copy link
Copy Markdown

Adds extract_ada() for .ada, .adb, and .ads files using tree-sitter-ada.

What it extracts

Packages (spec and body), subprograms (procedures, functions, expression functions, null procedures), types (record, derived, interface, array, access, enumeration), subtypes, tasks (type and single), protected objects (type and single), entries, generics (packages and instantiations), exceptions, object declarations, and renaming declarations.

Edges emitted

Relation From To
defines scope its declarations
imports scope modules from with/use clauses
calls subprogram body called functions/procedures
inherits derived type / subtype parent type
implements type interface it implements
instantiates generic instantiation generic package
references declaration type annotations, exception handlers, raise targets, renaming targets

Changes

  • graphify/extract.pyextract_ada() implementation with custom tree walk
  • graphify/detect.py.ada, .adb, .ads added to CODE_EXTENSIONS
  • pyproject.tomltree-sitter-ada>=0.1.0 dependency
  • tests/fixtures/sample.ads — spec fixture covering all constructs
  • tests/fixtures/sample.adb — body fixture
  • tests/test_languages.py — 40 tests
  • README.md — grammar count 36 → 37

Closes #1491

Add extract_ada() with full AST extraction for Ada source files.
Handles packages (spec and body), subprograms (procedures, functions,
expression functions, null procedures), types (record, derived,
interface, array, access, enumeration), subtypes, tasks, protected
objects, entries, generics (packages and instantiations), exceptions,
object declarations, and renaming declarations.

Edge types emitted:
- defines: scopes to their declarations
- imports: with/use clauses to referenced modules
- calls: subprogram bodies to called functions/procedures
- inherits: derived types and subtypes to parent types
- implements: types implementing interfaces
- instantiates: generic instantiations to generic packages
- references: type annotations, exception handlers, raise statements,
  and renaming declarations to their targets

Files:
- graphify/extract.py: extract_ada() implementation
- graphify/detect.py: .ada/.adb/.ads in CODE_EXTENSIONS
- pyproject.toml: tree-sitter-ada>=0.1.0 dependency
- tests/fixtures/sample.ads: spec fixture
- tests/fixtures/sample.adb: body fixture
- tests/test_languages.py: 40 tests
- README.md: 36 -> 37 grammars

Closes Graphify-Labs#1491
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Ada language support via tree-sitter-ada

1 participant