codebase-memory-mcp icon indicating copy to clipboard operation
codebase-memory-mcp copied to clipboard

Support Solidity by integrating solidity-parser-antlr

Open djmahe4 opened this issue 3 months ago • 5 comments

What problem does this solve?

Current indexing/parsing support does not cover Solidity files, so Solidity repositories can be skipped, partially indexed, or produce incomplete code graph/data. That makes the repository memory features much less useful for teams working with smart contracts.

Proposed solution

Add Solidity support by integrating solidity-parser-antlr into the parsing pipeline. Use it to parse Solidity source files, extract declarations/imports/references, and feed the resulting AST into indexing and search so Solidity projects are handled consistently with other supported languages. Include representative public OSS Solidity repos as test beds to validate coverage and parsing quality.

Alternatives considered

Alternative approaches could include extending a hand-rolled parser or relying on simpler regex-based extraction, but those would likely be less accurate and harder to maintain than using a dedicated Solidity parser.

Confirmations

  • [x] I searched existing issues and this is not a duplicate.

djmahe4 avatar Aug 20 '26 04:08 djmahe4

Happy to pick this up — quick check before I start: solidity-parser-antlr looks unmaintained (last updates years old), while @solidity-parser/parser is the actively maintained fork with the same AST shape. OK if I implement against the fork instead? Wanted to confirm before starting so I don't build on a dead dependency.

sanskar717 avatar Sep 03 '26 12:09 sanskar717

Actually I'm working on it in one of my forks and I can do one pr adding solidity as a single lang, but it would take a couple of weeks for me to do so. Meanwhile you can proceed with solidity-parser/parser

djmahe4 avatar Sep 07 '26 02:09 djmahe4

@DeusData @djmahe4

Opened a PR on the existing Tree-sitter Solidity path to address the missing modifier/decorator tracking. This keeps the current C-based architecture and does not introduce a Node.js runtime. The PR specifically adds modifier_invocation tracking so usages such as onlyOwner are included in the code graph.

I can also proceed with the @solidity-parser/parser integration discussed above if the broader scope of #1754 is preferred.

sanskar717 avatar Sep 07 '26 13:09 sanskar717

Thank you for separating Tree-sitter modifier tracking from the proposed parser integration. The broader dependency and contributor coordination need maintainer direction. Sorry for the delay; this is waiting on maintainer follow-up, and I’ll follow up soon.

DeusData avatar Oct 25 '26 17:10 DeusData

Thanks, @DeusData, no rush at all. I'll wait for the maintainer direction.

sanskar717 avatar Oct 26 '26 06:10 sanskar717