oxc-project / oxc-project/backlog

Provide compile errors from `#[ast]` macro

Open
#124 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
7
Forks
0
PR merge metrics
No merged PRs in 30d

Description

#[ast] attribute is not meaningful unless the type it's on is in a file which is processed by AST codegen.

Make macro raise an error/panic if the file path needs to be added to AST codegen, with an error that says what to do. This will help people do the right thing.

  • Error on invalid arguments to generate_derive (#4766)
  • Error if fundamental type names such as Span and primitives don't meet our expectations
  • Error on usage of #[ast] attribute on types outside of ast_codegen's view

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace #[ast] handling through ast_codegen and generate_derive, starting with how invalid arguments currently produce errors. Confirm the expected behavior for types outside ast_codegen's view and the guidance the diagnostic should provide. Done means misuse produces a clear compile error explaining how to add the file to AST codegen.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.