File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/ts-autocomplete/src Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,16 @@ function getVirtualLanguageService(): [
54
54
] ;
55
55
}
56
56
57
- function mapCompletions ( completions : ts . CompletionInfo ) {
57
+ type AutoCompletion = {
58
+ name : string ;
59
+ kind : ts . ScriptElementKind ;
60
+ type : string ;
61
+ } ;
62
+
63
+ function mapCompletions ( completions : ts . CompletionInfo ) : AutoCompletion [ ] {
58
64
return completions . entries . map ( ( entry ) => {
59
65
const declarations = entry . symbol ?. getDeclarations ( ) ;
66
+ console . log ( declarations . length ) ;
60
67
let type = 'any' ;
61
68
if ( declarations ?. [ 0 ] ) {
62
69
const decl = declarations [ 0 ] ;
@@ -79,7 +86,7 @@ export default class Autocompleter {
79
86
[ this . languageService , this . updateCode ] = getVirtualLanguageService ( ) ;
80
87
}
81
88
82
- autocomplete ( code : string , position ?: number ) {
89
+ autocomplete ( code : string , position ?: number ) : AutoCompletion [ ] {
83
90
if ( typeof position === 'undefined' ) {
84
91
position = code . length ;
85
92
}
You can’t perform that action at this time.
0 commit comments