@@ -13,6 +13,9 @@ using flixel.util.FlxStringUtil;
13
13
14
14
class CompletionHandler
15
15
{
16
+ private static inline var ENTRY_VALUE = " Entry Value" ;
17
+ private static inline var ENTRY_TYPE = " Entry Type" ;
18
+
16
19
private var completionList : CompletionList ;
17
20
private var input : TextField ;
18
21
private var watchingSelection : Bool = false ;
@@ -144,18 +147,36 @@ class CompletionHandler
144
147
var output = ConsoleUtil .runCommand (command );
145
148
146
149
watchingSelection = true ;
147
- FlxG .watch .addQuick (" Selection" , output );
150
+ FlxG .watch .addQuick (ENTRY_VALUE , output );
151
+ FlxG .watch .addQuick (ENTRY_TYPE , getReadableType (output ));
148
152
}
149
153
catch (e : Dynamic ) {}
150
154
#end
151
155
}
156
+
157
+ private function getReadableType (v : Dynamic ): String
158
+ {
159
+ return switch (Type .typeof (v ))
160
+ {
161
+ case TNull : null ;
162
+ case TInt : " Int" ;
163
+ case TFloat : " Float" ;
164
+ case TBool : " Bool" ;
165
+ case TObject : " Object" ;
166
+ case TFunction : " Function" ;
167
+ case TClass (c ): FlxStringUtil .getClassName (c , true );
168
+ case TEnum (e ): FlxStringUtil .getClassName (e , true );
169
+ case TUnknown : " Unknown" ;
170
+ }
171
+ }
152
172
153
173
private function completionClosed ()
154
174
{
155
175
if (! watchingSelection )
156
176
return ;
157
177
158
- FlxG .watch .removeQuick (" Selection" );
178
+ FlxG .watch .removeQuick (ENTRY_VALUE );
179
+ FlxG .watch .removeQuick (ENTRY_TYPE );
159
180
watchingSelection = false ;
160
181
}
161
182
0 commit comments