Skip to content

feat(graph): add NestJS controller route resolver#102

Open
abhinav-phi wants to merge 1 commit into
mex-memory:code-graph-previewfrom
abhinav-phi:feat/nestjs-route-resolver
Open

feat(graph): add NestJS controller route resolver#102
abhinav-phi wants to merge 1 commit into
mex-memory:code-graph-previewfrom
abhinav-phi:feat/nestjs-route-resolver

Conversation

@abhinav-phi

@abhinav-phi abhinav-phi commented Jul 15, 2026

Copy link
Copy Markdown

What

  • Added a Python LanguageExtractor implementing the existing frozen LanguageExtractor interface.
  • Added Python (.py) language detection and registered the Tree-sitter Python WASM grammar.
  • Added extraction support for files, classes, functions, async functions, methods, module variables, constants, imports, calls, inheritance, instantiation, and containment.
  • Added a representative Python fixture and focused extractor tests covering common Python language constructs.

Why

Closes #94

This adds initial Python language support to the code graph preview by:

  • Detecting Python source files through the .py extension.
  • Parsing Python using the vendored Tree-sitter Python WASM grammar.
  • Emitting file, class, function, method, module variable, and constant nodes.
  • Capturing signatures, documentation strings, export visibility conventions, and return annotations where present.
  • Emitting import, call, inheritance, instantiation, and containment references.
  • Preserving unresolved cross-file references through targetName for the existing resolution pass.
  • Keeping extraction deterministic, pure, and limited to a single file.

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Docs
  • CI/Tooling

How to test

  1. Run:

    npm run typecheck
  2. Run:

    npm test
  3. Run:

    npm run build
  4. Verify that:

    • Python (.py) files are detected correctly.
    • Python classes, functions, async functions, methods, module variables, and constants are extracted.
    • Import, call, inheritance, instantiation, and containment relationships are emitted.
    • Cross-file references remain unresolved through targetName.
    • The Python grammar WASM is included in the build output.
    • The new Python extractor tests pass.

Checklist

  • Tests pass (npm test)
  • No breaking changes
  • Tested locally with a real project

Code-graph preview

  • This PR targets code-graph-preview, not main
  • The linked issue states Target branch: code-graph-preview
  • The change follows the frozen LanguageExtractor or FrameworkResolver interface
  • A focused fixture and assertions for the expected node/edge shape are included
  • Any new grammar WASM, extension mapping, extractor, or resolver is registered
  • No graph identity, reconciliation, schema, or drift-semantics changes are included

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.

1 participant