Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test plugin #3698

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open

Conversation

JoshLove-msft
Copy link
Contributor

@JoshLove-msft JoshLove-msft commented Jun 28, 2024

Adds a test plugin demonstrating simple tracing and customization of list setters.
Fixes #3672

@JoshLove-msft JoshLove-msft changed the title Split out plugins Add test plugin Jun 29, 2024
@@ -28,16 +26,20 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Generator.CSharp.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestProjects.Local.Tests", "TestProjects\ProjFiles\TestProjects.Local.Tests.csproj", "{3AEDFB67-39E3-4BB7-976E-F44F59402034}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Generator.CSharp.ClientModel", "Microsoft.Generator.CSharp.ClientModel\src\Microsoft.Generator.CSharp.ClientModel.csproj", "{3712A9A0-EDC4-4CB8-81E4-EBF4993EF350}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProjects.Plugin.Tests", "TestProjects\ProjFiles\TestProjects.Plugin.Tests.csproj", "{0E3D9973-FD30-4130-8652-26EF39B76D69}"
Copy link
Member

Choose a reason for hiding this comment

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

do we need this project still if we are collapsing plugins back together with their impl?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is the generated project for the test plugin.

Copy link
Member

Choose a reason for hiding this comment

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

would this exist if you had this sample plugin in the final samples location which might be in a different repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove these from solns and get rid of proj refs.

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

Microsoft.Generator.CSharp

@azure-sdk
Copy link
Collaborator

No changes needing a change description found.

{
public class ClientMethodProvider : MethodProvider
{
public ClientMethodProvider(MethodSignatureBase signature, MethodBodyStatement bodyStatements, TypeProvider enclosingType, XmlDocProvider? xmlDocProvider = default) : base(signature, bodyStatements, enclosingType, xmlDocProvider)
Copy link
Member

Choose a reason for hiding this comment

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

I think we should settle on a convention for prefixing overrides by mgc.cm. I think Scm makes sense, but we should be consistent throughout the library.

@@ -28,16 +26,20 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Generator.CSharp.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestProjects.Local.Tests", "TestProjects\ProjFiles\TestProjects.Local.Tests.csproj", "{3AEDFB67-39E3-4BB7-976E-F44F59402034}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Generator.CSharp.ClientModel", "Microsoft.Generator.CSharp.ClientModel\src\Microsoft.Generator.CSharp.ClientModel.csproj", "{3712A9A0-EDC4-4CB8-81E4-EBF4993EF350}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProjects.Plugin.Tests", "TestProjects\ProjFiles\TestProjects.Plugin.Tests.csproj", "{0E3D9973-FD30-4130-8652-26EF39B76D69}"
Copy link
Member

Choose a reason for hiding this comment

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

would this exist if you had this sample plugin in the final samples location which might be in a different repo?

EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProjects.Plugin.Tests", "TestProjects\ProjFiles\TestProjects.Plugin.Tests.csproj", "{0E3D9973-FD30-4130-8652-26EF39B76D69}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamplePlugin", "SamplePlugin\src\SamplePlugin.csproj", "{6825281D-C6BD-4E34-9F60-109D164EC928}"
Copy link
Member

Choose a reason for hiding this comment

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

same comment as above, I don't think this should be here given samples won't live here.

/// Converts an expression-based method provider to a method provider with <see cref="BodyStatements"/> populated. If the instance already has body statements, it is returned as is.
/// </summary>
/// <returns>An instance of a <see cref="MethodProvider"/> with <see cref="BodyStatements"/> populated.</returns>
public MethodProvider ToBodyStatementMethodProvider()
Copy link
Member

Choose a reason for hiding this comment

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

Feels like an internal helper not something we want as a public API.

github-merge-queue bot pushed a commit that referenced this pull request Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add plugin example demonstrating tracing
3 participants