spark-sql-language-server 0.0.1-beta.6 → 0.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/sparksql-server-worker.js +1 -1
- package/out/sparksql-server-worker.js.map +1 -1
- package/out-tsc/assets/built-in-functions.d.ts +2 -0
- package/out-tsc/assets/built-in-functions.d.ts.map +1 -0
- package/out-tsc/assets/built-in-functions.js +4 -2
- package/out-tsc/assets/built-in-functions.js.map +1 -1
- package/out-tsc/completion-parser.d.ts +11 -0
- package/out-tsc/completion-parser.d.ts.map +1 -0
- package/out-tsc/completion-parser.js +148 -0
- package/out-tsc/completion-parser.js.map +1 -0
- package/out-tsc/constants.d.ts +9 -0
- package/out-tsc/constants.d.ts.map +1 -0
- package/out-tsc/constants.js +12 -0
- package/out-tsc/constants.js.map +1 -0
- package/out-tsc/cursor.d.ts +10 -0
- package/out-tsc/cursor.d.ts.map +1 -0
- package/out-tsc/cursor.js +3 -0
- package/out-tsc/cursor.js.map +1 -1
- package/out-tsc/execute-command.d.ts +7 -0
- package/out-tsc/execute-command.d.ts.map +1 -0
- package/out-tsc/execute-command.js +78 -0
- package/out-tsc/execute-command.js.map +1 -0
- package/out-tsc/execute-commands.d.ts +1 -0
- package/out-tsc/execute-commands.d.ts.map +1 -0
- package/out-tsc/execute-commands.js +3 -4
- package/out-tsc/execute-commands.js.map +1 -1
- package/out-tsc/formatter/boundary-writer.d.ts +30 -0
- package/out-tsc/formatter/boundary-writer.d.ts.map +1 -0
- package/out-tsc/formatter/boundary-writer.js +47 -0
- package/out-tsc/formatter/boundary-writer.js.map +1 -0
- package/out-tsc/formatter/core/comment-helper.d.ts +11 -0
- package/out-tsc/formatter/core/comment-helper.d.ts.map +1 -0
- package/out-tsc/formatter/core/comment-helper.js +139 -0
- package/out-tsc/formatter/core/comment-helper.js.map +1 -0
- package/out-tsc/formatter/core/edit-collector.d.ts +110 -0
- package/out-tsc/formatter/core/edit-collector.d.ts.map +1 -0
- package/out-tsc/formatter/core/edit-collector.js +159 -0
- package/out-tsc/formatter/core/edit-collector.js.map +1 -0
- package/out-tsc/formatter/core/formatting-context.d.ts +183 -0
- package/out-tsc/formatter/core/formatting-context.d.ts.map +1 -0
- package/out-tsc/formatter/core/formatting-context.js +294 -0
- package/out-tsc/formatter/core/formatting-context.js.map +1 -0
- package/out-tsc/formatter/core/index.d.ts +25 -0
- package/out-tsc/formatter/core/index.d.ts.map +1 -0
- package/out-tsc/formatter/core/index.js +57 -0
- package/out-tsc/formatter/core/index.js.map +1 -0
- package/out-tsc/formatter/core/pipeline/formatting-pipeline.d.ts +116 -0
- package/out-tsc/formatter/core/pipeline/formatting-pipeline.d.ts.map +1 -0
- package/out-tsc/formatter/core/pipeline/formatting-pipeline.js +237 -0
- package/out-tsc/formatter/core/pipeline/formatting-pipeline.js.map +1 -0
- package/out-tsc/formatter/core/pipeline/index.d.ts +12 -0
- package/out-tsc/formatter/core/pipeline/index.d.ts.map +1 -0
- package/out-tsc/formatter/core/pipeline/index.js +19 -0
- package/out-tsc/formatter/core/pipeline/index.js.map +1 -0
- package/out-tsc/formatter/core/pipeline/statement-separation.d.ts +5 -0
- package/out-tsc/formatter/core/pipeline/statement-separation.d.ts.map +1 -0
- package/out-tsc/formatter/core/pipeline/statement-separation.js +149 -0
- package/out-tsc/formatter/core/pipeline/statement-separation.js.map +1 -0
- package/out-tsc/formatter/core/rules/index.d.ts +11 -0
- package/out-tsc/formatter/core/rules/index.d.ts.map +1 -0
- package/out-tsc/formatter/core/rules/index.js +29 -0
- package/out-tsc/formatter/core/rules/index.js.map +1 -0
- package/out-tsc/formatter/core/rules/newline-rules.d.ts +169 -0
- package/out-tsc/formatter/core/rules/newline-rules.d.ts.map +1 -0
- package/out-tsc/formatter/core/rules/newline-rules.js +246 -0
- package/out-tsc/formatter/core/rules/newline-rules.js.map +1 -0
- package/out-tsc/formatter/core/rules/spacing-rules.d.ts +150 -0
- package/out-tsc/formatter/core/rules/spacing-rules.d.ts.map +1 -0
- package/out-tsc/formatter/core/rules/spacing-rules.js +219 -0
- package/out-tsc/formatter/core/rules/spacing-rules.js.map +1 -0
- package/out-tsc/formatter/core/strategy-bridge.d.ts +56 -0
- package/out-tsc/formatter/core/strategy-bridge.d.ts.map +1 -0
- package/out-tsc/formatter/core/strategy-bridge.js +159 -0
- package/out-tsc/formatter/core/strategy-bridge.js.map +1 -0
- package/out-tsc/formatter/core/strategy-interface.d.ts +123 -0
- package/out-tsc/formatter/core/strategy-interface.d.ts.map +1 -0
- package/out-tsc/formatter/core/strategy-interface.js +83 -0
- package/out-tsc/formatter/core/strategy-interface.js.map +1 -0
- package/out-tsc/formatter/core/token-helper.d.ts +12 -0
- package/out-tsc/formatter/core/token-helper.d.ts.map +1 -0
- package/out-tsc/formatter/core/token-helper.js +79 -0
- package/out-tsc/formatter/core/token-helper.js.map +1 -0
- package/out-tsc/formatter/core/unicode-utils.d.ts +107 -0
- package/out-tsc/formatter/core/unicode-utils.d.ts.map +1 -0
- package/out-tsc/formatter/core/unicode-utils.js +181 -0
- package/out-tsc/formatter/core/unicode-utils.js.map +1 -0
- package/out-tsc/formatter/core/whitespace-writer.d.ts +20 -0
- package/out-tsc/formatter/core/whitespace-writer.d.ts.map +1 -0
- package/out-tsc/formatter/core/whitespace-writer.js +86 -0
- package/out-tsc/formatter/core/whitespace-writer.js.map +1 -0
- package/out-tsc/formatter/formatter-adapter.d.ts +56 -0
- package/out-tsc/formatter/formatter-adapter.d.ts.map +1 -0
- package/out-tsc/formatter/formatter-adapter.js +719 -0
- package/out-tsc/formatter/formatter-adapter.js.map +1 -0
- package/out-tsc/formatter/index.d.ts +16 -0
- package/out-tsc/formatter/index.d.ts.map +1 -0
- package/out-tsc/formatter/index.js +43 -0
- package/out-tsc/formatter/index.js.map +1 -0
- package/out-tsc/formatter/pipe-step-classifier.d.ts +9 -0
- package/out-tsc/formatter/pipe-step-classifier.d.ts.map +1 -0
- package/out-tsc/formatter/pipe-step-classifier.js +49 -0
- package/out-tsc/formatter/pipe-step-classifier.js.map +1 -0
- package/out-tsc/formatter/state.d.ts +10 -0
- package/out-tsc/formatter/state.d.ts.map +1 -0
- package/out-tsc/formatter/state.js +12 -0
- package/out-tsc/formatter/state.js.map +1 -0
- package/out-tsc/formatter/strategies/block.strategy.d.ts +191 -0
- package/out-tsc/formatter/strategies/block.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/block.strategy.js +238 -0
- package/out-tsc/formatter/strategies/block.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/clause-head-body.strategy.d.ts +17 -0
- package/out-tsc/formatter/strategies/clause-head-body.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/clause-head-body.strategy.js +13 -0
- package/out-tsc/formatter/strategies/clause-head-body.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/alter-table-extended.strategy.d.ts +68 -0
- package/out-tsc/formatter/strategies/ddl/alter-table-extended.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/alter-table-extended.strategy.js +242 -0
- package/out-tsc/formatter/strategies/ddl/alter-table-extended.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/alter-table.strategy.d.ts +146 -0
- package/out-tsc/formatter/strategies/ddl/alter-table.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/alter-table.strategy.js +578 -0
- package/out-tsc/formatter/strategies/ddl/alter-table.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/create-table.strategy.d.ts +103 -0
- package/out-tsc/formatter/strategies/ddl/create-table.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/create-table.strategy.js +659 -0
- package/out-tsc/formatter/strategies/ddl/create-table.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/create-view-function.strategy.d.ts +64 -0
- package/out-tsc/formatter/strategies/ddl/create-view-function.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/create-view-function.strategy.js +402 -0
- package/out-tsc/formatter/strategies/ddl/create-view-function.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/drop-utility.strategy.d.ts +119 -0
- package/out-tsc/formatter/strategies/ddl/drop-utility.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/drop-utility.strategy.js +863 -0
- package/out-tsc/formatter/strategies/ddl/drop-utility.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/index.d.ts +17 -0
- package/out-tsc/formatter/strategies/ddl/index.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/index.js +57 -0
- package/out-tsc/formatter/strategies/ddl/index.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/namespace-catalog.strategy.d.ts +26 -0
- package/out-tsc/formatter/strategies/ddl/namespace-catalog.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/namespace-catalog.strategy.js +77 -0
- package/out-tsc/formatter/strategies/ddl/namespace-catalog.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/pipeline.strategy.d.ts +99 -0
- package/out-tsc/formatter/strategies/ddl/pipeline.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/pipeline.strategy.js +385 -0
- package/out-tsc/formatter/strategies/ddl/pipeline.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/set-reset-config.strategy.d.ts +48 -0
- package/out-tsc/formatter/strategies/ddl/set-reset-config.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/set-reset-config.strategy.js +145 -0
- package/out-tsc/formatter/strategies/ddl/set-reset-config.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/ddl/show-utility.strategy.d.ts +71 -0
- package/out-tsc/formatter/strategies/ddl/show-utility.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/ddl/show-utility.strategy.js +196 -0
- package/out-tsc/formatter/strategies/ddl/show-utility.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/dml/index.d.ts +10 -0
- package/out-tsc/formatter/strategies/dml/index.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/dml/index.js +35 -0
- package/out-tsc/formatter/strategies/dml/index.js.map +1 -0
- package/out-tsc/formatter/strategies/dml/insert-update-delete.strategy.d.ts +113 -0
- package/out-tsc/formatter/strategies/dml/insert-update-delete.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/dml/insert-update-delete.strategy.js +438 -0
- package/out-tsc/formatter/strategies/dml/insert-update-delete.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/dml/select-clause.strategy.d.ts +76 -0
- package/out-tsc/formatter/strategies/dml/select-clause.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/dml/select-clause.strategy.js +480 -0
- package/out-tsc/formatter/strategies/dml/select-clause.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/expression/function-call.strategy.d.ts +50 -0
- package/out-tsc/formatter/strategies/expression/function-call.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/expression/function-call.strategy.js +319 -0
- package/out-tsc/formatter/strategies/expression/function-call.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/expression/index.d.ts +18 -0
- package/out-tsc/formatter/strategies/expression/index.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/expression/index.js +51 -0
- package/out-tsc/formatter/strategies/expression/index.js.map +1 -0
- package/out-tsc/formatter/strategies/expression/logical-comparison.strategy.d.ts +55 -0
- package/out-tsc/formatter/strategies/expression/logical-comparison.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/expression/logical-comparison.strategy.js +266 -0
- package/out-tsc/formatter/strategies/expression/logical-comparison.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/expression/subquery-parenthesis.strategy.d.ts +38 -0
- package/out-tsc/formatter/strategies/expression/subquery-parenthesis.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/expression/subquery-parenthesis.strategy.js +397 -0
- package/out-tsc/formatter/strategies/expression/subquery-parenthesis.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/function-call.strategy.d.ts +80 -0
- package/out-tsc/formatter/strategies/function-call.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/function-call.strategy.js +136 -0
- package/out-tsc/formatter/strategies/function-call.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/index.d.ts +87 -0
- package/out-tsc/formatter/strategies/index.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/index.js +121 -0
- package/out-tsc/formatter/strategies/index.js.map +1 -0
- package/out-tsc/formatter/strategies/join.strategy.d.ts +31 -0
- package/out-tsc/formatter/strategies/join.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/join.strategy.js +29 -0
- package/out-tsc/formatter/strategies/join.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/keyword.strategy.d.ts +82 -0
- package/out-tsc/formatter/strategies/keyword.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/keyword.strategy.js +129 -0
- package/out-tsc/formatter/strategies/keyword.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/list.strategy.d.ts +159 -0
- package/out-tsc/formatter/strategies/list.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/list.strategy.js +193 -0
- package/out-tsc/formatter/strategies/list.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-aggregate.strategy.d.ts +24 -0
- package/out-tsc/formatter/strategies/pipe-aggregate.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-aggregate.strategy.js +47 -0
- package/out-tsc/formatter/strategies/pipe-aggregate.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-drop.strategy.d.ts +21 -0
- package/out-tsc/formatter/strategies/pipe-drop.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-drop.strategy.js +52 -0
- package/out-tsc/formatter/strategies/pipe-drop.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-extend.strategy.d.ts +21 -0
- package/out-tsc/formatter/strategies/pipe-extend.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-extend.strategy.js +45 -0
- package/out-tsc/formatter/strategies/pipe-extend.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-join.strategy.d.ts +22 -0
- package/out-tsc/formatter/strategies/pipe-join.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-join.strategy.js +42 -0
- package/out-tsc/formatter/strategies/pipe-join.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-pivot.strategy.d.ts +7 -0
- package/out-tsc/formatter/strategies/pipe-pivot.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-pivot.strategy.js +34 -0
- package/out-tsc/formatter/strategies/pipe-pivot.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-query-organization.strategy.d.ts +7 -0
- package/out-tsc/formatter/strategies/pipe-query-organization.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-query-organization.strategy.js +14 -0
- package/out-tsc/formatter/strategies/pipe-query-organization.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-sample.strategy.d.ts +7 -0
- package/out-tsc/formatter/strategies/pipe-sample.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-sample.strategy.js +18 -0
- package/out-tsc/formatter/strategies/pipe-sample.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-select.strategy.d.ts +22 -0
- package/out-tsc/formatter/strategies/pipe-select.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-select.strategy.js +51 -0
- package/out-tsc/formatter/strategies/pipe-select.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-set-operation.strategy.d.ts +7 -0
- package/out-tsc/formatter/strategies/pipe-set-operation.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-set-operation.strategy.js +30 -0
- package/out-tsc/formatter/strategies/pipe-set-operation.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-set.strategy.d.ts +21 -0
- package/out-tsc/formatter/strategies/pipe-set.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-set.strategy.js +52 -0
- package/out-tsc/formatter/strategies/pipe-set.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-step.strategy.d.ts +25 -0
- package/out-tsc/formatter/strategies/pipe-step.strategy.d.ts.map +1 -0
- package/out-tsc/{lib/SparkSqlParserVisitor.js → formatter/strategies/pipe-step.strategy.js} +1 -1
- package/out-tsc/formatter/strategies/pipe-step.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-unpivot.strategy.d.ts +7 -0
- package/out-tsc/formatter/strategies/pipe-unpivot.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-unpivot.strategy.js +33 -0
- package/out-tsc/formatter/strategies/pipe-unpivot.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/pipe-where.strategy.d.ts +21 -0
- package/out-tsc/formatter/strategies/pipe-where.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/pipe-where.strategy.js +44 -0
- package/out-tsc/formatter/strategies/pipe-where.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/case-statement.strategy.d.ts +20 -0
- package/out-tsc/formatter/strategies/procedure/case-statement.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/case-statement.strategy.js +132 -0
- package/out-tsc/formatter/strategies/procedure/case-statement.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/compound-statement.strategy.d.ts +43 -0
- package/out-tsc/formatter/strategies/procedure/compound-statement.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/compound-statement.strategy.js +174 -0
- package/out-tsc/formatter/strategies/procedure/compound-statement.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/handler.strategy.d.ts +23 -0
- package/out-tsc/formatter/strategies/procedure/handler.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/handler.strategy.js +81 -0
- package/out-tsc/formatter/strategies/procedure/handler.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/if-else.strategy.d.ts +19 -0
- package/out-tsc/formatter/strategies/procedure/if-else.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/if-else.strategy.js +80 -0
- package/out-tsc/formatter/strategies/procedure/if-else.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/index.d.ts +27 -0
- package/out-tsc/formatter/strategies/procedure/index.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/index.js +63 -0
- package/out-tsc/formatter/strategies/procedure/index.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/leave-iterate.strategy.d.ts +19 -0
- package/out-tsc/formatter/strategies/procedure/leave-iterate.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/leave-iterate.strategy.js +54 -0
- package/out-tsc/formatter/strategies/procedure/leave-iterate.strategy.js.map +1 -0
- package/out-tsc/formatter/strategies/procedure/loop.strategy.d.ts +71 -0
- package/out-tsc/formatter/strategies/procedure/loop.strategy.d.ts.map +1 -0
- package/out-tsc/formatter/strategies/procedure/loop.strategy.js +216 -0
- package/out-tsc/formatter/strategies/procedure/loop.strategy.js.map +1 -0
- package/out-tsc/formatter/strategy-based-formatter.d.ts +329 -0
- package/out-tsc/formatter/strategy-based-formatter.d.ts.map +1 -0
- package/out-tsc/formatter/strategy-based-formatter.js +3808 -0
- package/out-tsc/formatter/strategy-based-formatter.js.map +1 -0
- package/out-tsc/formatter/strategy-dispatcher.d.ts +24 -0
- package/out-tsc/formatter/strategy-dispatcher.d.ts.map +1 -0
- package/out-tsc/formatter/strategy-dispatcher.js +19 -0
- package/out-tsc/formatter/strategy-dispatcher.js.map +1 -0
- package/out-tsc/formatter/types.d.ts +2 -0
- package/out-tsc/formatter/types.d.ts.map +1 -0
- package/out-tsc/{lib/SparkSqlParserListener.js → formatter/types.js} +1 -1
- package/out-tsc/formatter/types.js.map +1 -0
- package/out-tsc/formatter/visitor/ddl/alter-table.d.ts +48 -0
- package/out-tsc/formatter/visitor/ddl/alter-table.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/ddl/alter-table.js +133 -0
- package/out-tsc/formatter/visitor/ddl/alter-table.js.map +1 -0
- package/out-tsc/formatter/visitor/ddl/create-table.d.ts +54 -0
- package/out-tsc/formatter/visitor/ddl/create-table.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/ddl/create-table.js +142 -0
- package/out-tsc/formatter/visitor/ddl/create-table.js.map +1 -0
- package/out-tsc/formatter/visitor/ddl/create-view.d.ts +27 -0
- package/out-tsc/formatter/visitor/ddl/create-view.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/ddl/create-view.js +61 -0
- package/out-tsc/formatter/visitor/ddl/create-view.js.map +1 -0
- package/out-tsc/formatter/visitor/ddl/drop.d.ts +30 -0
- package/out-tsc/formatter/visitor/ddl/drop.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/ddl/drop.js +69 -0
- package/out-tsc/formatter/visitor/ddl/drop.js.map +1 -0
- package/out-tsc/formatter/visitor/ddl/index.d.ts +10 -0
- package/out-tsc/formatter/visitor/ddl/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/ddl/index.js +26 -0
- package/out-tsc/formatter/visitor/ddl/index.js.map +1 -0
- package/out-tsc/formatter/visitor/dml/delete.d.ts +26 -0
- package/out-tsc/formatter/visitor/dml/delete.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/dml/delete.js +38 -0
- package/out-tsc/formatter/visitor/dml/delete.js.map +1 -0
- package/out-tsc/formatter/visitor/dml/index.d.ts +10 -0
- package/out-tsc/formatter/visitor/dml/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/dml/index.js +26 -0
- package/out-tsc/formatter/visitor/dml/index.js.map +1 -0
- package/out-tsc/formatter/visitor/dml/insert.d.ts +42 -0
- package/out-tsc/formatter/visitor/dml/insert.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/dml/insert.js +112 -0
- package/out-tsc/formatter/visitor/dml/insert.js.map +1 -0
- package/out-tsc/formatter/visitor/dml/merge.d.ts +40 -0
- package/out-tsc/formatter/visitor/dml/merge.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/dml/merge.js +67 -0
- package/out-tsc/formatter/visitor/dml/merge.js.map +1 -0
- package/out-tsc/formatter/visitor/dml/update.d.ts +33 -0
- package/out-tsc/formatter/visitor/dml/update.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/dml/update.js +49 -0
- package/out-tsc/formatter/visitor/dml/update.js.map +1 -0
- package/out-tsc/formatter/visitor/expression/arithmetic.d.ts +20 -0
- package/out-tsc/formatter/visitor/expression/arithmetic.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/expression/arithmetic.js +44 -0
- package/out-tsc/formatter/visitor/expression/arithmetic.js.map +1 -0
- package/out-tsc/formatter/visitor/expression/case-when.d.ts +41 -0
- package/out-tsc/formatter/visitor/expression/case-when.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/expression/case-when.js +94 -0
- package/out-tsc/formatter/visitor/expression/case-when.js.map +1 -0
- package/out-tsc/formatter/visitor/expression/comparison.d.ts +20 -0
- package/out-tsc/formatter/visitor/expression/comparison.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/expression/comparison.js +26 -0
- package/out-tsc/formatter/visitor/expression/comparison.js.map +1 -0
- package/out-tsc/formatter/visitor/expression/function-call.d.ts +20 -0
- package/out-tsc/formatter/visitor/expression/function-call.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/expression/function-call.js +33 -0
- package/out-tsc/formatter/visitor/expression/function-call.js.map +1 -0
- package/out-tsc/formatter/visitor/expression/index.d.ts +11 -0
- package/out-tsc/formatter/visitor/expression/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/expression/index.js +27 -0
- package/out-tsc/formatter/visitor/expression/index.js.map +1 -0
- package/out-tsc/formatter/visitor/expression/logical.d.ts +26 -0
- package/out-tsc/formatter/visitor/expression/logical.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/expression/logical.js +46 -0
- package/out-tsc/formatter/visitor/expression/logical.js.map +1 -0
- package/out-tsc/formatter/visitor/formatter-core.d.ts +79 -0
- package/out-tsc/formatter/visitor/formatter-core.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/formatter-core.js +211 -0
- package/out-tsc/formatter/visitor/formatter-core.js.map +1 -0
- package/out-tsc/formatter/visitor/index.d.ts +21 -0
- package/out-tsc/formatter/visitor/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/index.js +26 -0
- package/out-tsc/formatter/visitor/index.js.map +1 -0
- package/out-tsc/formatter/visitor/management/cache.d.ts +26 -0
- package/out-tsc/formatter/visitor/management/cache.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/management/cache.js +58 -0
- package/out-tsc/formatter/visitor/management/cache.js.map +1 -0
- package/out-tsc/formatter/visitor/management/index.d.ts +8 -0
- package/out-tsc/formatter/visitor/management/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/management/index.js +24 -0
- package/out-tsc/formatter/visitor/management/index.js.map +1 -0
- package/out-tsc/formatter/visitor/management/refresh.d.ts +26 -0
- package/out-tsc/formatter/visitor/management/refresh.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/management/refresh.js +55 -0
- package/out-tsc/formatter/visitor/management/refresh.js.map +1 -0
- package/out-tsc/formatter/visitor/pipeline/delta-live-tables.d.ts +31 -0
- package/out-tsc/formatter/visitor/pipeline/delta-live-tables.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/pipeline/delta-live-tables.js +46 -0
- package/out-tsc/formatter/visitor/pipeline/delta-live-tables.js.map +1 -0
- package/out-tsc/formatter/visitor/pipeline/index.d.ts +7 -0
- package/out-tsc/formatter/visitor/pipeline/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/pipeline/index.js +23 -0
- package/out-tsc/formatter/visitor/pipeline/index.js.map +1 -0
- package/out-tsc/formatter/visitor/query/cte.d.ts +34 -0
- package/out-tsc/formatter/visitor/query/cte.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/query/cte.js +54 -0
- package/out-tsc/formatter/visitor/query/cte.js.map +1 -0
- package/out-tsc/formatter/visitor/query/index.d.ts +11 -0
- package/out-tsc/formatter/visitor/query/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/query/index.js +27 -0
- package/out-tsc/formatter/visitor/query/index.js.map +1 -0
- package/out-tsc/formatter/visitor/query/query-organization.d.ts +25 -0
- package/out-tsc/formatter/visitor/query/query-organization.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/query/query-organization.js +75 -0
- package/out-tsc/formatter/visitor/query/query-organization.js.map +1 -0
- package/out-tsc/formatter/visitor/query/query.d.ts +22 -0
- package/out-tsc/formatter/visitor/query/query.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/query/query.js +30 -0
- package/out-tsc/formatter/visitor/query/query.js.map +1 -0
- package/out-tsc/formatter/visitor/query/select-clause.d.ts +17 -0
- package/out-tsc/formatter/visitor/query/select-clause.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/query/select-clause.js +35 -0
- package/out-tsc/formatter/visitor/query/select-clause.js.map +1 -0
- package/out-tsc/formatter/visitor/query/set-operation.d.ts +25 -0
- package/out-tsc/formatter/visitor/query/set-operation.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/query/set-operation.js +52 -0
- package/out-tsc/formatter/visitor/query/set-operation.js.map +1 -0
- package/out-tsc/formatter/visitor/statements/index.d.ts +7 -0
- package/out-tsc/formatter/visitor/statements/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/statements/index.js +23 -0
- package/out-tsc/formatter/visitor/statements/index.js.map +1 -0
- package/out-tsc/formatter/visitor/statements/program.d.ts +33 -0
- package/out-tsc/formatter/visitor/statements/program.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/statements/program.js +69 -0
- package/out-tsc/formatter/visitor/statements/program.js.map +1 -0
- package/out-tsc/formatter/visitor/types/complex-types.d.ts +24 -0
- package/out-tsc/formatter/visitor/types/complex-types.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/types/complex-types.js +47 -0
- package/out-tsc/formatter/visitor/types/complex-types.js.map +1 -0
- package/out-tsc/formatter/visitor/types/index.d.ts +8 -0
- package/out-tsc/formatter/visitor/types/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/types/index.js +24 -0
- package/out-tsc/formatter/visitor/types/index.js.map +1 -0
- package/out-tsc/formatter/visitor/types/primitive-types.d.ts +22 -0
- package/out-tsc/formatter/visitor/types/primitive-types.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/types/primitive-types.js +37 -0
- package/out-tsc/formatter/visitor/types/primitive-types.js.map +1 -0
- package/out-tsc/formatter/visitor/utils/context-helpers.d.ts +32 -0
- package/out-tsc/formatter/visitor/utils/context-helpers.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/utils/context-helpers.js +98 -0
- package/out-tsc/formatter/visitor/utils/context-helpers.js.map +1 -0
- package/out-tsc/formatter/visitor/utils/index.d.ts +11 -0
- package/out-tsc/formatter/visitor/utils/index.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/utils/index.js +45 -0
- package/out-tsc/formatter/visitor/utils/index.js.map +1 -0
- package/out-tsc/formatter/visitor/utils/keyword-formatting.d.ts +57 -0
- package/out-tsc/formatter/visitor/utils/keyword-formatting.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/utils/keyword-formatting.js +87 -0
- package/out-tsc/formatter/visitor/utils/keyword-formatting.js.map +1 -0
- package/out-tsc/formatter/visitor/utils/parenthesis-formatting.d.ts +53 -0
- package/out-tsc/formatter/visitor/utils/parenthesis-formatting.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/utils/parenthesis-formatting.js +88 -0
- package/out-tsc/formatter/visitor/utils/parenthesis-formatting.js.map +1 -0
- package/out-tsc/formatter/visitor/utils/space-compression.d.ts +55 -0
- package/out-tsc/formatter/visitor/utils/space-compression.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/utils/space-compression.js +71 -0
- package/out-tsc/formatter/visitor/utils/space-compression.js.map +1 -0
- package/out-tsc/formatter/visitor/utils/token-helpers.d.ts +64 -0
- package/out-tsc/formatter/visitor/utils/token-helpers.d.ts.map +1 -0
- package/out-tsc/formatter/visitor/utils/token-helpers.js +249 -0
- package/out-tsc/formatter/visitor/utils/token-helpers.js.map +1 -0
- package/out-tsc/index.d.ts +2 -1
- package/out-tsc/index.d.ts.map +1 -0
- package/out-tsc/index.js +3 -1
- package/out-tsc/index.js.map +1 -1
- package/out-tsc/lib/SparkSQLLexer.d.ts +557 -0
- package/out-tsc/lib/SparkSQLLexer.d.ts.map +1 -0
- package/out-tsc/lib/SparkSQLLexer.js +3676 -0
- package/out-tsc/lib/SparkSQLLexer.js.map +1 -0
- package/out-tsc/lib/SparkSQLParser.d.ts +7884 -0
- package/out-tsc/lib/SparkSQLParser.d.ts.map +1 -0
- package/out-tsc/lib/SparkSQLParser.js +45848 -0
- package/out-tsc/lib/SparkSQLParser.js.map +1 -0
- package/out-tsc/lib/SparkSQLParserListener.d.ts +5855 -0
- package/out-tsc/lib/SparkSQLParserListener.d.ts.map +1 -0
- package/out-tsc/lib/SparkSQLParserListener.js +4 -0
- package/out-tsc/lib/SparkSQLParserListener.js.map +1 -0
- package/out-tsc/lib/SparkSQLParserVisitor.d.ts +3674 -0
- package/out-tsc/lib/SparkSQLParserVisitor.d.ts.map +1 -0
- package/out-tsc/lib/SparkSQLParserVisitor.js +4 -0
- package/out-tsc/lib/SparkSQLParserVisitor.js.map +1 -0
- package/out-tsc/lineage.typing.d.ts +64 -0
- package/out-tsc/lineage.typing.d.ts.map +1 -0
- package/out-tsc/lineage.typing.js +3 -0
- package/out-tsc/lineage.typing.js.map +1 -0
- package/out-tsc/listeners/parse-error.listener.d.ts +3 -2
- package/out-tsc/listeners/parse-error.listener.d.ts.map +1 -0
- package/out-tsc/listeners/parse-error.listener.js +4 -4
- package/out-tsc/listeners/parse-error.listener.js.map +1 -1
- package/out-tsc/listeners/schema.listener.d.ts +32 -39
- package/out-tsc/listeners/schema.listener.d.ts.map +1 -0
- package/out-tsc/listeners/schema.listener.js +58 -100
- package/out-tsc/listeners/schema.listener.js.map +1 -1
- package/out-tsc/listeners/statement.listener.d.ts +263 -5
- package/out-tsc/listeners/statement.listener.d.ts.map +1 -0
- package/out-tsc/listeners/statement.listener.js +836 -11
- package/out-tsc/listeners/statement.listener.js.map +1 -1
- package/out-tsc/listeners/structure.listener.d.ts +70 -0
- package/out-tsc/listeners/structure.listener.d.ts.map +1 -0
- package/out-tsc/listeners/structure.listener.js +211 -0
- package/out-tsc/listeners/structure.listener.js.map +1 -0
- package/out-tsc/listeners/tokens-collector.listener.d.ts +27 -0
- package/out-tsc/listeners/tokens-collector.listener.d.ts.map +1 -0
- package/out-tsc/listeners/tokens-collector.listener.js +102 -0
- package/out-tsc/listeners/tokens-collector.listener.js.map +1 -0
- package/out-tsc/lsp-server.d.ts +79 -8
- package/out-tsc/lsp-server.d.ts.map +1 -0
- package/out-tsc/lsp-server.js +672 -237
- package/out-tsc/lsp-server.js.map +1 -1
- package/out-tsc/metadata.typing.d.ts +1 -0
- package/out-tsc/metadata.typing.d.ts.map +1 -0
- package/out-tsc/monaco-config.d.ts +219 -0
- package/out-tsc/monaco-config.d.ts.map +1 -0
- package/out-tsc/monaco-config.js +1032 -0
- package/out-tsc/monaco-config.js.map +1 -0
- package/out-tsc/parsing-warehouse.d.ts +8 -3
- package/out-tsc/parsing-warehouse.d.ts.map +1 -0
- package/out-tsc/parsing-warehouse.js +62 -6
- package/out-tsc/parsing-warehouse.js.map +1 -1
- package/out-tsc/protocol-translation.d.ts +12 -5
- package/out-tsc/protocol-translation.d.ts.map +1 -0
- package/out-tsc/protocol-translation.js +72 -19
- package/out-tsc/protocol-translation.js.map +1 -1
- package/out-tsc/public-apis.d.ts +1 -0
- package/out-tsc/public-apis.d.ts.map +1 -0
- package/out-tsc/schema-registry.d.ts +10 -7
- package/out-tsc/schema-registry.d.ts.map +1 -0
- package/out-tsc/schema-registry.js +87 -106
- package/out-tsc/schema-registry.js.map +1 -1
- package/out-tsc/server-worker.d.ts +1 -0
- package/out-tsc/server-worker.d.ts.map +1 -0
- package/out-tsc/server-worker.js +159 -44
- package/out-tsc/server-worker.js.map +1 -1
- package/out-tsc/tests/folding/block-comment-folding.test.d.ts +7 -0
- package/out-tsc/tests/folding/block-comment-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/block-comment-folding.test.js +268 -0
- package/out-tsc/tests/folding/block-comment-folding.test.js.map +1 -0
- package/out-tsc/tests/folding/caching.test.d.ts +11 -0
- package/out-tsc/tests/folding/caching.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/caching.test.js +141 -0
- package/out-tsc/tests/folding/caching.test.js.map +1 -0
- package/out-tsc/tests/folding/cte-dependency-chain.test.d.ts +15 -0
- package/out-tsc/tests/folding/cte-dependency-chain.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/cte-dependency-chain.test.js +323 -0
- package/out-tsc/tests/folding/cte-dependency-chain.test.js.map +1 -0
- package/out-tsc/tests/folding/debug-format-flow.test.d.ts +2 -0
- package/out-tsc/tests/folding/debug-format-flow.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/debug-format-flow.test.js +114 -0
- package/out-tsc/tests/folding/debug-format-flow.test.js.map +1 -0
- package/out-tsc/tests/folding/debug-formatted.test.d.ts +2 -0
- package/out-tsc/tests/folding/debug-formatted.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/debug-formatted.test.js +175 -0
- package/out-tsc/tests/folding/debug-formatted.test.js.map +1 -0
- package/out-tsc/tests/folding/deduplication.test.d.ts +10 -0
- package/out-tsc/tests/folding/deduplication.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/deduplication.test.js +206 -0
- package/out-tsc/tests/folding/deduplication.test.js.map +1 -0
- package/out-tsc/tests/folding/edge-cases.test.d.ts +8 -0
- package/out-tsc/tests/folding/edge-cases.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/edge-cases.test.js +319 -0
- package/out-tsc/tests/folding/edge-cases.test.js.map +1 -0
- package/out-tsc/tests/folding/folding-level-config.test.d.ts +11 -0
- package/out-tsc/tests/folding/folding-level-config.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/folding-level-config.test.js +313 -0
- package/out-tsc/tests/folding/folding-level-config.test.js.map +1 -0
- package/out-tsc/tests/folding/folding-statistics.test.d.ts +13 -0
- package/out-tsc/tests/folding/folding-statistics.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/folding-statistics.test.js +144 -0
- package/out-tsc/tests/folding/folding-statistics.test.js.map +1 -0
- package/out-tsc/tests/folding/index.d.ts +8 -0
- package/out-tsc/tests/folding/index.d.ts.map +1 -0
- package/out-tsc/tests/folding/index.js +24 -0
- package/out-tsc/tests/folding/index.js.map +1 -0
- package/out-tsc/tests/folding/join-folding.test.d.ts +11 -0
- package/out-tsc/tests/folding/join-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/join-folding.test.js +167 -0
- package/out-tsc/tests/folding/join-folding.test.js.map +1 -0
- package/out-tsc/tests/folding/kind-classification.test.d.ts +11 -0
- package/out-tsc/tests/folding/kind-classification.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/kind-classification.test.js +270 -0
- package/out-tsc/tests/folding/kind-classification.test.js.map +1 -0
- package/out-tsc/tests/folding/level1-statement.test.d.ts +8 -0
- package/out-tsc/tests/folding/level1-statement.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/level1-statement.test.js +278 -0
- package/out-tsc/tests/folding/level1-statement.test.js.map +1 -0
- package/out-tsc/tests/folding/level2-query-block.test.d.ts +8 -0
- package/out-tsc/tests/folding/level2-query-block.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/level2-query-block.test.js +374 -0
- package/out-tsc/tests/folding/level2-query-block.test.js.map +1 -0
- package/out-tsc/tests/folding/level3-expression.test.d.ts +8 -0
- package/out-tsc/tests/folding/level3-expression.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/level3-expression.test.js +361 -0
- package/out-tsc/tests/folding/level3-expression.test.js.map +1 -0
- package/out-tsc/tests/folding/level4-structure.test.d.ts +8 -0
- package/out-tsc/tests/folding/level4-structure.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/level4-structure.test.js +270 -0
- package/out-tsc/tests/folding/level4-structure.test.js.map +1 -0
- package/out-tsc/tests/folding/line-comment-folding.test.d.ts +13 -0
- package/out-tsc/tests/folding/line-comment-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/line-comment-folding.test.js +215 -0
- package/out-tsc/tests/folding/line-comment-folding.test.js.map +1 -0
- package/out-tsc/tests/folding/nested-folding.test.d.ts +8 -0
- package/out-tsc/tests/folding/nested-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/nested-folding.test.js +386 -0
- package/out-tsc/tests/folding/nested-folding.test.js.map +1 -0
- package/out-tsc/tests/folding/performance-benchmark.test.d.ts +11 -0
- package/out-tsc/tests/folding/performance-benchmark.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/performance-benchmark.test.js +256 -0
- package/out-tsc/tests/folding/performance-benchmark.test.js.map +1 -0
- package/out-tsc/tests/folding/region-marker-folding.test.d.ts +11 -0
- package/out-tsc/tests/folding/region-marker-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/region-marker-folding.test.js +245 -0
- package/out-tsc/tests/folding/region-marker-folding.test.js.map +1 -0
- package/out-tsc/tests/folding/select-columns-folding.test.d.ts +10 -0
- package/out-tsc/tests/folding/select-columns-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/select-columns-folding.test.js +139 -0
- package/out-tsc/tests/folding/select-columns-folding.test.js.map +1 -0
- package/out-tsc/tests/folding/test-utils.d.ts +73 -0
- package/out-tsc/tests/folding/test-utils.d.ts.map +1 -0
- package/out-tsc/tests/folding/test-utils.js +98 -0
- package/out-tsc/tests/folding/test-utils.js.map +1 -0
- package/out-tsc/tests/folding/values-folding.test.d.ts +10 -0
- package/out-tsc/tests/folding/values-folding.test.d.ts.map +1 -0
- package/out-tsc/tests/folding/values-folding.test.js +102 -0
- package/out-tsc/tests/folding/values-folding.test.js.map +1 -0
- package/out-tsc/tests/format/ddl/datatype-constraint.test.d.ts +5 -0
- package/out-tsc/tests/format/ddl/datatype-constraint.test.d.ts.map +1 -0
- package/out-tsc/tests/format/ddl/datatype-constraint.test.js +132 -0
- package/out-tsc/tests/format/ddl/datatype-constraint.test.js.map +1 -0
- package/out-tsc/tests/format/ddl/index.test.d.ts +5 -0
- package/out-tsc/tests/format/ddl/index.test.d.ts.map +1 -0
- package/out-tsc/tests/format/ddl/index.test.js +74 -0
- package/out-tsc/tests/format/ddl/index.test.js.map +1 -0
- package/out-tsc/tests/format/ddl/materialized-view.test.d.ts +5 -0
- package/out-tsc/tests/format/ddl/materialized-view.test.d.ts.map +1 -0
- package/out-tsc/tests/format/ddl/materialized-view.test.js +92 -0
- package/out-tsc/tests/format/ddl/materialized-view.test.js.map +1 -0
- package/out-tsc/tests/format/ddl/partition.test.d.ts +5 -0
- package/out-tsc/tests/format/ddl/partition.test.d.ts.map +1 -0
- package/out-tsc/tests/format/ddl/partition.test.js +109 -0
- package/out-tsc/tests/format/ddl/partition.test.js.map +1 -0
- package/out-tsc/tests/format/ddl/variable.test.d.ts +5 -0
- package/out-tsc/tests/format/ddl/variable.test.d.ts.map +1 -0
- package/out-tsc/tests/format/ddl/variable.test.js +58 -0
- package/out-tsc/tests/format/ddl/variable.test.js.map +1 -0
- package/out-tsc/tests/format/dml/select.test.d.ts +5 -0
- package/out-tsc/tests/format/dml/select.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dml/select.test.js +114 -0
- package/out-tsc/tests/format/dml/select.test.js.map +1 -0
- package/out-tsc/tests/format/dml/subquery.test.d.ts +5 -0
- package/out-tsc/tests/format/dml/subquery.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dml/subquery.test.js +221 -0
- package/out-tsc/tests/format/dml/subquery.test.js.map +1 -0
- package/out-tsc/tests/format/dql/comment.test.d.ts +7 -0
- package/out-tsc/tests/format/dql/comment.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dql/comment.test.js +279 -0
- package/out-tsc/tests/format/dql/comment.test.js.map +1 -0
- package/out-tsc/tests/format/dql/cte.test.d.ts +7 -0
- package/out-tsc/tests/format/dql/cte.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dql/cte.test.js +31 -0
- package/out-tsc/tests/format/dql/cte.test.js.map +1 -0
- package/out-tsc/tests/format/dql/dql-detail.test.d.ts +5 -0
- package/out-tsc/tests/format/dql/dql-detail.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dql/dql-detail.test.js +191 -0
- package/out-tsc/tests/format/dql/dql-detail.test.js.map +1 -0
- package/out-tsc/tests/format/dql/lateral-view.test.d.ts +7 -0
- package/out-tsc/tests/format/dql/lateral-view.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dql/lateral-view.test.js +34 -0
- package/out-tsc/tests/format/dql/lateral-view.test.js.map +1 -0
- package/out-tsc/tests/format/dql/pivot.test.d.ts +7 -0
- package/out-tsc/tests/format/dql/pivot.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dql/pivot.test.js +56 -0
- package/out-tsc/tests/format/dql/pivot.test.js.map +1 -0
- package/out-tsc/tests/format/dql/window.test.d.ts +7 -0
- package/out-tsc/tests/format/dql/window.test.d.ts.map +1 -0
- package/out-tsc/tests/format/dql/window.test.js +89 -0
- package/out-tsc/tests/format/dql/window.test.js.map +1 -0
- package/out-tsc/tests/format/expression/expression.test.d.ts +5 -0
- package/out-tsc/tests/format/expression/expression.test.d.ts.map +1 -0
- package/out-tsc/tests/format/expression/expression.test.js +203 -0
- package/out-tsc/tests/format/expression/expression.test.js.map +1 -0
- package/out-tsc/tests/format/pipe/pipe-operator.test.d.ts +5 -0
- package/out-tsc/tests/format/pipe/pipe-operator.test.d.ts.map +1 -0
- package/out-tsc/tests/format/pipe/pipe-operator.test.js +290 -0
- package/out-tsc/tests/format/pipe/pipe-operator.test.js.map +1 -0
- package/out-tsc/tests/format/procedure/compound-statement.test.d.ts +16 -0
- package/out-tsc/tests/format/procedure/compound-statement.test.d.ts.map +1 -0
- package/out-tsc/tests/format/procedure/compound-statement.test.js +254 -0
- package/out-tsc/tests/format/procedure/compound-statement.test.js.map +1 -0
- package/out-tsc/tests/format/resource/resource.test.d.ts +5 -0
- package/out-tsc/tests/format/resource/resource.test.d.ts.map +1 -0
- package/out-tsc/tests/format/resource/resource.test.js +69 -0
- package/out-tsc/tests/format/resource/resource.test.js.map +1 -0
- package/out-tsc/tests/format/test-utils.d.ts +40 -0
- package/out-tsc/tests/format/test-utils.d.ts.map +1 -0
- package/out-tsc/tests/format/test-utils.js +53 -0
- package/out-tsc/tests/format/test-utils.js.map +1 -0
- package/out-tsc/tests/lsp-server.test.d.ts +2 -0
- package/out-tsc/tests/lsp-server.test.d.ts.map +1 -0
- package/out-tsc/tests/lsp-server.test.js +1525 -0
- package/out-tsc/tests/lsp-server.test.js.map +1 -0
- package/out-tsc/tests/spark-sql-inputs.test.d.ts +17 -0
- package/out-tsc/tests/spark-sql-inputs.test.d.ts.map +1 -0
- package/out-tsc/tests/spark-sql-inputs.test.js +570 -0
- package/out-tsc/tests/spark-sql-inputs.test.js.map +1 -0
- package/out-tsc/tests/validation.test.d.ts +2 -0
- package/out-tsc/tests/validation.test.d.ts.map +1 -0
- package/out-tsc/tests/validation.test.js +115 -0
- package/out-tsc/tests/validation.test.js.map +1 -0
- package/out-tsc/typings.d.ts +115 -1
- package/out-tsc/typings.d.ts.map +1 -0
- package/out-tsc/typings.js +28 -0
- package/out-tsc/typings.js.map +1 -1
- package/out-tsc/utils.d.ts +1 -0
- package/out-tsc/utils.d.ts.map +1 -0
- package/out-tsc/utils.js +4 -5
- package/out-tsc/utils.js.map +1 -1
- package/out-tsc/visitors/completion.visitor.d.ts +85 -0
- package/out-tsc/visitors/completion.visitor.d.ts.map +1 -0
- package/out-tsc/visitors/completion.visitor.js +379 -0
- package/out-tsc/visitors/completion.visitor.js.map +1 -0
- package/out-tsc/visitors/lineage.visitor.d.ts +34 -0
- package/out-tsc/visitors/lineage.visitor.d.ts.map +1 -0
- package/out-tsc/visitors/lineage.visitor.js +181 -0
- package/out-tsc/visitors/lineage.visitor.js.map +1 -0
- package/out-tsc/visitors/space-replacer-format.visitor.d.ts +1641 -0
- package/out-tsc/visitors/space-replacer-format.visitor.d.ts.map +1 -0
- package/out-tsc/visitors/space-replacer-format.visitor.js +7529 -0
- package/out-tsc/visitors/space-replacer-format.visitor.js.map +1 -0
- package/out-tsc/visitors/sparksql-relation.visitor.d.ts +154 -0
- package/out-tsc/visitors/sparksql-relation.visitor.d.ts.map +1 -0
- package/out-tsc/visitors/sparksql-relation.visitor.js +749 -0
- package/out-tsc/visitors/sparksql-relation.visitor.js.map +1 -0
- package/package.json +36 -9
- package/out-tsc/constant.d.ts +0 -3
- package/out-tsc/constant.js +0 -7
- package/out-tsc/constant.js.map +0 -1
- package/out-tsc/lib/SparkSqlLexer.d.ts +0 -421
- package/out-tsc/lib/SparkSqlLexer.js +0 -2750
- package/out-tsc/lib/SparkSqlLexer.js.map +0 -1
- package/out-tsc/lib/SparkSqlParser.d.ts +0 -6203
- package/out-tsc/lib/SparkSqlParser.js +0 -34733
- package/out-tsc/lib/SparkSqlParser.js.map +0 -1
- package/out-tsc/lib/SparkSqlParserListener.d.ts +0 -1158
- package/out-tsc/lib/SparkSqlParserListener.js.map +0 -1
- package/out-tsc/lib/SparkSqlParserVisitor.d.ts +0 -773
- package/out-tsc/lib/SparkSqlParserVisitor.js.map +0 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RangeHelper = exports.EditCollector = void 0;
|
|
4
|
+
class EditCollector {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.edits = [];
|
|
7
|
+
this.editKeys = new Set();
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Add a text edit with optional priority
|
|
11
|
+
* Later edits with same range can override earlier ones based on priority
|
|
12
|
+
*/
|
|
13
|
+
addEdit(edit, priority) {
|
|
14
|
+
const key = `${edit.range.start.line}:${edit.range.start.character}-${edit.range.end.line}:${edit.range.end.character}`;
|
|
15
|
+
// Deep clone the edit to avoid reference issues
|
|
16
|
+
const prioritizedEdit = {
|
|
17
|
+
range: {
|
|
18
|
+
start: { line: edit.range.start.line, character: edit.range.start.character },
|
|
19
|
+
end: { line: edit.range.end.line, character: edit.range.end.character }
|
|
20
|
+
},
|
|
21
|
+
newText: edit.newText,
|
|
22
|
+
priority
|
|
23
|
+
};
|
|
24
|
+
if (this.editKeys.has(key)) {
|
|
25
|
+
// Find and potentially replace existing edit
|
|
26
|
+
const existingIndex = this.edits.findIndex(e => e.range.start.line === edit.range.start.line &&
|
|
27
|
+
e.range.start.character === edit.range.start.character &&
|
|
28
|
+
e.range.end.line === edit.range.end.line &&
|
|
29
|
+
e.range.end.character === edit.range.end.character);
|
|
30
|
+
if (existingIndex !== -1) {
|
|
31
|
+
const existing = this.edits[existingIndex];
|
|
32
|
+
// Replace if new edit has higher or equal priority
|
|
33
|
+
if (!priority || !existing.priority || priority.level >= existing.priority.level) {
|
|
34
|
+
this.edits[existingIndex] = prioritizedEdit;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
this.editKeys.add(key);
|
|
40
|
+
this.edits.push(prioritizedEdit);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get all collected edits
|
|
45
|
+
*/
|
|
46
|
+
getEdits() {
|
|
47
|
+
return this.edits.map(({ range, newText }) => ({ range, newText }));
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get all collected edits with priority info
|
|
51
|
+
*/
|
|
52
|
+
getPrioritizedEdits() {
|
|
53
|
+
return [...this.edits];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Check if there's an edit for a specific range
|
|
57
|
+
*/
|
|
58
|
+
hasEditForRange(startLine, startChar, endLine, endChar) {
|
|
59
|
+
const key = `${startLine}:${startChar}-${endLine}:${endChar}`;
|
|
60
|
+
return this.editKeys.has(key);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Check if a range overlaps with any existing edit
|
|
64
|
+
*/
|
|
65
|
+
hasOverlappingEdit(startLine, startChar, endLine, endChar) {
|
|
66
|
+
for (const edit of this.edits) {
|
|
67
|
+
const editStart = edit.range.start;
|
|
68
|
+
const editEnd = edit.range.end;
|
|
69
|
+
// Check if ranges overlap
|
|
70
|
+
const rangesBefore = endLine < editStart.line || (endLine === editStart.line && endChar <= editStart.character);
|
|
71
|
+
const rangesAfter = startLine > editEnd.line || (startLine === editEnd.line && startChar >= editEnd.character);
|
|
72
|
+
if (!rangesBefore && !rangesAfter) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Clear all edits
|
|
80
|
+
*/
|
|
81
|
+
clear() {
|
|
82
|
+
this.edits = [];
|
|
83
|
+
this.editKeys.clear();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get edit count
|
|
87
|
+
*/
|
|
88
|
+
get size() {
|
|
89
|
+
return this.edits.length;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.EditCollector = EditCollector;
|
|
93
|
+
/**
|
|
94
|
+
* Range helper functions for creating edit ranges
|
|
95
|
+
*/
|
|
96
|
+
class RangeHelper {
|
|
97
|
+
/**
|
|
98
|
+
* Calculate the end position of a token, handling multi-line tokens
|
|
99
|
+
*/
|
|
100
|
+
static getTokenEndPosition(token) {
|
|
101
|
+
const text = token.text || '';
|
|
102
|
+
const lines = text.split('\n');
|
|
103
|
+
if (lines.length === 1) {
|
|
104
|
+
return {
|
|
105
|
+
line: token.line - 1,
|
|
106
|
+
character: token.charPositionInLine + text.length
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
return {
|
|
111
|
+
line: token.line - 1 + lines.length - 1,
|
|
112
|
+
character: lines[lines.length - 1].length
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Create range from a context
|
|
118
|
+
*/
|
|
119
|
+
static fromContext(ctx) {
|
|
120
|
+
const start = ctx.start;
|
|
121
|
+
const stop = ctx.stop;
|
|
122
|
+
return {
|
|
123
|
+
start: {
|
|
124
|
+
line: start.line - 1,
|
|
125
|
+
character: start.charPositionInLine
|
|
126
|
+
},
|
|
127
|
+
end: stop
|
|
128
|
+
? RangeHelper.getTokenEndPosition(stop)
|
|
129
|
+
: {
|
|
130
|
+
line: start.line - 1,
|
|
131
|
+
character: start.charPositionInLine + (start.text?.length || 0)
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Create range from a terminal node
|
|
137
|
+
*/
|
|
138
|
+
static fromTerminalNode(node) {
|
|
139
|
+
const token = node.symbol;
|
|
140
|
+
return {
|
|
141
|
+
start: {
|
|
142
|
+
line: token.line - 1,
|
|
143
|
+
character: token.charPositionInLine
|
|
144
|
+
},
|
|
145
|
+
end: RangeHelper.getTokenEndPosition(token)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Create range between two positions
|
|
150
|
+
*/
|
|
151
|
+
static between(start, end) {
|
|
152
|
+
return {
|
|
153
|
+
start: { line: start.line, character: start.character },
|
|
154
|
+
end: { line: end.line, character: end.character }
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.RangeHelper = RangeHelper;
|
|
159
|
+
//# sourceMappingURL=edit-collector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-collector.js","sourceRoot":"","sources":["../../../src/formatter/core/edit-collector.ts"],"names":[],"mappings":";;;A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,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE;YACvD,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE;SAClD,CAAC;IACJ,CAAC;CACF;AA1ED,kCA0EC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatting Context - Manages state during formatting traversal
|
|
3
|
+
*
|
|
4
|
+
* This class centralizes all formatting state management, replacing
|
|
5
|
+
* scattered flag variables in the original visitor implementation.
|
|
6
|
+
*/
|
|
7
|
+
import { PipeStepKind } from '../types';
|
|
8
|
+
export interface FormattingScope {
|
|
9
|
+
type: 'pipe' | 'pipeSubquery' | 'function' | 'parenthesis' | 'caseWhen' | 'windowClause';
|
|
10
|
+
savedIndentLevel: number;
|
|
11
|
+
savedIndentString: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class FormattingContext {
|
|
14
|
+
private indentLevel;
|
|
15
|
+
private indentString;
|
|
16
|
+
private readonly baseIndentString;
|
|
17
|
+
private readonly tabSize;
|
|
18
|
+
private scopeStack;
|
|
19
|
+
private currentPipeStepKind;
|
|
20
|
+
constructor(tabSize?: number);
|
|
21
|
+
/**
|
|
22
|
+
* Get current indent string based on level
|
|
23
|
+
*/
|
|
24
|
+
get indent(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Get newline + current indent
|
|
27
|
+
*/
|
|
28
|
+
get newlineIndent(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Get current indent level
|
|
31
|
+
*/
|
|
32
|
+
get currentIndentLevel(): number;
|
|
33
|
+
/**
|
|
34
|
+
* Increase indent level
|
|
35
|
+
*/
|
|
36
|
+
addIndent(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Decrease indent level
|
|
39
|
+
*/
|
|
40
|
+
minusIndent(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Save current indent state
|
|
43
|
+
*/
|
|
44
|
+
saveIndentState(): {
|
|
45
|
+
level: number;
|
|
46
|
+
string: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Restore indent state
|
|
50
|
+
*/
|
|
51
|
+
restoreIndentState(state: {
|
|
52
|
+
level: number;
|
|
53
|
+
string: string;
|
|
54
|
+
}): void;
|
|
55
|
+
/**
|
|
56
|
+
* Set indent directly (level and string)
|
|
57
|
+
* Used for special cases like pipe context subqueries
|
|
58
|
+
*/
|
|
59
|
+
setIndent(level: number, indentString: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* Enter a new formatting scope
|
|
62
|
+
*/
|
|
63
|
+
enterScope(type: FormattingScope['type']): FormattingScope;
|
|
64
|
+
/**
|
|
65
|
+
* Exit current scope and restore state
|
|
66
|
+
*/
|
|
67
|
+
exitScope(): FormattingScope | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Check if currently in a specific scope type
|
|
70
|
+
*/
|
|
71
|
+
isInScope(type: FormattingScope['type']): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Get current scope depth for a specific type
|
|
74
|
+
*/
|
|
75
|
+
getScopeDepth(type: FormattingScope['type']): number;
|
|
76
|
+
/**
|
|
77
|
+
* Check if in pipe operator context
|
|
78
|
+
*/
|
|
79
|
+
get inPipeOperatorRightSide(): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Check if in pipe subquery context
|
|
82
|
+
*/
|
|
83
|
+
get inPipeSubquery(): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Get current pipe step kind
|
|
86
|
+
*/
|
|
87
|
+
get pipeStepKind(): PipeStepKind | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Set current pipe step kind
|
|
90
|
+
*/
|
|
91
|
+
setPipeStepKind(kind: PipeStepKind | undefined): void;
|
|
92
|
+
/**
|
|
93
|
+
* Enter pipe operator context
|
|
94
|
+
*/
|
|
95
|
+
enterPipeContext(): void;
|
|
96
|
+
/**
|
|
97
|
+
* Exit pipe operator context
|
|
98
|
+
*/
|
|
99
|
+
exitPipeContext(): void;
|
|
100
|
+
/**
|
|
101
|
+
* Enter pipe subquery context
|
|
102
|
+
*/
|
|
103
|
+
enterPipeSubqueryContext(): void;
|
|
104
|
+
/**
|
|
105
|
+
* Exit pipe subquery context
|
|
106
|
+
*/
|
|
107
|
+
exitPipeSubqueryContext(): void;
|
|
108
|
+
/**
|
|
109
|
+
* Check if in WINDOW clause (vs OVER clause in expressions)
|
|
110
|
+
*/
|
|
111
|
+
get inWindowClause(): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Enter window clause context
|
|
114
|
+
*/
|
|
115
|
+
enterWindowClauseContext(): void;
|
|
116
|
+
/**
|
|
117
|
+
* Exit window clause context
|
|
118
|
+
*/
|
|
119
|
+
exitWindowClauseContext(): void;
|
|
120
|
+
/**
|
|
121
|
+
* Check if inside CASE WHEN expression
|
|
122
|
+
*/
|
|
123
|
+
get inCaseWhen(): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Enter CASE WHEN context
|
|
126
|
+
*/
|
|
127
|
+
enterCaseWhenContext(): void;
|
|
128
|
+
/**
|
|
129
|
+
* Exit CASE WHEN context
|
|
130
|
+
*/
|
|
131
|
+
exitCaseWhenContext(): void;
|
|
132
|
+
/**
|
|
133
|
+
* Check if inside function call
|
|
134
|
+
*/
|
|
135
|
+
get inFunctionCall(): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Enter function call context
|
|
138
|
+
*/
|
|
139
|
+
enterFunctionCallContext(): void;
|
|
140
|
+
/**
|
|
141
|
+
* Exit function call context
|
|
142
|
+
*/
|
|
143
|
+
exitFunctionCallContext(): void;
|
|
144
|
+
/**
|
|
145
|
+
* Check if inside parenthesis that needs special handling
|
|
146
|
+
*/
|
|
147
|
+
get inParenthesis(): boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Enter parenthesis context
|
|
150
|
+
*/
|
|
151
|
+
enterParenthesisContext(): void;
|
|
152
|
+
/**
|
|
153
|
+
* Exit parenthesis context
|
|
154
|
+
*/
|
|
155
|
+
exitParenthesisContext(): void;
|
|
156
|
+
/**
|
|
157
|
+
* Create a fixed indent string (for pipe subquery etc.)
|
|
158
|
+
*/
|
|
159
|
+
createFixedIndent(spaceCount: number): string;
|
|
160
|
+
/**
|
|
161
|
+
* Get pipe content indent
|
|
162
|
+
* Uses FixedIndents configuration for consistent indent values
|
|
163
|
+
* Returns newline + spaces for use in comma-separated lists
|
|
164
|
+
*/
|
|
165
|
+
getPipeContentIndent(): string;
|
|
166
|
+
/**
|
|
167
|
+
* Get pipe subquery content indent (fixed 7 spaces)
|
|
168
|
+
*/
|
|
169
|
+
getPipeSubqueryIndent(): string;
|
|
170
|
+
/**
|
|
171
|
+
* Get pipe subquery nested indent (fixed 9 spaces)
|
|
172
|
+
*/
|
|
173
|
+
getPipeSubqueryNestedIndent(): string;
|
|
174
|
+
/**
|
|
175
|
+
* Get pipe subquery closing paren indent (fixed 5 spaces)
|
|
176
|
+
*/
|
|
177
|
+
getPipeSubqueryCloseIndent(): string;
|
|
178
|
+
/**
|
|
179
|
+
* Clone the context for nested operations
|
|
180
|
+
*/
|
|
181
|
+
clone(): FormattingContext;
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=formatting-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting-context.d.ts","sourceRoot":"","sources":["../../../src/formatter/core/formatting-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,UAAU,GAAG,aAAa,GAAG,UAAU,GAAG,cAAc,CAAC;IACzF,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,YAAY,CAAS;IAC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IrD;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAIxB;;OAEG;IACH,eAAe,IAAI,IAAI;IAMvB;;OAEG;IACH,wBAAwB,IAAI,IAAI;IAIhC;;OAEG;IACH,uBAAuB,IAAI,IAAI;IAQ/B;;OAEG;IACH,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED;;OAEG;IACH,wBAAwB,IAAI,IAAI;IAIhC;;OAEG;IACH,uBAAuB,IAAI,IAAI;IAQ/B;;OAEG;IACH,IAAI,UAAU,IAAI,OAAO,CAExB;IAED;;OAEG;IACH,oBAAoB,IAAI,IAAI;IAI5B;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAQ3B;;OAEG;IACH,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED;;OAEG;IACH,wBAAwB,IAAI,IAAI;IAIhC;;OAEG;IACH,uBAAuB,IAAI,IAAI;IAQ/B;;OAEG;IACH,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED;;OAEG;IACH,uBAAuB,IAAI,IAAI;IAI/B;;OAEG;IACH,sBAAsB,IAAI,IAAI;IAQ9B;;OAEG;IACH,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAI7C;;;;OAIG;IACH,oBAAoB,IAAI,MAAM;IAS9B;;OAEG;IACH,qBAAqB,IAAI,MAAM;IAI/B;;OAEG;IACH,2BAA2B,IAAI,MAAM;IAIrC;;OAEG;IACH,0BAA0B,IAAI,MAAM;IAIpC;;OAEG;IACH,KAAK,IAAI,iBAAiB;CAQ3B"}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormattingContext = void 0;
|
|
4
|
+
class FormattingContext {
|
|
5
|
+
constructor(tabSize = 2) {
|
|
6
|
+
this.indentLevel = 0;
|
|
7
|
+
// Scope stack for nested contexts
|
|
8
|
+
this.scopeStack = [];
|
|
9
|
+
this.tabSize = tabSize;
|
|
10
|
+
this.indentString = ' '.repeat(tabSize);
|
|
11
|
+
this.baseIndentString = this.indentString;
|
|
12
|
+
}
|
|
13
|
+
// ==================== Indent Management ====================
|
|
14
|
+
/**
|
|
15
|
+
* Get current indent string based on level
|
|
16
|
+
*/
|
|
17
|
+
get indent() {
|
|
18
|
+
return this.indentString.repeat(this.indentLevel);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get newline + current indent
|
|
22
|
+
*/
|
|
23
|
+
get newlineIndent() {
|
|
24
|
+
return `\n${this.indent}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get current indent level
|
|
28
|
+
*/
|
|
29
|
+
get currentIndentLevel() {
|
|
30
|
+
return this.indentLevel;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Increase indent level
|
|
34
|
+
*/
|
|
35
|
+
addIndent() {
|
|
36
|
+
this.indentLevel++;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Decrease indent level
|
|
40
|
+
*/
|
|
41
|
+
minusIndent() {
|
|
42
|
+
if (this.indentLevel > 0) {
|
|
43
|
+
this.indentLevel--;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Save current indent state
|
|
48
|
+
*/
|
|
49
|
+
saveIndentState() {
|
|
50
|
+
return {
|
|
51
|
+
level: this.indentLevel,
|
|
52
|
+
string: this.indentString
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Restore indent state
|
|
57
|
+
*/
|
|
58
|
+
restoreIndentState(state) {
|
|
59
|
+
this.indentLevel = state.level;
|
|
60
|
+
this.indentString = state.string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Set indent directly (level and string)
|
|
64
|
+
* Used for special cases like pipe context subqueries
|
|
65
|
+
*/
|
|
66
|
+
setIndent(level, indentString) {
|
|
67
|
+
this.indentLevel = level;
|
|
68
|
+
this.indentString = indentString;
|
|
69
|
+
}
|
|
70
|
+
// ==================== Scope Management ====================
|
|
71
|
+
/**
|
|
72
|
+
* Enter a new formatting scope
|
|
73
|
+
*/
|
|
74
|
+
enterScope(type) {
|
|
75
|
+
const scope = {
|
|
76
|
+
type,
|
|
77
|
+
savedIndentLevel: this.indentLevel,
|
|
78
|
+
savedIndentString: this.indentString
|
|
79
|
+
};
|
|
80
|
+
this.scopeStack.push(scope);
|
|
81
|
+
return scope;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Exit current scope and restore state
|
|
85
|
+
*/
|
|
86
|
+
exitScope() {
|
|
87
|
+
const scope = this.scopeStack.pop();
|
|
88
|
+
if (scope) {
|
|
89
|
+
this.indentLevel = scope.savedIndentLevel;
|
|
90
|
+
this.indentString = scope.savedIndentString;
|
|
91
|
+
}
|
|
92
|
+
return scope;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Check if currently in a specific scope type
|
|
96
|
+
*/
|
|
97
|
+
isInScope(type) {
|
|
98
|
+
return this.scopeStack.some(scope => scope.type === type);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get current scope depth for a specific type
|
|
102
|
+
*/
|
|
103
|
+
getScopeDepth(type) {
|
|
104
|
+
return this.scopeStack.filter(scope => scope.type === type).length;
|
|
105
|
+
}
|
|
106
|
+
// ==================== Pipe Context ====================
|
|
107
|
+
/**
|
|
108
|
+
* Check if in pipe operator context
|
|
109
|
+
*/
|
|
110
|
+
get inPipeOperatorRightSide() {
|
|
111
|
+
return this.isInScope('pipe');
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Check if in pipe subquery context
|
|
115
|
+
*/
|
|
116
|
+
get inPipeSubquery() {
|
|
117
|
+
return this.isInScope('pipeSubquery');
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Get current pipe step kind
|
|
121
|
+
*/
|
|
122
|
+
get pipeStepKind() {
|
|
123
|
+
return this.currentPipeStepKind;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Set current pipe step kind
|
|
127
|
+
*/
|
|
128
|
+
setPipeStepKind(kind) {
|
|
129
|
+
this.currentPipeStepKind = kind;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Enter pipe operator context
|
|
133
|
+
*/
|
|
134
|
+
enterPipeContext() {
|
|
135
|
+
this.enterScope('pipe');
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Exit pipe operator context
|
|
139
|
+
*/
|
|
140
|
+
exitPipeContext() {
|
|
141
|
+
if (this.scopeStack.length > 0 && this.scopeStack[this.scopeStack.length - 1].type === 'pipe') {
|
|
142
|
+
this.exitScope();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Enter pipe subquery context
|
|
147
|
+
*/
|
|
148
|
+
enterPipeSubqueryContext() {
|
|
149
|
+
this.enterScope('pipeSubquery');
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Exit pipe subquery context
|
|
153
|
+
*/
|
|
154
|
+
exitPipeSubqueryContext() {
|
|
155
|
+
if (this.scopeStack.length > 0 && this.scopeStack[this.scopeStack.length - 1].type === 'pipeSubquery') {
|
|
156
|
+
this.exitScope();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// ==================== Window Clause Context ====================
|
|
160
|
+
/**
|
|
161
|
+
* Check if in WINDOW clause (vs OVER clause in expressions)
|
|
162
|
+
*/
|
|
163
|
+
get inWindowClause() {
|
|
164
|
+
return this.isInScope('windowClause');
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Enter window clause context
|
|
168
|
+
*/
|
|
169
|
+
enterWindowClauseContext() {
|
|
170
|
+
this.enterScope('windowClause');
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Exit window clause context
|
|
174
|
+
*/
|
|
175
|
+
exitWindowClauseContext() {
|
|
176
|
+
if (this.scopeStack.length > 0 && this.scopeStack[this.scopeStack.length - 1].type === 'windowClause') {
|
|
177
|
+
this.exitScope();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// ==================== CASE WHEN Context ====================
|
|
181
|
+
/**
|
|
182
|
+
* Check if inside CASE WHEN expression
|
|
183
|
+
*/
|
|
184
|
+
get inCaseWhen() {
|
|
185
|
+
return this.isInScope('caseWhen');
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Enter CASE WHEN context
|
|
189
|
+
*/
|
|
190
|
+
enterCaseWhenContext() {
|
|
191
|
+
this.enterScope('caseWhen');
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Exit CASE WHEN context
|
|
195
|
+
*/
|
|
196
|
+
exitCaseWhenContext() {
|
|
197
|
+
if (this.scopeStack.length > 0 && this.scopeStack[this.scopeStack.length - 1].type === 'caseWhen') {
|
|
198
|
+
this.exitScope();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// ==================== Function Call Context ====================
|
|
202
|
+
/**
|
|
203
|
+
* Check if inside function call
|
|
204
|
+
*/
|
|
205
|
+
get inFunctionCall() {
|
|
206
|
+
return this.isInScope('function');
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Enter function call context
|
|
210
|
+
*/
|
|
211
|
+
enterFunctionCallContext() {
|
|
212
|
+
this.enterScope('function');
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Exit function call context
|
|
216
|
+
*/
|
|
217
|
+
exitFunctionCallContext() {
|
|
218
|
+
if (this.scopeStack.length > 0 && this.scopeStack[this.scopeStack.length - 1].type === 'function') {
|
|
219
|
+
this.exitScope();
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
// ==================== Parenthesis Context ====================
|
|
223
|
+
/**
|
|
224
|
+
* Check if inside parenthesis that needs special handling
|
|
225
|
+
*/
|
|
226
|
+
get inParenthesis() {
|
|
227
|
+
return this.isInScope('parenthesis');
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Enter parenthesis context
|
|
231
|
+
*/
|
|
232
|
+
enterParenthesisContext() {
|
|
233
|
+
this.enterScope('parenthesis');
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Exit parenthesis context
|
|
237
|
+
*/
|
|
238
|
+
exitParenthesisContext() {
|
|
239
|
+
if (this.scopeStack.length > 0 && this.scopeStack[this.scopeStack.length - 1].type === 'parenthesis') {
|
|
240
|
+
this.exitScope();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
// ==================== Utility Methods ====================
|
|
244
|
+
/**
|
|
245
|
+
* Create a fixed indent string (for pipe subquery etc.)
|
|
246
|
+
*/
|
|
247
|
+
createFixedIndent(spaceCount) {
|
|
248
|
+
return ' '.repeat(spaceCount);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Get pipe content indent
|
|
252
|
+
* Uses FixedIndents configuration for consistent indent values
|
|
253
|
+
* Returns newline + spaces for use in comma-separated lists
|
|
254
|
+
*/
|
|
255
|
+
getPipeContentIndent() {
|
|
256
|
+
if (this.inPipeSubquery) {
|
|
257
|
+
// For pipe subquery: base indent + 12 spaces (7 for subquery + 5 for pipe content)
|
|
258
|
+
return `\n${this.indent}${' '.repeat(7 + 5)}`;
|
|
259
|
+
}
|
|
260
|
+
// For normal pipe: base indent + 5 spaces
|
|
261
|
+
return `\n${this.indent}${' '.repeat(5)}`;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Get pipe subquery content indent (fixed 7 spaces)
|
|
265
|
+
*/
|
|
266
|
+
getPipeSubqueryIndent() {
|
|
267
|
+
return ' '.repeat(7);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Get pipe subquery nested indent (fixed 9 spaces)
|
|
271
|
+
*/
|
|
272
|
+
getPipeSubqueryNestedIndent() {
|
|
273
|
+
return ' '.repeat(9);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Get pipe subquery closing paren indent (fixed 5 spaces)
|
|
277
|
+
*/
|
|
278
|
+
getPipeSubqueryCloseIndent() {
|
|
279
|
+
return ' '.repeat(5);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Clone the context for nested operations
|
|
283
|
+
*/
|
|
284
|
+
clone() {
|
|
285
|
+
const cloned = new FormattingContext(this.tabSize);
|
|
286
|
+
cloned.indentLevel = this.indentLevel;
|
|
287
|
+
cloned.indentString = this.indentString;
|
|
288
|
+
cloned.scopeStack = [...this.scopeStack];
|
|
289
|
+
cloned.currentPipeStepKind = this.currentPipeStepKind;
|
|
290
|
+
return cloned;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
exports.FormattingContext = FormattingContext;
|
|
294
|
+
//# sourceMappingURL=formatting-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting-context.js","sourceRoot":"","sources":["../../../src/formatter/core/formatting-context.ts"],"names":[],"mappings":";;;AAcA,MAAa,iBAAiB;IAY5B,YAAY,UAAkB,CAAC;QAXvB,gBAAW,GAAG,CAAC,CAAC;QAKxB,kCAAkC;QAC1B,eAAU,GAAsB,EAAE,CAAC;QAMzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,YAAY,CAAC;IAC5C,CAAC;IAED,8DAA8D;IAE9D;;OAEG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,IAAI,aAAa;QACf,OAAO,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,SAAS;QACP,IAAI,CAAC,WAAW,E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CAAC,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,0BAA0B;QACxB,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK;QACH,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACtC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACxC,MAAM,CAAC,UAAU,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;QACzC,MAAM,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACtD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAtVD,8CAsVC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatter Core Module
|
|
3
|
+
*
|
|
4
|
+
* Provides core infrastructure for the formatting system:
|
|
5
|
+
* - FormattingContext: State management during formatting
|
|
6
|
+
* - EditCollector: TextEdit collection and conflict resolution
|
|
7
|
+
* - Strategy interfaces: Base interfaces for formatting strategies
|
|
8
|
+
* - Rules: Centralized spacing and newline configuration
|
|
9
|
+
* - Pipeline: Three-phase processing pipeline
|
|
10
|
+
*/
|
|
11
|
+
export { FormattingContext } from './formatting-context';
|
|
12
|
+
export type { FormattingScope } from './formatting-context';
|
|
13
|
+
export { EditCollector, RangeHelper } from './edit-collector';
|
|
14
|
+
export type { EditPriority, PrioritizedEdit } from './edit-collector';
|
|
15
|
+
export { BaseFormattingStrategy, DefaultStrategyRegistry } from './strategy-interface';
|
|
16
|
+
export type { FormattingBridge, FormattingStrategy, TypedFormattingStrategy, StrategyRegistry } from './strategy-interface';
|
|
17
|
+
export { StrategyFormattingBridge } from './strategy-bridge';
|
|
18
|
+
export type { FormattingBridgeConfig } from './strategy-bridge';
|
|
19
|
+
export { WhitespaceWriter } from './whitespace-writer';
|
|
20
|
+
export type { WhitespaceWriterConfig } from './whitespace-writer';
|
|
21
|
+
export { getPreviousNonHiddenToken, getNextNonHiddenToken, findTokenIndexByStartIndex, getPreviousNonHiddenTokenByStartIndex, getNextNonHiddenTokenByStopIndex, getTokenEndPosition } from './token-helper';
|
|
22
|
+
export { isCommentToken, findCommentTokensBetween, findTokensBetween, hasNewlineBeforeComment, buildTextWithPreservedComments } from './comment-helper';
|
|
23
|
+
export * from './rules';
|
|
24
|
+
export * from './pipeline';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/formatter/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC9D,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACvF,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,0BAA0B,EAC1B,qCAAqC,EACrC,gCAAgC,EAChC,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,8BAA8B,EAC/B,MAAM,kBAAkB,CAAC;AAG1B,cAAc,SAAS,CAAC;AAGxB,cAAc,YAAY,CAAC"}
|