Skip to content

Commit c49c329

Browse files
bgrinsmarijnh
authored andcommitted
[tern addon] add optional callback to showType
1 parent 9e7a26a commit c49c329

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

addon/tern/tern.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
cm.showHint({hint: this.getHint});
107107
},
108108

109-
showType: function(cm, pos) { showType(this, cm, pos); },
109+
showType: function(cm, pos, cb) { showType(this, cm, pos, cb); },
110110

111111
updateArgHints: function(cm) { updateArgHints(this, cm); },
112112

@@ -239,7 +239,7 @@
239239

240240
// Type queries
241241

242-
function showType(ts, cm, pos) {
242+
function showType(ts, cm, pos, cb) {
243243
ts.request(cm, "type", function(error, data) {
244244
if (error) return showError(ts, cm, error);
245245
if (ts.options.typeTip) {
@@ -254,6 +254,7 @@
254254
}
255255
}
256256
tempTooltip(cm, tip);
257+
if (cb) cb();
257258
}, pos);
258259
}
259260

0 commit comments

Comments
 (0)