Skip to content
Snippets Groups Projects
Commit c8f0fee3 authored by Matthew Rathbone's avatar Matthew Rathbone Committed by Marijn Haverbeke
Browse files

[sql-hint addon] Allow opting out of keyword completion

parent d47bc479
No related branches found
No related tags found
No related merge requests found
......@@ -212,6 +212,7 @@
CodeMirror.registerHelper("hint", "sql", function(editor, options) {
tables = (options && options.tables) || {};
var defaultTableName = options && options.defaultTable;
var disableKeywords = options && options.disableKeywords;
defaultTable = defaultTableName && getItem(tables, defaultTableName);
keywords = keywords || getKeywords(editor);
......@@ -244,7 +245,8 @@
} else {
addMatches(result, search, tables, function(w) {return w;});
addMatches(result, search, defaultTable, function(w) {return w;});
addMatches(result, search, keywords, function(w) {return w.toUpperCase();});
if (!disableKeywords)
addMatches(result, search, keywords, function(w) {return w.toUpperCase();});
}
return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment