public string GetTypeReferenceString (IType type, bool highlight = true) { if (type == null) throw new ArgumentNullException ("type"); AstType astType; try { astType = astBuilder.ConvertType (type); } catch (Exception e) { var compilation = GetCompilation (type); if (compilation == null) { Console.WriteLine ("type:"+type.GetType ()); Console.WriteLine ("got exception while conversion:" + e); return "?"; } astType = new TypeSystemAstBuilder (new CSharpResolver (compilation)).ConvertType (type); } if (astType is PrimitiveType) { return Highlight (astType.GetText (formattingOptions), colorStyle.KeywordTypes); } var text = AmbienceService.EscapeText (astType.GetText (formattingOptions)); return highlight ? HighlightSemantically (text, colorStyle.UserTypes) : text; }