[sql-hint addon] Fix getting keywords from plain sql mode

This commit is contained in:
Marijn Haverbeke 2022-12-08 08:27:56 +01:00
parent 7814ddf401
commit fbe612a66a
1 changed files with 4 additions and 4 deletions

View File

@ -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 getModeConf(editor, field) {
return editor.getModeAt(editor.getCursor()).config[field] || CodeMirror.resolveMode("text/x-sql")[field]
}
function getKeywords(editor) {
return getModeConf(editor).keywords || []
return getModeConf(editor, "keywords") || []
}
function getIdentifierQuote(editor) {
return getModeConf(editor).identifierQuote || "`";
return getModeConf(editor, "identifierQuote") || "`";
}
function getText(item) {