forked from pgadmin-org/pgadmin4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdialect.js
More file actions
24 lines (21 loc) · 683 Bytes
/
dialect.js
File metadata and controls
24 lines (21 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { SQLDialect, PostgreSQL } from '@codemirror/lang-sql';
import { foldNodeProp } from '@codemirror/language';
const extraKeywords = 'unsafe';
const keywords = PostgreSQL.spec.keywords.replace(/\b\w\b/, '') + ' ' + extraKeywords;
const PgSQL = SQLDialect.define({
charSetCasts: true,
doubleDollarQuotedStrings: false,
operatorChars: '+-*/<>=~!@#%^&|`?',
specialVar: '',
keywords: keywords,
types: PostgreSQL.spec.types,
}).configureLanguage({
// Disable default folding behavior as it conflicts with custom folding
props: [
foldNodeProp.add({
Statement() { return null; },
BlockComment() { return null; }
}),
]
});
export default PgSQL;