oxc-project / oxc-project/backlog
Remove `AstNode::scope_id` field
Open
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 7
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
This field is only used:
- Within
SemanticBuilder- wherebuilder.current_scope_idcan be used instead. - In linter - where could get the
ScopeIdby traversing up nodes viaAstNodes::parent_idsuntil find a node with a scope (we can do that now as AST nodes containscope_idfields, and it shouldn't cost much as you generally don't have to go up far to find aBlockStatementorFunction).
I don't know if that'd be a perf gain or loss overall in the linter, but it'd be a gain for everything else which uses Semantic.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate AstNode::scope_id and trace its uses in SemanticBuilder and the linter. Read how builder.current_scope_id and AstNodes::parent_ids are used, then verify that removing the field preserves semantic and linter behavior. Done means the field and its uses are removed without regressions.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100