From 2f934c39c255dea2eb77ad89072dd5c1514a876c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 17:08:23 +0000 Subject: [PATCH 1/2] Initial plan From 5b5af521587d14f5d55da4228f5efaeb3db26599 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 17:25:56 +0000 Subject: [PATCH 2/2] Add Accept/Visit for ExpressionStatement and InvokeMethodExpression; clean up no-op assignments Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- ...pilot-add-visit-implementations-2026-03-04-17-09-00.md | 8 ++++++++ .../src/Expressions/InvokeMethodExpression.cs | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .chronus/changes/copilot-add-visit-implementations-2026-03-04-17-09-00.md diff --git a/.chronus/changes/copilot-add-visit-implementations-2026-03-04-17-09-00.md b/.chronus/changes/copilot-add-visit-implementations-2026-03-04-17-09-00.md new file mode 100644 index 00000000000..09af01cd381 --- /dev/null +++ b/.chronus/changes/copilot-add-visit-implementations-2026-03-04-17-09-00.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking +changeKind: internal +packages: + - "@typespec/http-client-csharp" +--- + +Add `Accept`/`Visit` support for `ExpressionStatement` and `InvokeMethodExpression` to the `LibraryVisitor`. This allows visitors to intercept and modify these nodes during code generation. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Expressions/InvokeMethodExpression.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Expressions/InvokeMethodExpression.cs index 5c312307d7f..ed169b2aec8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Expressions/InvokeMethodExpression.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Expressions/InvokeMethodExpression.cs @@ -131,12 +131,6 @@ internal override void Write(CodeWriter writer) invokeMethod.InstanceReference = newInstanceReference; invokeMethod.Arguments = arguments; - invokeMethod.MethodName = invokeMethod.MethodName; - invokeMethod.MethodSignature = invokeMethod.MethodSignature; - invokeMethod.TypeArguments = invokeMethod.TypeArguments; - invokeMethod.CallAsAsync = invokeMethod.CallAsAsync; - invokeMethod.AddConfigureAwaitFalse = invokeMethod.AddConfigureAwaitFalse; - invokeMethod.ExtensionType = invokeMethod.ExtensionType; return invokeMethod; }