浏览代码

HUE-4209 [editor] Fix Regex for deleting SQL comments

Enrico Berti 9 年之前
父节点
当前提交
cd345bd

文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/js/ace/ext-language_tools.js


+ 1 - 1
tools/ace-editor/lib/ace/autocomplete/text_completer.js

@@ -37,7 +37,7 @@ define(function(require, exports, module) {
 
     function stripSqlComments(txt) {
         if (ignoreSqlCommentLines) {
-            return txt.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/, '').replace(/--.*/g, '');
+            return txt.replace(/(--.*$|\/\*[\s\S]*?\*\/)/gm, ' ');
         }
         return txt;
     }

部分文件因为文件数量过多而无法显示