File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
WebApiClientCore.Analyzers/SourceGenerator Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -31,12 +31,12 @@ sealed class HttpApiProxyClass : IEquatable<HttpApiProxyClass>
3131 /// <summary>
3232 /// 文件名
3333 /// </summary>
34- public string FileName => $ " { nameof ( HttpApiProxyClass ) } . { this . httpApi . ToDisplayString ( ) } .g.cs" ;
34+ public string FileName { get ; }
3535
3636 /// <summary>
3737 /// 类型名
3838 /// </summary>
39- public string ClassName => this . httpApi . Name ;
39+ public string ClassName { get ; }
4040
4141 /// <summary>
4242 /// HttpApi代理类
@@ -46,6 +46,10 @@ public HttpApiProxyClass(INamedTypeSymbol httpApi)
4646 {
4747 this . httpApi = httpApi ;
4848 this . httpApiFullName = GetFullName ( httpApi ) ;
49+
50+ var httpApiName = httpApi . ToDisplayString ( ) ;
51+ this . FileName = $ "{ nameof ( HttpApiProxyClass ) } .{ httpApiName } .g.cs";
52+ this . ClassName = httpApiName . Replace ( "." , "_" ) ;
4953 }
5054
5155 /// <summary>
@@ -63,7 +67,7 @@ private static string GetFullName(ISymbol symbol)
6367 /// </summary>
6468 /// <returns></returns>
6569 public SourceText ToSourceText ( )
66- {
70+ {
6771 var code = this . ToString ( ) ;
6872 return SourceText . From ( code , Encoding . UTF8 ) ;
6973 }
You can’t perform that action at this time.
0 commit comments