Skip to content

Commit

Permalink
feat: support impala
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyFBB committed Nov 29, 2023
1 parent 75d5e22 commit b5ed63d
Show file tree
Hide file tree
Showing 10 changed files with 721 additions and 2 deletions.
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'
}
20 changes: 20 additions & 0 deletions src/impalasql/impalaSQLWorker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { worker } from '../fillers/monaco-editor-core';
import ImpalaSQL from 'dt-sql-parser/dist/parser/impala';

Check failure on line 2 in src/impalasql/impalaSQLWorker.ts

View workflow job for this annotation

GitHub Actions / CI

Cannot find module 'dt-sql-parser/dist/parser/impala' or its corresponding type declarations.
import { BaseSQLWorker } from '../baseSQLWorker';

export interface ICreateData {
languageId: string;
}
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

0 comments on commit b5ed63d

Please sign in to comment.