Skip to content

Add an optional parameter to enable generation of internal interfaces#76

Merged
ChristianSauer merged 2 commits intocodecentric:masterfrom
mtren:master
May 2, 2025
Merged

Add an optional parameter to enable generation of internal interfaces#76
ChristianSauer merged 2 commits intocodecentric:masterfrom
mtren:master

Conversation

@mtren
Copy link
Copy Markdown
Contributor

@mtren mtren commented Apr 11, 2025

No description provided.

Comment on lines +103 to +110
var generationAttribute = typeSymbol
.GetAttributes()
.FirstOrDefault(x =>
x.AttributeClass != null
&& x.AttributeClass.Name.Contains(AutomaticInterfaceGenerator.DefaultAttributeName)
);

if (generationAttribute == null)
Copy link
Copy Markdown
Contributor

@simonmckenzie simonmckenzie Apr 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a copy of the logic inside GetNameSpace:

private static string GetNameSpace(ISymbol typeSymbol)
{
var generationAttribute = typeSymbol
.GetAttributes()
.FirstOrDefault(x =>
x.AttributeClass != null
&& x.AttributeClass.Name.Contains(AutomaticInterfaceGenerator.DefaultAttributeName)
);
if (generationAttribute == null)

Could you perhaps extract the attribute retrieval logic into a separate method and retrieve it once, passing it to both GetNameSpace and GetAsInternal?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I have already covered this in #77 and adding the internal logic to the GeneratedSymbolDetails should likely be pretty straight forward.

@ChristianSauer ChristianSauer merged commit 8976723 into codecentric:master May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants