Fix hinting so it always works in an HTML file.

We were not creating a Session if the language of the selection was not javascript.  So when opening an html file, if the cursor wasn't in a javascript section, we would get no hints.
This commit is contained in:
Erik Tierney committed 2013-05-13 16:51:51 -04:00
1 parent 589dcb0719
commit 3bc2bd8bd8
2 files changed
+1 -15

No files matched your search

@@ -785,15 +785,6 @@ define(function (require, exports, module) {
});
}
/*
* Called each time the file associated with the active editor changes.
* Marks the file as being dirty and refresh its outer scope.
*
* @param {Document} document - the document that has changed
*/
function handleFileChange(document) {
}
_ternWorker.addEventListener("message", function (e) {
var response = e.data,
type = response.type;
@@ -818,7 +809,6 @@ define(function (require, exports, module) {
exports.getResolvedPath = getResolvedPath;
exports.getTernHints = getTernHints;
exports.handleEditorChange = handleEditorChange;
exports.handleFileChange = handleFileChange;
exports.requestHints = requestHints;
exports.requestJumptoDef = requestJumptoDef;
});
@@ -470,12 +470,8 @@ define(function (require, exports, module) {
cachedHints = null;
cachedType = null;
if (editor && editor.getLanguageForSelection().getId() === HintUtils.LANGUAGE_ID) {
if (editor) {
initializeSession(editor, true);
$(editor)
.on(HintUtils.eventName("change"), function () {
ScopeManager.handleFileChange(editor.document);
});
} else {
session = null;
}