Skip to content

feat(doc): migrate from solang to solar#14447

Open
mablr wants to merge 4 commits intomasterfrom
mablr/migrate-forge-doc-solang-to-solar
Open

feat(doc): migrate from solang to solar#14447
mablr wants to merge 4 commits intomasterfrom
mablr/migrate-forge-doc-solang-to-solar

Conversation

@mablr
Copy link
Copy Markdown
Collaborator

@mablr mablr commented Apr 24, 2026

Motivation

Replace all solang_parser usage in forge-doc with solar AST. Use owned purpose-built structs (ParamInfo, ContractSource, FunctionSource, etc.) extracted at walk time instead of cloning arena-allocated solar AST nodes.

  • Add parser/source.rs with owned doc structs
  • Rewrite Parser to walk solar AST items directly
  • Parse doc comments from solar's DocComments (raw text)
  • Update builder to use solar AST from gcx, remove solang re-parse
  • Update writer and preprocessor layers for owned structs
  • Delete solang_ext/ module (Visitor, Visitable, AstEq, etc.)
  • Remove solang-parser dependency from forge-doc
  • Decouple chisel from forge-doc (inline CodeLocation/SafeUnwrap)

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Replace all solang_parser usage in forge-doc with solar AST.
Use owned purpose-built structs (ParamInfo, ContractSource,
FunctionSource, etc.) extracted at walk time instead of cloning
arena-allocated solar AST nodes.

- Add parser/source.rs with owned doc structs
- Rewrite Parser to walk solar AST items directly
- Parse doc comments from solar's DocComments (raw text)
- Update builder to use solar AST from gcx, remove solang re-parse
- Update writer and preprocessor layers for owned structs
- Delete solang_ext/ module (Visitor, Visitable, AstEq, etc.)
- Remove solang-parser dependency from forge-doc
- Decouple chisel from forge-doc (inline CodeLocation/SafeUnwrap)

Co-authored-by: Amp <amp@ampcode.com>
@mablr mablr marked this pull request as ready for review April 24, 2026 15:04
@DaniPopes
Copy link
Copy Markdown
Member

would be nicer to rewrite from scratch and have an actual test harness and suite for this, but i guess at this point we can leave that for the future.

Copy link
Copy Markdown
Collaborator

@stevencartavia stevencartavia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a minor nit

Comment thread crates/doc/src/writer/as_doc.rs
@mablr mablr requested a review from stevencartavia April 27, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants