-
Notifications
You must be signed in to change notification settings - Fork 20
/
TernTypes.js
52 lines (39 loc) · 1.22 KB
/
TernTypes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* Ternific Copyright (c) 2014 Miguel Castillo.
*
* Licensed under MIT
*/
define(function (require /*, exports, module*/) {
'use strict';
var HintHelper = require("HintHelper");
function TernTypes(ternProvider) {
var _self = this;
_self.ternProvider = ternProvider;
_self._cm = null;
}
TernTypes.prototype.findType = function( cm ) {
var _self = this;
return _self.ternProvider.query(cm, "type")
.then( function(data) {
var findTypeType = HintHelper.typeDetails(data.type),
className = findTypeType.icon;
if (data.guess) {
className += " Tern-completion-guess";
}
var _findType = {
value: data.name,
type: findTypeType.name,
icon: findTypeType.icon,
className: className,
_find: data,
_type: HintHelper.findTypeType
};
console.log(_findType);
return _findType;
},
function( error ) {
return error;
});
};
return TernTypes;
});