feat(lang): Add Clojure language support#80
Conversation
Add comprehensive Clojure parser using tree-sitter-clojure-orchard. **New Files:** - src/parsing/clojure/mod.rs - Module exports - src/parsing/clojure/definition.rs - ClojureDefinition impl - src/parsing/clojure/parser.rs - AST parsing & symbol extraction - src/parsing/clojure/behavior.rs - Runtime behavior tracking - src/parsing/clojure/resolution.rs - Cross-reference resolution - src/parsing/clojure/audit.rs - Code health analysis **Features:** - Extracts defn, defmacro, def, defmulti, defmethod, defprotocol, defrecord - Handles namespaced symbols and qualified references - Tracks function calls and dependencies - Supports docstrings and metadata extraction - Pattern-based form detection (Clojure grammar is syntax-only) **Dependencies:** - tree-sitter-clojure-orchard = "0.2.5" **Documentation:** - contributing/parsers/clojure/IMPLEMENTATION_GUIDE.md Tested with hive-mcp codebase: 13,324 symbols indexed successfully. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Hi @BuddhiLW Thank you for your contribution! A significant update was merged that includes API changes likely to cause conflicts with your branch. What's changed:
Please rebase on main. Happy to assist if you encounter any issues. |
|
Hi! I will be happy to conciliate with updates. Thank you for considering the PR. One idea I had, because tree-sitter is limited for lisps, I may write a rust module wrapper to use clj-kondo. I have some thoughts. Because, it will help greatly with token-efficiency in my other project (hive-mcp); and behavior normalization. When I have 5+ claudes and 3+ free models per claude doing work, like refactoring etc. Sometimes free models will have way less context and hallucinate on function annotations ("types" for clojure) - I noticed. So, yeah. Let's see... Nice talking to you, anyway. |
Summary
Add comprehensive Clojure language support using
tree-sitter-clojure-orchard.Changes
New Parser Module:
src/parsing/clojure/mod.rs- Module exportsdefinition.rs- ClojureDefinition implementationparser.rs- AST parsing & symbol extraction (30KB)behavior.rs- Runtime behavior trackingresolution.rs- Cross-reference resolutionaudit.rs- Code health analysisIntegration:
Cargo.tomlwithtree-sitter-clojure-orchard = "0.2.5"factory.rs,language.rs,registry.rs.clj,.cljs,.cljc,.ednextensionsFeatures
defn,defmacro,def,defmulti,defmethod,defprotocol,defrecord,nsTesting
Tested with hive-mcp codebase:
Documentation
Added
contributing/parsers/clojure/IMPLEMENTATION_GUIDE.md(1400 lines) with:Notes
The Clojure tree-sitter grammar is syntax-only (no semantic nodes for
defnetc.), so the parser uses pattern matching on list forms to identify definitions. This approach is documented in the implementation guide.🤖 Generated with Claude Code