[sql-hint addon] Fix retrieving of parser config
This commit is contained in:
parent
407d1f1c89
commit
742627abca
|
@ -23,14 +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) {
|
||||
return editor.getModeAt(editor.getCursor()).keywords || CodeMirror.resolveMode("text/x-sql").keywords;
|
||||
return getModeConf(editor).keywords || []
|
||||
}
|
||||
|
||||
function getIdentifierQuote(editor) {
|
||||
return editor.getModeAt(editor.getCursor()).identifierQuote ||
|
||||
CodeMirror.resolveMode("text/x-sql").identifierQuote ||
|
||||
"`";
|
||||
return getModeConf(editor).identifierQuote || "`";
|
||||
}
|
||||
|
||||
function getText(item) {
|
||||
|
|
|
@ -207,7 +207,8 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
|
|||
blockCommentStart: "/*",
|
||||
blockCommentEnd: "*/",
|
||||
lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : "--",
|
||||
closeBrackets: "()[]{}''\"\"``"
|
||||
closeBrackets: "()[]{}''\"\"``",
|
||||
config: parserConfig
|
||||
};
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue