Skip to content

Commit fbe612a

Browse files
committed
[sql-hint addon] Fix getting keywords from plain sql mode
1 parent 7814ddf commit fbe612a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

addon/hint/sql-hint.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
2323

2424
function isArray(val) { return Object.prototype.toString.call(val) == "[object Array]" }
2525

26-
function getModeConf(editor) {
27-
return editor.getModeAt(editor.getCursor()).config || CodeMirror.resolveMode("text/x-sql")
26+
function getModeConf(editor, field) {
27+
return editor.getModeAt(editor.getCursor()).config[field] || CodeMirror.resolveMode("text/x-sql")[field]
2828
}
2929

3030
function getKeywords(editor) {
31-
return getModeConf(editor).keywords || []
31+
return getModeConf(editor, "keywords") || []
3232
}
3333

3434
function getIdentifierQuote(editor) {
35-
return getModeConf(editor).identifierQuote || "`";
35+
return getModeConf(editor, "identifierQuote") || "`";
3636
}
3737

3838
function getText(item) {

0 commit comments

Comments
 (0)