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(): [
5454 ] ;
5555}
5656
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 [ ] {
5864 return completions . entries . map ( ( entry ) => {
5965 const declarations = entry . symbol ?. getDeclarations ( ) ;
66+ console . log ( declarations . length ) ;
6067 let type = 'any' ;
6168 if ( declarations ?. [ 0 ] ) {
6269 const decl = declarations [ 0 ] ;
@@ -79,7 +86,7 @@ export default class Autocompleter {
7986 [ this . languageService , this . updateCode ] = getVirtualLanguageService ( ) ;
8087 }
8188
82- autocomplete ( code : string , position ?: number ) {
89+ autocomplete ( code : string , position ?: number ) : AutoCompletion [ ] {
8390 if ( typeof position === 'undefined' ) {
8491 position = code . length ;
8592 }
You can’t perform that action at this time.
0 commit comments