@@ -87,7 +87,6 @@ internal static (
8787 var context = CreateGenerationContext (
8888 compilation ,
8989 diagnostics ,
90- refitInternalNamespace ,
9190 httpMethodBaseAttributeSymbol ,
9291 generatedRequestBuilding ,
9392 emitGeneratedCodeMarkers ,
@@ -101,7 +100,6 @@ internal static (
101100
102101 var contextGenerationSpec = new ContextGenerationModel (
103102 refitInternalNamespace ,
104- context . Options . PreserveAttributeDisplayName ,
105103 generatedClassName ,
106104 generatedRequestBuilding ,
107105 emitGeneratedCodeMarkers ,
@@ -126,7 +124,6 @@ internal static (List<Diagnostic> Diagnostics, ContextGenerationModel ContextGen
126124 diagnostics ,
127125 new (
128126 refitInternalNamespace ,
129- string . Empty ,
130127 generatedClassName ,
131128 generatedRequestBuilding ,
132129 emitGeneratedCodeMarkers ,
@@ -136,7 +133,6 @@ internal static (List<Diagnostic> Diagnostics, ContextGenerationModel ContextGen
136133 /// <summary>Resolves the well-known symbols and language capabilities used throughout a single generation pass.</summary>
137134 /// <param name="compilation">The compilation.</param>
138135 /// <param name="diagnostics">The list that collects diagnostics produced during processing.</param>
139- /// <param name="refitInternalNamespace">The resolved internal generated namespace.</param>
140136 /// <param name="httpMethodBaseAttributeSymbol">The resolved Refit HTTP method attribute symbol.</param>
141137 /// <param name="generatedRequestBuilding">Whether generated request construction is enabled.</param>
142138 /// <param name="emitGeneratedCodeMarkers">Whether generated files include generated-code analyzer skip markers.</param>
@@ -145,7 +141,6 @@ internal static (List<Diagnostic> Diagnostics, ContextGenerationModel ContextGen
145141 internal static InterfaceGenerationContext CreateGenerationContext (
146142 CSharpCompilation compilation ,
147143 List < Diagnostic > diagnostics ,
148- string refitInternalNamespace ,
149144 INamedTypeSymbol httpMethodBaseAttributeSymbol ,
150145 bool generatedRequestBuilding ,
151146 bool emitGeneratedCodeMarkers ,
@@ -167,13 +162,6 @@ internal static InterfaceGenerationContext CreateGenerationContext(
167162 var supportsNullable = options . LanguageVersion >= LanguageVersion . CSharp8 ;
168163 var supportsStaticLambdas = options . LanguageVersion >= LanguageVersion . CSharp9 ;
169164
170- // The PreserveAttribute is emitted into the consumer's compilation by the emitter
171- // (see Emitter.EmitSharedCode). Its fully-qualified display name is fully determined
172- // by refitInternalNamespace, so we compute it directly instead of round-tripping
173- // through compilation.AddSyntaxTrees + GetTypeByMetadataName + ToDisplayString on
174- // every generator pass, which mutated the compilation and forced an extra bind.
175- var preserveAttributeDisplayName = $ "global::{ refitInternalNamespace } .PreserveAttribute";
176-
177165 // The generated implementation container folds in the assembly name so each assembly emits a distinctly named
178166 // container; UniqueName reconstructs the identical name at runtime for reflection-based resolution.
179167 var generatedClassName = GeneratedTypeNaming . BuildGeneratedContainerName ( compilation . AssemblyName ) ;
@@ -185,7 +173,7 @@ internal static InterfaceGenerationContext CreateGenerationContext(
185173
186174 return new (
187175 diagnostics ,
188- new GenerationOptionsModel ( preserveAttributeDisplayName , generatedClassName , generatedRequestBuilding , emitGeneratedCodeMarkers ) ,
176+ new GenerationOptionsModel ( generatedClassName , generatedRequestBuilding , emitGeneratedCodeMarkers ) ,
189177 new GenerationSymbolsModel (
190178 disposableInterfaceSymbol ,
191179 httpMethodBaseAttributeSymbol ,
@@ -394,7 +382,6 @@ internal static InterfaceModel ProcessInterface(
394382 names . InterfaceDisplayName ,
395383 names . ClassSuffix ) ,
396384 new InterfaceOptionsModel (
397- context . Options . PreserveAttributeDisplayName ,
398385 context . Options . GeneratedRequestBuilding ,
399386 context . Options . EmitGeneratedCodeMarkers ,
400387 context . Capabilities . SupportsNullable ,
0 commit comments