File tree Expand file tree Collapse file tree 1 file changed +5
-19
lines changed
packages/language-service/src Expand file tree Collapse file tree 1 file changed +5
-19
lines changed Original file line number Diff line number Diff line change @@ -244,16 +244,7 @@ class TypeWrapper implements Symbol {
244
244
}
245
245
}
246
246
247
- get name ( ) : string {
248
- const symbol = this . tsType . symbol ;
249
- if ( symbol ) {
250
- return symbol . name ;
251
- } else {
252
- // A primitive type (e.g. 'string') doesn't have Symbol,
253
- // so use the ts.TypeChecker to get the type name.
254
- return this . context . checker . typeToString ( this . tsType ) ;
255
- }
256
- }
247
+ get name ( ) : string { return this . context . checker . typeToString ( this . tsType ) ; }
257
248
258
249
public readonly kind : DeclarationKind = 'type' ;
259
250
@@ -617,15 +608,10 @@ class PipeSymbol implements Symbol {
617
608
let resultType : ts . Type | undefined = undefined ;
618
609
switch ( this . name ) {
619
610
case 'async' :
620
- switch ( parameterType . name ) {
621
- case 'Observable' :
622
- case 'Promise' :
623
- case 'EventEmitter' :
624
- resultType = getTypeParameterOf ( parameterType . tsType , parameterType . name ) ;
625
- break ;
626
- default :
627
- resultType = getTsTypeFromBuiltinType ( BuiltinType . Any , this . context ) ;
628
- break ;
611
+ // Get symbol of 'Observable', 'Promise', or 'EventEmitter' type.
612
+ const symbol = parameterType . tsType . symbol ;
613
+ if ( symbol ) {
614
+ resultType = getTypeParameterOf ( parameterType . tsType , symbol . name ) ;
629
615
}
630
616
break ;
631
617
case 'slice' :
You can’t perform that action at this time.
0 commit comments