Skip to content

Commit c98bf63

Browse files
committed
增加EditorBrowsable
1 parent 741032d commit c98bf63

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

WebApiClientCore.Analyzers/SourceGenerator/HttpApiProxyClass.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,16 @@ public SourceText ToSourceText()
8181
public override string ToString()
8282
{
8383
var builder = new StringBuilder();
84-
builder.AppendLine($"using System;");
85-
builder.AppendLine($"using System.Diagnostics;");
84+
builder.AppendLine("using System;");
85+
builder.AppendLine("using System.ComponentModel;");
86+
builder.AppendLine("using System.Diagnostics;");
8687

87-
builder.AppendLine($"#pragma warning disable CS8601");
88-
builder.AppendLine($"#pragma warning disable 1591");
88+
builder.AppendLine("#pragma warning disable CS8601");
89+
builder.AppendLine("#pragma warning disable 1591");
8990
builder.AppendLine($"namespace {this.Namespace}");
9091
builder.AppendLine("{");
9192

93+
builder.AppendLine($"\t[EditorBrowsable(EditorBrowsableState.Never)]");
9294
builder.AppendLine($"\t[DebuggerTypeProxy(typeof({this.httpApiFullName}))]");
9395
builder.AppendLine($"\t[HttpApiProxyClass(typeof({this.httpApiFullName}))]");
9496
builder.AppendLine($"\tpublic class {this.ClassName}:{this.httpApiFullName}");

WebApiClientCore.Analyzers/SourceGenerator/HttpApiProxyClassInitializer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ public override string ToString()
4343
{
4444
var builder = new StringBuilder();
4545
builder.AppendLine("#if NET5_0_OR_GREATER");
46+
builder.AppendLine("using System.ComponentModel;");
4647
builder.AppendLine("using System.Diagnostics.CodeAnalysis;");
4748
builder.AppendLine("using System.Runtime.CompilerServices;");
4849
builder.AppendLine($"namespace WebApiClientCore");
4950
builder.AppendLine("{");
5051
builder.AppendLine(" /// <summary>动态依赖初始化器</summary>");
52+
builder.AppendLine(" [EditorBrowsable(EditorBrowsableState.Never)]");
5153
builder.AppendLine($" static partial class {nameof(HttpApiProxyClassInitializer)}");
5254
builder.AppendLine(" {");
5355

0 commit comments

Comments
 (0)