[sql-hint addon] Make completion work when SQL isn't the outermost mode
Closes https://github.com/codemirror/codemirror5/issues/5249
This commit is contained in:
parent
2e3df70d4c
commit
407d1f1c89
|
@ -24,15 +24,13 @@
|
|||
function isArray(val) { return Object.prototype.toString.call(val) == "[object Array]" }
|
||||
|
||||
function getKeywords(editor) {
|
||||
var mode = editor.doc.modeOption;
|
||||
if (mode === "sql") mode = "text/x-sql";
|
||||
return CodeMirror.resolveMode(mode).keywords;
|
||||
return editor.getModeAt(editor.getCursor()).keywords || CodeMirror.resolveMode("text/x-sql").keywords;
|
||||
}
|
||||
|
||||
function getIdentifierQuote(editor) {
|
||||
var mode = editor.doc.modeOption;
|
||||
if (mode === "sql") mode = "text/x-sql";
|
||||
return CodeMirror.resolveMode(mode).identifierQuote || "`";
|
||||
return editor.getModeAt(editor.getCursor()).identifierQuote ||
|
||||
CodeMirror.resolveMode("text/x-sql").identifierQuote ||
|
||||
"`";
|
||||
}
|
||||
|
||||
function getText(item) {
|
||||
|
|
Loading…
Reference in New Issue