@fc-components/monaco-editor 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/monaco-editor.cjs.development.js +4 -1
- package/dist/monaco-editor.cjs.development.js.map +1 -1
- package/dist/monaco-editor.cjs.production.min.js +1 -1
- package/dist/monaco-editor.cjs.production.min.js.map +1 -1
- package/dist/monaco-editor.esm.js +4 -1
- package/dist/monaco-editor.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/sql/format.ts +4 -1
|
@@ -3663,7 +3663,7 @@ var getSqlCompletionProvider = function getSqlCompletionProvider() {
|
|
|
3663
3663
|
var _templateObject$2;
|
|
3664
3664
|
function formatSql(sql) {
|
|
3665
3665
|
try {
|
|
3666
|
-
|
|
3666
|
+
var formatted = format(sql, {
|
|
3667
3667
|
tabWidth: 2,
|
|
3668
3668
|
keywordCase: 'upper',
|
|
3669
3669
|
// Treat custom $__ prefixed macros (like $__timeFilter, $__timeRange, etc.)
|
|
@@ -3674,6 +3674,9 @@ function formatSql(sql) {
|
|
|
3674
3674
|
}]
|
|
3675
3675
|
}
|
|
3676
3676
|
});
|
|
3677
|
+
// sql-formatter treats $__xxx as a placeholder and inserts a space before '('.
|
|
3678
|
+
// Remove that extra space so $__timeFilter( stays intact as a function call.
|
|
3679
|
+
return formatted.replace(/(\$__[a-zA-Z_][a-zA-Z0-9_]*)\s+\(/g, '$1(');
|
|
3677
3680
|
} catch (_unused) {
|
|
3678
3681
|
// If formatting fails, return the original SQL
|
|
3679
3682
|
return sql;
|