diff --git a/js/vendor/codemirror/addon/hint/sql-hint.js b/js/vendor/codemirror/addon/hint/sql-hint.js index 57c3b64f26..61faec0bc0 100644 --- a/js/vendor/codemirror/addon/hint/sql-hint.js +++ b/js/vendor/codemirror/addon/hint/sql-hint.js @@ -23,16 +23,16 @@ function isArray(val) { return Object.prototype.toString.call(val) == "[object Array]" } + function getModeConf(editor) { + return editor.getModeAt(editor.getCursor()).config || CodeMirror.resolveMode("text/x-sql") + } + function getKeywords(editor) { - var mode = editor.doc.modeOption; - if (mode === "sql") mode = "text/x-sql"; - return CodeMirror.resolveMode(mode).keywords; + return getModeConf(editor).keywords || [] } function getIdentifierQuote(editor) { - var mode = editor.doc.modeOption; - if (mode === "sql") mode = "text/x-sql"; - return CodeMirror.resolveMode(mode).identifierQuote || "`"; + return getModeConf(editor).identifierQuote || "`"; } function getText(item) { diff --git a/js/vendor/codemirror/lib/codemirror.js b/js/vendor/codemirror/lib/codemirror.js index 5ca96da451..994b21d62b 100644 --- a/js/vendor/codemirror/lib/codemirror.js +++ b/js/vendor/codemirror/lib/codemirror.js @@ -9865,7 +9865,7 @@ addLegacyProps(CodeMirror); - CodeMirror.version = "5.65.9"; + CodeMirror.version = "5.65.10"; return CodeMirror; diff --git a/js/vendor/codemirror/mode/javascript/javascript.js b/js/vendor/codemirror/mode/javascript/javascript.js index 48a46d65d0..bb735ebc96 100644 --- a/js/vendor/codemirror/mode/javascript/javascript.js +++ b/js/vendor/codemirror/mode/javascript/javascript.js @@ -779,7 +779,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "async" || (type == "variable" && (value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) && - cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) { + cx.stream.match(/^\s+#?[\w$\xa1-\uffff]/, false))) { cx.marked = "keyword"; return cont(classBody); } diff --git a/js/vendor/codemirror/mode/sql/sql.js b/js/vendor/codemirror/mode/sql/sql.js index 105b22ffb9..fedf6cd77c 100644 --- a/js/vendor/codemirror/mode/sql/sql.js +++ b/js/vendor/codemirror/mode/sql/sql.js @@ -207,7 +207,8 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { blockCommentStart: "/*", blockCommentEnd: "*/", lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : "--", - closeBrackets: "()[]{}''\"\"``" + closeBrackets: "()[]{}''\"\"``", + config: parserConfig }; }); diff --git a/package.json b/package.json index 897eed3d5c..8509e031c2 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@zxcvbn-ts/core": "^2.0.1", "autoprefixer": "^10.4.7", "bootstrap": "5.2.0", - "codemirror": "5.65.9", + "codemirror": "5.65.10", "jquery": "3.6.0", "jquery-debounce-throttle": "^1.0.6-rc.0", "jquery-migrate": "3.4.0", diff --git a/yarn.lock b/yarn.lock index 221cd5d3cb..b152c00d2f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1870,10 +1870,10 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -codemirror@5.65.9: - version "5.65.9" - resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.65.9.tgz#ec70c92aa206ee4c9853d5f1e7c4ed356cdab68c" - integrity sha512-19Jox5sAKpusTDgqgKB5dawPpQcY+ipQK7xoEI+MVucEF9qqFaXpeqY1KaoyGBso/wHQoDa4HMMxMjdsS3Zzzw== +codemirror@5.65.10: + version "5.65.10" + resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.65.10.tgz#4276a93b8534ce91f14b733ba9a1ac949666eac9" + integrity sha512-IXAG5wlhbgcTJ6rZZcmi4+sjWIbJqIGfeg3tNa3yX84Jb3T4huS5qzQAo/cUisc1l3bI47WZodpyf7cYcocDKg== collect-v8-coverage@^1.0.0: version "1.0.1"