Make AST immutable to allow for multi-file support#842
Open
huydo862003 wants to merge 28 commits intomasterfrom
Open
Make AST immutable to allow for multi-file support#842huydo862003 wants to merge 28 commits intomasterfrom
huydo862003 wants to merge 28 commits intomasterfrom
Conversation
ff5272c to
1627dcb
Compare
42b4ee9 to
7b72e6e
Compare
7b72e6e to
3e3e473
Compare
b4e7f6a to
632bc32
Compare
…wrap results in objects
f2d9f74 to
ad58955
Compare
…), utility methods (resolvedSymbol, nodeReferee, nodeReferences), simplify tests
…t, refsOf — inline args and return CompileError[] directly
… remove parse.nodeToReferee query
…utils with compiler-first arg
…Symbol, move extractReferee to services/utils
Coverage ReportCommit: c0f4ee5 Overall Coverage
Package Coverage
|
| File | Lines | Statements | Functions | Branches |
|---|---|---|---|---|
src/connectors/bigquery/index.ts |
0.00% | 0.00% | 0.00% | 0.00% |
src/utils/credential-loader.ts |
0.00% | 0.00% | 0.00% | 0.00% |
src/utils/helpers.ts |
0.00% | 0.00% | 0.00% | 0.00% |
src/connectors/snowflake/index.ts |
10.56% | 10.31% | 0.00% | 0.00% |
src/utils/parseSchema.ts |
46.15% | 42.85% | 28.57% | 27.27% |
src/connectors/connector.ts |
66.66% | 66.66% | 100.00% | 57.14% |
src/connectors/oracle/tables.ts |
71.25% | 67.39% | 100.00% | 56.96% |
src/connectors/oracle/index.ts |
80.00% | 80.76% | 100.00% | 25.00% |
src/connectors/oracle/utils.ts |
85.71% | 85.71% | 100.00% | 71.42% |
@dbml/dbml-parse
41 file(s) below 80% coverage
| File | Lines | Statements | Functions | Branches |
|---|---|---|---|---|
src/compiler/queries/container/scope.ts |
0.00% | 0.00% | 0.00% | 0.00% |
src/services/diagnostics/provider.ts |
0.00% | 0.00% | 0.00% | 0.00% |
src/core/interpreter/elementInterpreter/project.ts |
52.77% | 52.77% | 100.00% | 36.36% |
src/core/interpreter/records/utils/data/sqlTypes.ts |
56.25% | 58.82% | 75.00% | 46.55% |
src/core/analyzer/symbol/utils.ts |
56.52% | 56.52% | 100.00% | 50.00% |
src/compiler/queries/parse.ts |
57.14% | 57.14% | 50.00% | 100.00% |
src/core/analyzer/binder/elementBinder/note.ts |
62.50% | 64.70% | 83.33% | 50.00% |
src/compiler/queries/utils.ts |
64.83% | 65.95% | 88.88% | 47.43% |
src/core/interpreter/records/utils/data/values.ts |
65.13% | 57.14% | 72.72% | 50.37% |
src/compiler/queries/token.ts |
66.66% | 66.66% | 66.66% | 100.00% |
src/core/analyzer/binder/elementBinder/enum.ts |
66.66% | 68.42% | 100.00% | 50.00% |
src/core/analyzer/validator/elementValidators/indexes.ts |
72.00% | 74.07% | 90.90% | 57.69% |
src/core/analyzer/validator/elementValidators/note.ts |
74.50% | 72.72% | 76.92% | 68.75% |
src/core/analyzer/analyzer.ts |
76.92% | 73.33% | 71.42% | 0.00% |
src/core/analyzer/symbol/symbolIndex.ts |
76.92% | 77.50% | 92.85% | 50.00% |
src/core/analyzer/binder/elementBinder/project.ts |
77.77% | 78.94% | 100.00% | 50.00% |
src/core/analyzer/validator/elementValidators/project.ts |
78.12% | 78.78% | 100.00% | 56.25% |
src/core/utils.ts |
78.57% | 77.41% | 80.00% | 60.71% |
src/core/analyzer/utils.ts |
78.64% | 77.88% | 88.23% | 79.34% |
src/core/analyzer/binder/elementBinder/ref.ts |
78.78% | 80.00% | 90.90% | 75.00% |
src/core/analyzer/validator/elementValidators/records.ts |
79.45% | 80.00% | 93.75% | 74.19% |
src/core/analyzer/binder/elementBinder/indexes.ts |
79.54% | 78.26% | 90.90% | 68.18% |
src/core/analyzer/validator/elementValidators/checks.ts |
79.62% | 81.03% | 93.75% | 71.87% |
src/core/analyzer/binder/elementBinder/tableGroup.ts |
80.00% | 80.64% | 100.00% | 50.00% |
src/services/utils.ts |
80.00% | 66.66% | 100.00% | 50.00% |
src/services/suggestions/utils.ts |
80.39% | 75.00% | 92.85% | 68.51% |
src/core/interpreter/records/utils/constraints/pk.ts |
82.00% | 80.00% | 92.30% | 54.54% |
src/core/analyzer/binder/elementBinder/records.ts |
82.97% | 83.50% | 93.75% | 71.42% |
src/compiler/queries/container/token.ts |
83.33% | 85.71% | 100.00% | 75.00% |
src/core/interpreter/elementInterpreter/tablePartial.ts |
83.33% | 82.40% | 84.00% | 77.27% |
src/core/analyzer/validator/elementValidators/tablePartial.ts |
83.52% | 80.82% | 87.23% | 64.28% |
src/core/analyzer/validator/elementValidators/enum.ts |
85.05% | 83.51% | 84.21% | 78.26% |
src/core/analyzer/binder/elementBinder/tablePartial.ts |
86.00% | 86.53% | 100.00% | 69.23% |
src/core/parser/parser.ts |
87.27% | 87.42% | 100.00% | 79.62% |
src/services/suggestions/recordRowSnippet.ts |
88.67% | 84.61% | 100.00% | 78.00% |
src/compiler/queries/symbol.ts |
91.66% | 92.30% | 100.00% | 78.57% |
__tests__/utils/compiler.ts |
93.13% | 92.80% | 100.00% | 68.13% |
src/core/interpreter/elementInterpreter/sticky_note.ts |
95.23% | 95.45% | 100.00% | 66.66% |
src/core/interpreter/records/utils/constraints/unique.ts |
96.15% | 93.93% | 100.00% | 66.66% |
src/core/analyzer/symbol/symbolTable.ts |
100.00% | 100.00% | 100.00% | 75.00% |
src/services/definition/provider.ts |
100.00% | 94.11% | 100.00% | 70.00% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
SyntaxNode.parentright in parser instead of in validator.-> ASTs become immutable after their phase -> re-binding one file no longer touches others
Problem
SyntaxNode.symbol,.refereesSyntaxNode.symbolandSyntaxNode.refereesbecome outdated. Since these are attached to the parser results, re-binding must force full re-parse of everything.