From c8f0fee358a3fe974a11eb388837be57c7fdadc4 Mon Sep 17 00:00:00 2001
From: Matthew Rathbone <matthew.rathbone@gmail.com>
Date: Fri, 8 May 2015 10:39:32 -0500
Subject: [PATCH] [sql-hint addon] Allow opting out of keyword completion

---
 addon/hint/sql-hint.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/addon/hint/sql-hint.js b/addon/hint/sql-hint.js
index ee648fe5..08051ce7 100644
--- a/addon/hint/sql-hint.js
+++ b/addon/hint/sql-hint.js
@@ -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)};
-- 
GitLab