Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade trino autocomplete #247

Merged
merged 5 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ dist-types

.ds_store

.antlr
.antlr

# Intellij IDES add weird token files that we don't use
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK how to fix it and have the antlr syntax highlighting, decided to just ignore this file

**/grammar/*.tokens
14 changes: 11 additions & 3 deletions src/autocomplete/databases/trino/generated/TrinoParser.interp

Large diffs are not rendered by default.

9,387 changes: 4,901 additions & 4,486 deletions src/autocomplete/databases/trino/generated/TrinoParser.ts

Large diffs are not rendered by default.

84 changes: 74 additions & 10 deletions src/autocomplete/databases/trino/generated/TrinoParserVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import { AbstractParseTreeVisitor } from "antlr4ng";


import { ParseContext } from "./TrinoParser.js";
import { StatementsContext } from "./TrinoParser.js";
import { StatementDefaultContext } from "./TrinoParser.js";
import { UseContext } from "./TrinoParser.js";
import { UseCatalogContext } from "./TrinoParser.js";
import { CreateCatalogContext } from "./TrinoParser.js";
import { DropCatalogContext } from "./TrinoParser.js";
import { CreateSchemaContext } from "./TrinoParser.js";
Expand Down Expand Up @@ -324,11 +324,20 @@ import { CurrentRoleGrantorContext } from "./TrinoParser.js";
import { UnspecifiedPrincipalContext } from "./TrinoParser.js";
import { UserPrincipalContext } from "./TrinoParser.js";
import { RolePrincipalContext } from "./TrinoParser.js";
import { RolesContext } from "./TrinoParser.js";
import { RoleIdentifierListContext } from "./TrinoParser.js";
import { UnquotedIdentifierContext } from "./TrinoParser.js";
import { QuotedIdentifierContext } from "./TrinoParser.js";
import { BackQuotedIdentifierContext } from "./TrinoParser.js";
import { DigitIdentifierContext } from "./TrinoParser.js";
import { CatalogIdentifierContext } from "./TrinoParser.js";
import { SchemaIdentifierContext } from "./TrinoParser.js";
import { TableIdentifierContext } from "./TrinoParser.js";
import { ViewIdentifierContext } from "./TrinoParser.js";
import { NewSchemaIdentifierContext } from "./TrinoParser.js";
import { NewTableIdentifierContext } from "./TrinoParser.js";
import { NewViewIdentifierContext } from "./TrinoParser.js";
import { RoleIdentifierContext } from "./TrinoParser.js";
import { ConnectorIdentifierContext } from "./TrinoParser.js";
import { DecimalLiteralContext } from "./TrinoParser.js";
import { DoubleLiteralContext } from "./TrinoParser.js";
import { IntegerLiteralContext } from "./TrinoParser.js";
Expand All @@ -351,12 +360,6 @@ export class TrinoParserVisitor<Result> extends AbstractParseTreeVisitor<Result>
* @return the visitor result
*/
visitParse?: (ctx: ParseContext) => Result;
/**
* Visit a parse tree produced by `TrinoParser.statements`.
* @param ctx the parse tree
* @return the visitor result
*/
visitStatements?: (ctx: StatementsContext) => Result;
/**
* Visit a parse tree produced by the `statementDefault`
* labeled alternative in `TrinoParser.statement`.
Expand All @@ -371,6 +374,13 @@ export class TrinoParserVisitor<Result> extends AbstractParseTreeVisitor<Result>
* @return the visitor result
*/
visitUse?: (ctx: UseContext) => Result;
/**
* Visit a parse tree produced by the `useCatalog`
* labeled alternative in `TrinoParser.statement`.
* @param ctx the parse tree
* @return the visitor result
*/
visitUseCatalog?: (ctx: UseCatalogContext) => Result;
/**
* Visit a parse tree produced by the `createCatalog`
* labeled alternative in `TrinoParser.statement`.
Expand Down Expand Up @@ -2445,11 +2455,11 @@ export class TrinoParserVisitor<Result> extends AbstractParseTreeVisitor<Result>
*/
visitRolePrincipal?: (ctx: RolePrincipalContext) => Result;
/**
* Visit a parse tree produced by `TrinoParser.roles`.
* Visit a parse tree produced by `TrinoParser.roleIdentifierList`.
* @param ctx the parse tree
* @return the visitor result
*/
visitRoles?: (ctx: RolesContext) => Result;
visitRoleIdentifierList?: (ctx: RoleIdentifierListContext) => Result;
/**
* Visit a parse tree produced by the `unquotedIdentifier`
* labeled alternative in `TrinoParser.identifier`.
Expand Down Expand Up @@ -2478,6 +2488,60 @@ export class TrinoParserVisitor<Result> extends AbstractParseTreeVisitor<Result>
* @return the visitor result
*/
visitDigitIdentifier?: (ctx: DigitIdentifierContext) => Result;
/**
* Visit a parse tree produced by `TrinoParser.catalogIdentifier`.
* @param ctx the parse tree
* @return the visitor result
*/
visitCatalogIdentifier?: (ctx: CatalogIdentifierContext) => Result;
/**
* Visit a parse tree produced by `TrinoParser.schemaIdentifier`.
* @param ctx the parse tree
* @return the visitor result
*/
visitSchemaIdentifier?: (ctx: SchemaIdentifierContext) => Result;
/**
* Visit a parse tree produced by `TrinoParser.tableIdentifier`.
* @param ctx the parse tree
* @return the visitor result
*/
visitTableIdentifier?: (ctx: TableIdentifierContext) => Result;
/**
* Visit a parse tree produced by `TrinoParser.viewIdentifier`.
* @param ctx the parse tree
* @return the visitor result
*/
visitViewIdentifier?: (ctx: ViewIdentifierContext) => Result;
/**
* Visit a parse tree produced by `TrinoParser.newSchemaIdentifier`.
* @param ctx the parse tree
* @return the visitor result
*/
visitNewSchemaIdentifier?: (ctx: NewSchemaIdentifierContext) => Result;
/**
* Visit a parse tree produced by `TrinoParser.newTableIdentifier`.
* @param ctx the parse tree
* @return the visitor result
*/
visitNewTableIdentifier?: (ctx: NewTableIdentifierContext) => Result;
/**
* Visit a parse tree produced by `TrinoParser.newViewIdentifier`.
* @param ctx the parse tree
* @return the visitor result
*/
visitNewViewIdentifier?: (ctx: NewViewIdentifierContext) => Result;
/**
* Visit a parse tree produced by `TrinoParser.roleIdentifier`.
* @param ctx the parse tree
* @return the visitor result
*/
visitRoleIdentifier?: (ctx: RoleIdentifierContext) => Result;
/**
* Visit a parse tree produced by `TrinoParser.connectorIdentifier`.
* @param ctx the parse tree
* @return the visitor result
*/
visitConnectorIdentifier?: (ctx: ConnectorIdentifierContext) => Result;
/**
* Visit a parse tree produced by the `decimalLiteral`
* labeled alternative in `TrinoParser.number`.
Expand Down
Loading
Loading