2025-06-12 19:14:41 +05:30
|
|
|
/////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2013 - 2025, The pgAdmin Development Team
|
|
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
|
//
|
|
|
|
|
//////////////////////////////////////////////////////////////
|
2024-02-21 11:15:25 +05:30
|
|
|
import { SQLDialect, PostgreSQL } from '@codemirror/lang-sql';
|
2025-06-02 15:58:07 +05:30
|
|
|
import { foldNodeProp } from '@codemirror/language';
|
2024-02-21 11:15:25 +05:30
|
|
|
|
|
|
|
|
const extraKeywords = 'unsafe';
|
|
|
|
|
const keywords = PostgreSQL.spec.keywords.replace(/\b\w\b/, '') + ' ' + extraKeywords;
|
|
|
|
|
|
|
|
|
|
const PgSQL = SQLDialect.define({
|
|
|
|
|
charSetCasts: true,
|
2024-04-08 15:13:45 +05:30
|
|
|
doubleDollarQuotedStrings: false,
|
2024-02-21 11:15:25 +05:30
|
|
|
operatorChars: '+-*/<>=~!@#%^&|`?',
|
|
|
|
|
specialVar: '',
|
|
|
|
|
keywords: keywords,
|
|
|
|
|
types: PostgreSQL.spec.types,
|
2025-06-02 15:58:07 +05:30
|
|
|
}).configureLanguage({
|
|
|
|
|
// Disable default folding behavior as it conflicts with custom folding
|
|
|
|
|
props: [
|
|
|
|
|
foldNodeProp.add({
|
|
|
|
|
Statement() { return null; },
|
|
|
|
|
BlockComment() { return null; }
|
|
|
|
|
}),
|
|
|
|
|
]
|
2024-02-21 11:15:25 +05:30
|
|
|
});
|
2025-06-02 15:58:07 +05:30
|
|
|
|
2024-02-21 11:15:25 +05:30
|
|
|
export default PgSQL;
|