Skip to content

Commit

Permalink
fix: DTStack#117 sql brackets {
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxy0551 committed Apr 18, 2024
1 parent 8a13207 commit 795828b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/languages/hive/hive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ export const conf: languages.LanguageConfiguration = {
blockComment: ['/*', '*/']
},
brackets: [
['{', '}'],
['[', ']'],
['(', ')']
],
autoClosingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '"', close: '"' },
{ open: "'", close: "'" },
{ open: '`', close: '`' }
],
surroundingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '"', close: '"' },
Expand All @@ -37,7 +40,8 @@ export const language = <languages.IMonarchLanguage>{
ignoreCase: true,
brackets: [
{ open: '[', close: ']', token: TokenClassConsts.DELIMITER_SQUARE },
{ open: '(', close: ')', token: TokenClassConsts.DELIMITER_PAREN }
{ open: '(', close: ')', token: TokenClassConsts.DELIMITER_PAREN },
{ open: '{', close: '}', token: TokenClassConsts.DELIMITER_CURLY }
],
keywords: [
'ALL',
Expand Down
6 changes: 5 additions & 1 deletion src/languages/impala/impala.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ export const conf: languages.LanguageConfiguration = {
blockComment: ['/*', '*/']
},
brackets: [
['{', '}'],
['[', ']'],
['(', ')']
],
autoClosingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '"', close: '"' },
{ open: "'", close: "'" },
{ open: '`', close: '`' }
],
surroundingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '"', close: '"' },
Expand All @@ -37,7 +40,8 @@ export const language = <languages.IMonarchLanguage>{
ignoreCase: true,
brackets: [
{ open: '[', close: ']', token: TokenClassConsts.DELIMITER_SQUARE },
{ open: '(', close: ')', token: TokenClassConsts.DELIMITER_PAREN }
{ open: '(', close: ')', token: TokenClassConsts.DELIMITER_PAREN },
{ open: '{', close: '}', token: TokenClassConsts.DELIMITER_CURLY }
],
keywords: [
'ALL',
Expand Down
3 changes: 2 additions & 1 deletion src/languages/mysql/mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export const language = <languages.IMonarchLanguage>{

brackets: [
{ open: '[', close: ']', token: TokenClassConsts.DELIMITER_SQUARE },
{ open: '(', close: ')', token: TokenClassConsts.DELIMITER_PAREN }
{ open: '(', close: ')', token: TokenClassConsts.DELIMITER_PAREN },
{ open: '{', close: '}', token: TokenClassConsts.DELIMITER_CURLY }
],

// Only consider reserved keywords
Expand Down
4 changes: 2 additions & 2 deletions src/languages/pgsql/pgsql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const conf: languages.LanguageConfiguration = {
brackets: [
['{', '}'],
['[', ']'],

['(', ')']
],
autoClosingPairs: [
Expand All @@ -40,7 +39,8 @@ export const language = <languages.IMonarchLanguage>{

brackets: [
{ open: '[', close: ']', token: TokenClassConsts.DELIMITER_SQUARE },
{ open: '(', close: ')', token: TokenClassConsts.DELIMITER_PAREN }
{ open: '(', close: ')', token: TokenClassConsts.DELIMITER_PAREN },
{ open: '{', close: '}', token: TokenClassConsts.DELIMITER_CURLY }
],

keywords: [
Expand Down
6 changes: 5 additions & 1 deletion src/languages/spark/spark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ export const conf: languages.LanguageConfiguration = {
blockComment: ['/*', '*/']
},
brackets: [
['{', '}'],
['[', ']'],
['(', ')']
],
autoClosingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '"', close: '"' },
{ open: "'", close: "'" },
{ open: '`', close: '`' }
],
surroundingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '"', close: '"' },
Expand All @@ -37,7 +40,8 @@ export const language = <languages.IMonarchLanguage>{
ignoreCase: true,
brackets: [
{ open: '[', close: ']', token: TokenClassConsts.DELIMITER_SQUARE },
{ open: '(', close: ')', token: TokenClassConsts.DELIMITER_PAREN }
{ open: '(', close: ')', token: TokenClassConsts.DELIMITER_PAREN },
{ open: '{', close: '}', token: TokenClassConsts.DELIMITER_CURLY }
],
keywords: [
// https://spark.apache.org/docs/latest/sql-ref-ansi-compliance.html
Expand Down

0 comments on commit 795828b

Please sign in to comment.