Skip to content

Refactor collectVariableUsage #38

Open
@ajafff

Description

@ajafff

The current API is somewhat difficult to use and does too much by analyzing the whole source file ahead of time.

The new API should return an object that can be used to:

  • get all declarations of an identifier (also with an identifier of a usage)
  • get all uses of a declaration (allow filtering by domain)
  • check if identifier is in scope
  • get a list of all declarations in the file

optionally:

  • get all identifiers in scope (optionally filtered by kind)
  • get all locations where the identifier is in scope (excluding TDZ)
  • lazily analyze only the scopes necessary to answer requests

Needs a good name:

  • ScopeAnalyzer
  • UsageTracker
  • ReferenceFinder

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions