mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
Fix problem where hints are displayed before tern has finished computing the completions.
This means there is now a delay on the first request for hints.
This commit is contained in:
1 parent
9689288dec
commit
d648572395
3 files changed
+50
-11
No files matched your search
@@ -40,6 +40,7 @@ define(function (require, exports, module) {
|
||||
function Session(editor) {
|
||||
this.editor = editor;
|
||||
this.path = editor.document.file.fullPath;
|
||||
this.ternHints = [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -538,7 +539,8 @@ define(function (require, exports, module) {
|
||||
hints;
|
||||
|
||||
if (type.property) {
|
||||
var ternHints = ScopeManager.getTernHints("dir", "file", offset, this.editor.document.getText());
|
||||
var ternHints = this.ternHints;
|
||||
//console.log("Got " + (ternHints ? ternHints.length : 0) + " hints from tern");
|
||||
if( ternHints && ternHints.length > 0 ) {
|
||||
hints = ternHints;
|
||||
}
|
||||
@@ -565,6 +567,9 @@ define(function (require, exports, module) {
|
||||
|
||||
return hints;
|
||||
};
|
||||
|
||||
|
||||
Session.prototype.setTernHints = function(newHints) {
|
||||
this.ternHints = newHints;
|
||||
}
|
||||
module.exports = Session;
|
||||
});
|
||||
Reference in new issue
Block a user