oxc-project / oxc-project/backlog

Remove `AstNode::scope_id` field

Open
#98 0 comments 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

This field is only used:

  1. Within SemanticBuilder - where builder.current_scope_id can be used instead.
  2. In linter - where could get the ScopeId by traversing up nodes via AstNodes::parent_ids until find a node with a scope (we can do that now as AST nodes contain scope_id fields, and it shouldn't cost much as you generally don't have to go up far to find a BlockStatement or Function).

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

  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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.