Skip to content

Commit

Permalink
feat: support mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxy0551 committed Dec 4, 2023
1 parent 4496e25 commit 092d825
Show file tree
Hide file tree
Showing 6 changed files with 754 additions and 416 deletions.
1 change: 1 addition & 0 deletions src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const TokenClassConsts = {
OPERATOR_SYMBOL: 'operators.symbol',
PREDEFINED: 'predefined',
STRING: 'string',
STRING_DOUBLE: 'string.double',
STRING_ESCAPE: 'string.escape',
TYPE: 'type',
VARIABLE: 'variable',
Expand Down
6 changes: 3 additions & 3 deletions src/mysql/mysql.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import { LanguageIdEnum } from '../common/constants';

registerLanguage({
id: LanguageIdEnum.MYSQL,
extensions: [],
aliases: ['MySQL'],
extensions: ['mysql'],
aliases: ['MySQL', 'mysql'],
loader: () => import('./mysql')
});

loadLanguage(LanguageIdEnum.MYSQL);

setupLanguageFeatures({
languageId: LanguageIdEnum.MYSQL,
completionItems: false,
completionItems: true,
diagnostics: true
});
12 changes: 4 additions & 8 deletions src/mysql/mysql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,11 +558,7 @@ testTokenization('mysql', [
{ startIndex: 5, type: 'white.sql' },
{ startIndex: 6, type: 'identifier.sql' },
{ startIndex: 13, type: 'white.sql' },
{ startIndex: 14, type: 'operator.sql' },
{ startIndex: 16, type: 'white.sql' },
{ startIndex: 17, type: 'operator.sql' },
{ startIndex: 20, type: 'white.sql' },
{ startIndex: 21, type: 'operator.sql' }
{ startIndex: 14, type: 'operators.keyword.sql' }
]
}
],
Expand All @@ -583,13 +579,13 @@ testTokenization('mysql', [
{ startIndex: 23, type: 'white.sql' },
{ startIndex: 24, type: 'identifier.sql' },
{ startIndex: 32, type: 'white.sql' },
{ startIndex: 33, type: 'operator.sql' },
{ startIndex: 33, type: 'keyword.sql' },
{ startIndex: 35, type: 'white.sql' },
{ startIndex: 36, type: 'delimiter.parenthesis.sql' },
{ startIndex: 36, type: 'delimiter.paren.sql' },
{ startIndex: 37, type: 'number.sql' },
{ startIndex: 38, type: 'delimiter.sql' },
{ startIndex: 39, type: 'number.sql' },
{ startIndex: 40, type: 'delimiter.parenthesis.sql' }
{ startIndex: 40, type: 'delimiter.paren.sql' }
]
}
]
Expand Down
Loading

0 comments on commit 092d825

Please sign in to comment.