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: support impala #83

Merged
merged 7 commits into from
Dec 8, 2023
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
3 changes: 2 additions & 1 deletion src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ export enum LanguageIdEnum {
PL = 'plsql',
SPARK = 'sparksql',
SQL = 'sql',
TRINO = 'trinosql'
TRINO = 'trinosql',
IMPALA = 'impalasql'
}
18 changes: 18 additions & 0 deletions src/impalasql/impalaSQLWorker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { worker } from '../fillers/monaco-editor-core';
import ImpalaSQL from 'dt-sql-parser/dist/parser/impala';
import { BaseSQLWorker } from '../baseSQLWorker';
import { ICreateData } from '../_.contribution';

export class ImpalaSQLWorker extends BaseSQLWorker {
protected _ctx: worker.IWorkerContext;
protected parser: ImpalaSQL;
constructor(ctx: worker.IWorkerContext, createData: ICreateData) {
super();
this._ctx = ctx;
this.parser = new ImpalaSQL();
}
}

export function create(ctx: worker.IWorkerContext, createData: ICreateData): ImpalaSQLWorker {
return new ImpalaSQLWorker(ctx, createData);
}
23 changes: 23 additions & 0 deletions src/impalasql/impalasql.contribution.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { loadLanguage, registerLanguage } from '../_.contribution';
import { setupLanguageFeatures } from '../setupLanguageFeatures';
import { LanguageIdEnum } from '../common/constants';

registerLanguage({
id: LanguageIdEnum.IMPALA,
extensions: ['.impalasql'],
aliases: ['impalaSQL', 'impala', 'Impala'],
loader: () => import('./impalasql')
});

loadLanguage(LanguageIdEnum.IMPALA);

setupLanguageFeatures({
languageId: LanguageIdEnum.IMPALA,
completionItems: true,
diagnostics: true
});
Empty file added src/impalasql/impalasql.test.ts
Empty file.
Loading
Loading