Skip to content

Add Clojure extraction support#816

Open
alendit wants to merge 2 commits into
safishamsi:v8from
alendit:codex/clojure-extraction-support
Open

Add Clojure extraction support#816
alendit wants to merge 2 commits into
safishamsi:v8from
alendit:codex/clojure-extraction-support

Conversation

@alendit

@alendit alendit commented May 11, 2026

Copy link
Copy Markdown

Summary

Adds tree-sitter backed Clojure .clj extraction to Graphify.

  • extracts namespaces, require/import edges, common top-level definitions, protocol methods, and same-file calls
  • wires .clj through detection, collection, watch, hooks, docs, and skill metadata
  • adds fixture-backed regression coverage for bare requires and quoted/commented non-calls

Validation

  • .venv/bin/python3 -m pytest -q -> 302 passed, 2 warnings
  • git diff --check -> clean

@alendit alendit changed the title [codex] Add Clojure extraction support Add Clojure extraction support May 11, 2026
@alendit alendit force-pushed the codex/clojure-extraction-support branch from 3330559 to faed100 Compare May 12, 2026 01:09
@alendit alendit changed the base branch from main to v7 May 12, 2026 01:09
@safishamsi

Copy link
Copy Markdown
Owner

Solid Clojure extractor — the namespace/defs/require/call extraction is well-structured and the quoted-form skipping is a nice touch. Two things to resolve before we merge:

1. Merge conflict
The PR currently has mergeStateStatus: CONFLICTING — it was branched from an older v7 base. Please rebase onto current main (v0.7.19) and resolve any conflicts.

2. Missing test helper (verify or add)
Several of the new tests call _edges_with_relation() (e.g. test_clojure_import_edges_have_import_context, test_clojure_call_edges_have_call_context). Please confirm this helper exists in tests/test_languages.py — if not, add it. Without it those tests will NameError at collection time.

Minor
label_to_nid uses label.lower() which silently collapses Clojure's case-sensitive identifiers (Foo and foo resolve to the same target). Low impact for now, but worth a follow-up issue.

Once rebased and the test helper is confirmed, we'll merge. Thanks!

@alendit alendit force-pushed the codex/clojure-extraction-support branch from faed100 to 4bbab8a Compare May 17, 2026 15:17
@alendit alendit changed the base branch from v7 to main May 17, 2026 15:22
@alendit

alendit commented May 17, 2026

Copy link
Copy Markdown
Author

Hi @safishamsi when you say "current main" do you mean the main branch? Because it sort of looks stale to me and v8 is now the default. Tbh I'm a bit confused by the branching in this project. My best reading is to actually rebase the change on the v8 branch, I'll do that, tell we if it's wrong.

Add tree-sitter backed .clj extraction for namespaces, requires/imports, common definitions, protocol methods, and same-file calls. Wire .clj through detection, collection, watch, hooks, docs, and skill metadata.

Co-authored-by: Codex <noreply@openai.com>
@alendit alendit force-pushed the codex/clojure-extraction-support branch from 4bbab8a to 5ffc73a Compare May 17, 2026 15:32
@alendit alendit changed the base branch from main to v8 May 17, 2026 15:33
@alendit

alendit commented May 17, 2026

Copy link
Copy Markdown
Author

Confirming that the full run passes

uv run --extra sql pytest tests/test_languages.py tests/test_detect.py tests/test_multilang.py tests/test_watch.py -> 254 passed

@alendit alendit force-pushed the codex/clojure-extraction-support branch from 5ffc73a to 13c6df5 Compare May 17, 2026 15:49
Keep Clojure extractor IDs and same-file call lookup case-sensitive, and avoid deduplicating same-file code labels that only differ by case.

Co-authored-by: Codex <noreply@openai.com>
@alendit alendit force-pushed the codex/clojure-extraction-support branch from 13c6df5 to e92ba1f Compare May 17, 2026 15:55
@alendit

alendit commented May 17, 2026

Copy link
Copy Markdown
Author

Fixed the lower-case issue as suggested.

@alendit alendit marked this pull request as ready for review May 17, 2026 15:58
@lucasrim

Copy link
Copy Markdown

Would love to have this feature added!

@kagel

kagel commented May 19, 2026

Copy link
Copy Markdown

Would also love to have this feature added!

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.

4 participants