#NEWLINE# def parse_tpe( self , tpe , is_tooltip ) : #NEWLINE# #INDENT# if ( tpe and ( tpe . name != '<notype>' ) ) : #NEWLINE# #INDENT# if tpe . arrow_type : #NEWLINE# #INDENT# param_sections = tpe . param_sections #NEWLINE# type_info = tpe . result_type #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# param_sections = [ ] #NEWLINE# type_info = tpe #NEWLINE# #UNINDENT# type_desc = tpe . name #NEWLINE# if EnsimeInspectType . tuple_regex . match ( type_info . name ) : #NEWLINE# #INDENT# ( begin , end ) = ( '(' , ')' ) #NEWLINE# res = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( begin , end ) = ( '[' , ']' ) #NEWLINE# ( full_name , name ) = ( type_info . full_name , type_info . name ) #NEWLINE# if is_tooltip : #NEWLINE# #INDENT# type_args = ( '' if ( type_desc [ 0 ] != '[' ) else html . escape ( type_desc [ 0 : ( type_desc . find ( '](' ) + 1 ) ] ) ) #NEWLINE# param_section_list = '' . join ( [ self . format_param_list ( ps , begin , end , is_tooltip ) for ps in param_sections ] ) #NEWLINE# res = '<a href={0}>{1}</a>' . format ( html . escape ( full_name ) , html . escape ( name ) ) #NEWLINE# if param_section_list : #NEWLINE# #INDENT# res = '{0}{1}: {2}' . format ( type_args , param_section_list , res ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# res = name #NEWLINE# last_paren = type_desc . rfind ( ')' ) #NEWLINE# type_desc_sans_return = type_desc [ 0 : ( last_paren + 1 ) ] #NEWLINE# if type_desc_sans_return : #NEWLINE# #INDENT# res = '{0}: {1}' . format ( type_desc_sans_return , res ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if type_info . type_args : #NEWLINE# #INDENT# res += ( ( begin + ', ' . join ( [ self . parse_tpe ( t , is_tooltip ) for t in type_info . type_args ] ) ) + end ) #NEWLINE# #UNINDENT# return res #NEWLINE# #UNINDENT# return None