diff --git a/src/extensions/default/JavaScriptCodeHints/main.js b/src/extensions/default/JavaScriptCodeHints/main.js index 47ae26bb9..b526310f4 100644 --- a/src/extensions/default/JavaScriptCodeHints/main.js +++ b/src/extensions/default/JavaScriptCodeHints/main.js @@ -375,8 +375,11 @@ define(function (require, exports, module) { // Compute fresh hints if none exist, or if the session // type has changed since the last hint computation if (this.needNewHints(session)) { - ScopeManager.handleFileChange({from: cursor, to: cursor, text: [key]}); - ignoreChange = true; + if (key) { + ScopeManager.handleFileChange({from: cursor, to: cursor, text: [key]}); + ignoreChange = true; + } + var scopeResponse = ScopeManager.requestHints(session, session.editor.document); if (scopeResponse.hasOwnProperty("promise")) {