XFEExtension
【DLL】XFE各类拓展是一个C#的DLL库,旨在优化C#代码中常用语句的使用,并提供更简洁的访问方式,同时提供Xunit测试框架,快速搭建服务器/客户端,免费ChatGPTAPI接口,免费通讯服务器,XFE下载器,新增格式等
关注
0
Fork
0
Star
0
返回提交历史
Modified
XFEExtension.NetCore.Analyzer/Generator/ProfilePropertyAutoGenerator.cs
+3
-4
XFEstudio/XFEExtension
修复添加多余注释的bug
154fd73
代码差异
1 个文件
+3
-4
@@ -55,7 +55,8 @@ namespace XFEExtension.NetCore.Analyzer.Generator
55
55
});
56
56
var propertyType = fieldDeclarationSyntax.Declaration.Type;
57
57
#region Trivia头
58
var triviaText = $@"/// <remarks>
58
var triviaText = $@"/// <inheritdoc cref=""{fieldName}""/>
59
/// <remarks>
59
60
/// <seealso cref=""{propertyName}""/> 是根据 <seealso cref=""{fieldName}""/> 自动生成的属性<br/><br/>
60
61
/// <code><seealso langword=""get""/>方法已生成以下代码:";
61
62
#endregion
@@ -168,8 +169,6 @@ namespace XFEExtension.NetCore.Analyzer.Generator
168
169
/// </remarks>
169
170
";
170
171
#endregion
171
var leadingTrivia = fieldDeclarationSyntax.DescendantTrivia().ToList();
172
leadingTrivia.AddRange(SyntaxFactory.ParseLeadingTrivia(triviaText));
173
172
var property = SyntaxFactory.PropertyDeclaration(propertyType, propertyName)
174
173
.WithModifiers(SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)))
175
174
.AddAttributeLists(attributeSyntax)
@@ -181,7 +180,7 @@ namespace XFEExtension.NetCore.Analyzer.Generator
181
180
SyntaxFactory.AccessorDeclaration(SyntaxKind.SetAccessorDeclaration)
182
181
.WithBody(SyntaxFactory.Block(setExpressionStatements))
183
182
})))
184
.WithLeadingTrivia(leadingTrivia);
183
.WithLeadingTrivia(SyntaxFactory.ParseLeadingTrivia(triviaText));
185
184
return property.NormalizeWhitespace();
186
185
});
187
186
var profileClassSyntaxTree = GenerateProfileClassSyntaxTree(classDeclaration, usingDirectives, properties, fileScopedNamespaceDeclarationSyntax);