This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
☂️ Symbol/Scope Resolution #2488
Labels
A-Compiler
Area: compiler
A-Parser
Area: parser
L-JavaScript
Langauge: JavaScript
L-JSX
Language: JSX
L-TypeScript
Area: TypeScript support in Rome
umbrella
Issue to track a collection of other issues
Milestone
This issue is tracking all the implementation to achieve two tasks:
1 - Allow "go to definition" on the editor;
2 - Allow to warn against "unused Variables" when linting;
See this discussion about the semantic model architecture: #2614
See this discussion about the architecture on how the semantic model is going to be used inside linters: #2603
Steps
This is my suggestion for implementing the two tasks above. It is actually a progressive implementation:
1 - We do not offer a semantic façade at all. "unusedVariables" lint would just consume the parsing tree, and iterate it to find unused variables;
2 - We cache this iteration somehow to make the lint have a decent performance;
3 - We build the "service/context" architecture that will be passed into the lint;
4 - We store the "service/context" inside
NodeData
;5 - We create the untyped Semantic Tree;
6 - We change the "unusedVariable" lint rule to use the semantic tree.
7 - We implement the typed Semantic Tree. Probably just the first
SemanticJsVariableDeclaration
.8 - We change the "unusedVariable" lint rule to query for the type semantic tree.
Tasks
The text was updated successfully, but these errors were encountered: