diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/SystemExtensibleSnippets.SystemRestOperationsSnippets.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/SystemExtensibleSnippets.SystemRestOperationsSnippets.cs index ff73cced5a..0cb7582719 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/SystemExtensibleSnippets.SystemRestOperationsSnippets.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/SystemExtensibleSnippets.SystemRestOperationsSnippets.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; @@ -63,11 +63,6 @@ public override MethodBodyStatement DeclareContentWithUtf8JsonWriter(out TypedVa return Snippets.Var(contentVar, Snippets.New.Instance(typeof(Utf8JsonRequestBody))); } - public override MethodBodyStatement DeclareContentWithXmlWriter(out TypedValueExpression content, out XmlWriterExpression writer) - { - throw new NotImplementedException("Xml serialization isn't supported in System.Net.ClientModel yet"); - } - public override MethodBodyStatement InvokeServiceOperationCallAndReturnHeadAsBool(TypedValueExpression pipeline, TypedValueExpression message, TypedValueExpression clientDiagnostics, bool async) { var resultVar = new VariableReference(typeof(NullableResult), "result"); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/SystemExtensibleSnippets.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/SystemExtensibleSnippets.cs index 7f223637de..82c32c036f 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/SystemExtensibleSnippets.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/SystemExtensibleSnippets.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; @@ -9,8 +9,6 @@ namespace Microsoft.Generator.CSharp.ClientModel.Expressions internal partial class SystemExtensibleSnippets : ExtensibleSnippets { public override JsonElementSnippets JsonElement { get; } = new SystemJsonElementSnippets(); - public override XElementSnippets XElement => throw new NotImplementedException("XElement extensions aren't supported in ClientModel plugin yet."); - public override XmlWriterSnippets XmlWriter => throw new NotImplementedException("XmlWriter extensions aren't supported in ClientModel plugin yet."); public override RestOperationsSnippets RestOperations { get; } = new SystemRestOperationsSnippets(); public override ModelSnippets Model { get; } = new SystemModelSnippets(); } diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Serialization/SerializationFormat.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/Serialization/SerializationFormat.cs similarity index 83% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Serialization/SerializationFormat.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/Serialization/SerializationFormat.cs index e38fcd8203..157174b79d 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Serialization/SerializationFormat.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/Serialization/SerializationFormat.cs @@ -1,7 +1,7 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -namespace Microsoft.Generator.CSharp +namespace Microsoft.Generator.CSharp.Input { /// /// Represents the set of known serialization formats. diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CSharpGen.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CSharpGen.cs index 1671ade4ce..038291ff9d 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CSharpGen.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CSharpGen.cs @@ -6,13 +6,15 @@ using System.IO; using System.Linq; using System.Threading.Tasks; -using Microsoft.Generator.CSharp.Writers; namespace Microsoft.Generator.CSharp { public sealed class CSharpGen { - private static readonly string[] _filesToKeep = [Constants.DefaultCodeModelFileName, Constants.DefaultConfigurationFileName]; + private const string ConfigurationFileName = "Configuration.json"; + private const string CodeModelFileName = "tspCodeModel.json"; + + private static readonly string[] _filesToKeep = [ConfigurationFileName, CodeModelFileName]; /// /// Executes the generator task with the instance. @@ -21,7 +23,7 @@ public async Task ExecuteAsync() { GeneratedCodeWorkspace.Initialize(); var outputPath = CodeModelPlugin.Instance.Configuration.OutputDirectory; - var generatedTestOutputPath = Path.Combine(outputPath, "..", "..", "tests", Constants.DefaultGeneratedCodeFolderName); + var generatedTestOutputPath = Path.Combine(outputPath, "..", "..", "tests", "Generated"); GeneratedCodeWorkspace workspace = await GeneratedCodeWorkspace.Create(); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Constants.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Constants.cs deleted file mode 100644 index 795ae10192..0000000000 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Constants.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Microsoft.Generator.CSharp -{ - /// - /// Constants shared between the components of the core generator. - /// - internal static class Constants - { - /// - /// The default name of the generated code folder that the generator will output to. - /// - public const string DefaultGeneratedCodeFolderName = "Generated"; - - /// - /// The default name of the generated test folder that the generator will output to. - /// - public const string DefaultGeneratedTestFolderName = "GeneratedTests"; - - /// - /// The default name of the generated code folder in the project workspace.. - /// - public const string DefaultGeneratedCodeProjectFolderName = "GeneratedCode"; - - /// - /// The default name of the configuration file. - /// - public const string DefaultConfigurationFileName = "Configuration.json"; - - /// - /// The default name of the code model file. - /// - public const string DefaultCodeModelFileName = "tspCodeModel.json"; - - /// - /// The error message when the configuration has not been initialized. - /// - public const string ConfigurationNotInitializedError = "Configuration has not been initialized."; - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ArrayElementExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ArrayElementExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ArrayElementExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ArrayElementExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ArrayInitializerExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ArrayInitializerExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ArrayInitializerExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ArrayInitializerExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/AsExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/AsExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/AsExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/AsExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/AssignmentExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/AssignmentExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/AssignmentExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/AssignmentExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/BinaryDataExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/BinaryDataExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/BinaryDataExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/BinaryDataExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/BinaryOperatorExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/BinaryOperatorExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/BinaryOperatorExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/BinaryOperatorExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/BoolExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/BoolExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/BoolExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/BoolExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/CancellationTokenExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/CancellationTokenExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/CancellationTokenExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/CancellationTokenExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/CastExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/CastExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/CastExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/CastExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/CharExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/CharExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/CharExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/CharExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/CollectionInitializerExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/CollectionInitializerExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/CollectionInitializerExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/CollectionInitializerExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/DateTimeOffsetExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/DateTimeOffsetExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/DateTimeOffsetExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/DateTimeOffsetExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/DeclarationExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/DeclarationExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/DeclarationExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/DeclarationExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/DictionaryExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/DictionaryExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/DictionaryExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/DictionaryExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/DictionaryInitializerExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/DictionaryInitializerExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/DictionaryInitializerExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/DictionaryInitializerExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/DoubleExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/DoubleExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/DoubleExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/DoubleExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/EnumExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/EnumExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/EnumExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/EnumExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/EnumerableExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/EnumerableExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/EnumerableExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/EnumerableExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/EnvironmentExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/EnvironmentExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/EnvironmentExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/EnvironmentExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.XElementSnippets.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.XElementSnippets.cs deleted file mode 100644 index 9e0bb649d1..0000000000 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.XElementSnippets.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Microsoft.Generator.CSharp.Expressions -{ - public abstract partial class ExtensibleSnippets - { - public abstract class XElementSnippets - { - public abstract ValueExpression GetBytesFromBase64Value(XElementExpression xElement, string? format); - public abstract ValueExpression GetDateTimeOffsetValue(XElementExpression xElement, string? format); - public abstract ValueExpression GetObjectValue(XElementExpression xElement, string? format); - public abstract ValueExpression GetTimeSpanValue(XElementExpression xElement, string? format); - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.XmlWriterSnippets.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.XmlWriterSnippets.cs deleted file mode 100644 index b5e097f9e8..0000000000 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.XmlWriterSnippets.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Microsoft.Generator.CSharp.Expressions -{ - public abstract partial class ExtensibleSnippets - { - public abstract class XmlWriterSnippets - { - public abstract MethodBodyStatement WriteValue(XmlWriterExpression xmlWriter, ValueExpression value, string format); - public abstract MethodBodyStatement WriteObjectValue(XmlWriterExpression xmlWriter, ValueExpression value, string? nameHint); - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/FormattableStringExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/FormattableStringExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/FormattableStringExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/FormattableStringExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/FormattableStringToExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/FormattableStringToExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/FormattableStringToExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/FormattableStringToExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/FrameworkTypeExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/FrameworkTypeExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/FrameworkTypeExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/FrameworkTypeExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/FuncExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/FuncExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/FuncExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/FuncExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/IndexerExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/IndexerExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/IndexerExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/IndexerExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/InitializerExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/InitializerExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/InitializerExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/InitializerExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/IntExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/IntExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/IntExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/IntExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/InvokeInstanceMethodExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/InvokeInstanceMethodExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/InvokeInstanceMethodExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/InvokeInstanceMethodExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/InvokeStaticMethodExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/InvokeStaticMethodExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/InvokeStaticMethodExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/InvokeStaticMethodExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/JsonDocumentExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/JsonDocumentExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/JsonDocumentExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/JsonDocumentExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/JsonElementExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/JsonElementExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/JsonElementExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/JsonElementExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/JsonPropertyExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/JsonPropertyExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/JsonPropertyExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/JsonPropertyExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/JsonSerializerExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/JsonSerializerExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/JsonSerializerExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/JsonSerializerExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/JsonValueKindExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/JsonValueKindExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/JsonValueKindExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/JsonValueKindExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/KeyValuePairExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/KeyValuePairExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/KeyValuePairExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/KeyValuePairExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/KeywordExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/KeywordExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/KeywordExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/KeywordExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ListExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ListExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ListExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ListExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/LiteralExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/LiteralExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/LiteralExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/LiteralExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/LongExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/LongExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/LongExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/LongExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/MemberExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/MemberExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/MemberExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/MemberExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/NewArrayExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/NewArrayExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/NewArrayExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/NewArrayExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/NewDictionaryExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/NewDictionaryExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/NewDictionaryExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/NewDictionaryExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/NewInstanceExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/NewInstanceExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/NewInstanceExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/NewInstanceExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/NewJsonSerializerOptionsExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/NewJsonSerializerOptionsExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/NewJsonSerializerOptionsExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/NewJsonSerializerOptionsExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/NullConditionalExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/NullConditionalExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/NullConditionalExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/NullConditionalExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ObjectInitializerExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ObjectInitializerExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ObjectInitializerExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ObjectInitializerExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ObjectTypeExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ObjectTypeExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ObjectTypeExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ObjectTypeExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ParameterReference.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ParameterReference.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ParameterReference.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ParameterReference.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/PositionalParameterReference.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/PositionalParameterReference.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/PositionalParameterReference.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/PositionalParameterReference.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/StreamExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/StreamExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/StreamExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/StreamExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/StreamReaderExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/StreamReaderExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/StreamReaderExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/StreamReaderExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/StringBuilderExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/StringBuilderExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/StringBuilderExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/StringBuilderExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/StringExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/StringExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/StringExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/StringExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/StringLiteralExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/StringLiteralExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/StringLiteralExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/StringLiteralExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/SwitchCaseExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/SwitchCaseExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/SwitchCaseExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/SwitchCaseExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/SwitchCaseWhenExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/SwitchCaseWhenExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/SwitchCaseWhenExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/SwitchCaseWhenExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/SwitchExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/SwitchExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/SwitchExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/SwitchExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TernaryConditionalOperator.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TernaryConditionalOperator.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TernaryConditionalOperator.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TernaryConditionalOperator.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TimeSpanExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TimeSpanExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TimeSpanExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TimeSpanExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypeReference.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypeReference.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypeReference.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypeReference.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypedFuncExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypedFuncExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypedFuncExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypedFuncExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypedMemberExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypedMemberExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypedMemberExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypedMemberExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypedNullConditionalExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypedNullConditionalExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypedNullConditionalExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypedNullConditionalExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypedTernaryConditionalOperator.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypedTernaryConditionalOperator.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypedTernaryConditionalOperator.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypedTernaryConditionalOperator.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypedValueExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypedValueExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypedValueExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypedValueExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypedValueExpressionOfT.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypedValueExpressionOfT.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/TypedValueExpressionOfT.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/TypedValueExpressionOfT.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/UnaryOperatorExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/UnaryOperatorExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/UnaryOperatorExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/UnaryOperatorExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/Utf8JsonWriterExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Utf8JsonWriterExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/Utf8JsonWriterExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Utf8JsonWriterExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ValueExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/ValueExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XAttributeExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XAttributeExpression.cs deleted file mode 100644 index de795b4a7f..0000000000 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XAttributeExpression.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Xml.Linq; - -namespace Microsoft.Generator.CSharp.Expressions -{ - public sealed record XAttributeExpression(ValueExpression Untyped) : TypedValueExpression(Untyped) - { - public XNameExpression Name => new(Property(nameof(XAttribute.Name))); - public StringExpression Value => new(Property(nameof(XAttribute.Value))); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XDocumentExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XDocumentExpression.cs deleted file mode 100644 index da3dc34b20..0000000000 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XDocumentExpression.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Xml.Linq; - -namespace Microsoft.Generator.CSharp.Expressions -{ - public sealed record XDocumentExpression(ValueExpression Untyped) : TypedValueExpression(Untyped) - { - public static XDocumentExpression Load(StreamExpression stream, LoadOptions loadOptions) - => new(InvokeStatic(nameof(XDocument.Load), stream, Snippets.FrameworkEnumValue(loadOptions))); - - public XElementExpression Element(string name) => new(Invoke(nameof(XDocument.Element), Snippets.Literal(name))); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XElementExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XElementExpression.cs deleted file mode 100644 index 30cdee232e..0000000000 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XElementExpression.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Xml.Linq; -using static Microsoft.Generator.CSharp.Expressions.Snippets; - -namespace Microsoft.Generator.CSharp.Expressions -{ - public sealed record XElementExpression(ValueExpression Untyped) : TypedValueExpression(Untyped) - { - public XNameExpression Name => new(Property(nameof(XElement.Name))); - public StringExpression Value => new(Property(nameof(XElement.Value))); - - public XAttributeExpression Attribute(string name) - => new(Invoke(nameof(XElement.Attribute), Literal(name))); - - public ValueExpression GetBytesFromBase64Value(string? format) => Extensible.XElement.GetBytesFromBase64Value(this, format); - public ValueExpression GetDateTimeOffsetValue(string? format) => Extensible.XElement.GetDateTimeOffsetValue(this, format); - public ValueExpression GetObjectValue(string? format) => Extensible.XElement.GetObjectValue(this, format); - public ValueExpression GetTimeSpanValue(string? format) => Extensible.XElement.GetTimeSpanValue(this, format); - - public static XElementExpression Load(StreamExpression stream) => new(new InvokeStaticMethodExpression(typeof(XElement), nameof(XElement.Load), new[] { stream })); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XNameExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XNameExpression.cs deleted file mode 100644 index 16a6396973..0000000000 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XNameExpression.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Xml.Linq; - -namespace Microsoft.Generator.CSharp.Expressions -{ - public sealed record XNameExpression(ValueExpression Untyped) : TypedValueExpression(Untyped) - { - public StringExpression LocalName => new(Property(nameof(XName.LocalName))); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XmlWriterExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XmlWriterExpression.cs deleted file mode 100644 index 27b3f7bd9c..0000000000 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/XmlWriterExpression.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Xml; -using static Microsoft.Generator.CSharp.Expressions.Snippets; - -namespace Microsoft.Generator.CSharp.Expressions -{ - public sealed record XmlWriterExpression(ValueExpression Untyped) : TypedValueExpression(Untyped) - { - public MethodBodyStatement WriteStartAttribute(string localName) => new InvokeInstanceMethodStatement(Untyped, nameof(XmlWriter.WriteStartAttribute), Literal(localName)); - public MethodBodyStatement WriteEndAttribute() => new InvokeInstanceMethodStatement(Untyped, nameof(XmlWriter.WriteEndAttribute)); - - public MethodBodyStatement WriteStartElement(string localName) => WriteStartElement(Literal(localName)); - public MethodBodyStatement WriteStartElement(ValueExpression localName) => new InvokeInstanceMethodStatement(Untyped, nameof(XmlWriter.WriteStartElement), localName); - public MethodBodyStatement WriteEndElement() => new InvokeInstanceMethodStatement(Untyped, nameof(XmlWriter.WriteEndElement)); - - public MethodBodyStatement WriteValue(ValueExpression value) => new InvokeInstanceMethodStatement(Untyped, nameof(XmlWriter.WriteValue), value); - public MethodBodyStatement WriteValue(ValueExpression value, string format) => Extensible.XmlWriter.WriteValue(this, value, format); - - public MethodBodyStatement WriteValue(ValueExpression value, Type frameworkType, SerializationFormat format) - { - bool writeFormat = frameworkType == typeof(byte[]) || - frameworkType == typeof(DateTimeOffset) || - frameworkType == typeof(DateTime) || - frameworkType == typeof(TimeSpan); - return writeFormat && format.ToFormatSpecifier() is { } formatSpecifier - ? WriteValue(value, formatSpecifier) - : WriteValue(value); - } - - public MethodBodyStatement WriteObjectValue(ValueExpression value, string? nameHint) => Extensible.XmlWriter.WriteObjectValue(this, value, nameHint); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/VariableReference.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/VariableReference.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/VariableReference.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/VariableReference.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/WhereExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/WhereExpression.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ValueExpressions/WhereExpression.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/WhereExpression.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Serialization/SerializationFormatExtensions.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Serialization/SerializationFormatExtensions.cs deleted file mode 100644 index 43675dc90f..0000000000 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Serialization/SerializationFormatExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Microsoft.Generator.CSharp -{ - internal static class SerializationFormatExtensions - { - public static string? ToFormatSpecifier(this SerializationFormat format) => format switch - { - SerializationFormat.DateTime_RFC1123 => "R", - SerializationFormat.DateTime_RFC3339 => "O", - SerializationFormat.DateTime_RFC7231 => "R", - SerializationFormat.DateTime_ISO8601 => "O", - SerializationFormat.Date_ISO8601 => "D", - SerializationFormat.DateTime_Unix => "U", - SerializationFormat.Bytes_Base64Url => "U", - SerializationFormat.Bytes_Base64 => "D", - SerializationFormat.Duration_ISO8601 => "P", - SerializationFormat.Duration_Constant => "c", - SerializationFormat.Duration_Seconds => "%s", - SerializationFormat.Duration_Seconds_Float => "s\\.fff", - SerializationFormat.Time_ISO8601 => "T", - _ => null - }; - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/ApiTypes.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ApiTypes.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/ApiTypes.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ApiTypes.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/AutoPropertyBody.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/AutoPropertyBody.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/AutoPropertyBody.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/AutoPropertyBody.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CSharpAttribute.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/CSharpAttribute.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CSharpAttribute.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/CSharpAttribute.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/CSharpMethod.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/CSharpMethod.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/CSharpMethod.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/CSharpMethod.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/CSharpMethodCollection.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/CSharpMethodCollection.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/CSharpMethodCollection.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/CSharpMethodCollection.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/CSharpMethodKinds.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/CSharpMethodKinds.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/CSharpMethodKinds.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/CSharpMethodKinds.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CSharpType.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/CSharpType.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CSharpType.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/CSharpType.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/ClientTypeProvider.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ClientTypeProvider.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/ClientTypeProvider.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ClientTypeProvider.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/ConstructorInitializer.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ConstructorInitializer.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/ConstructorInitializer.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ConstructorInitializer.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/ConstructorSignature.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ConstructorSignature.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/ConstructorSignature.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ConstructorSignature.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Requests/Diagnostic.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/Diagnostic.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Requests/Diagnostic.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/Diagnostic.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Requests/DiagnosticAttribute.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/DiagnosticAttribute.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Requests/DiagnosticAttribute.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/DiagnosticAttribute.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/EnumType.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/EnumType.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/EnumType.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/EnumType.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/ExpressionPropertyBody.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ExpressionPropertyBody.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/ExpressionPropertyBody.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ExpressionPropertyBody.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/FieldDeclaration.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/FieldDeclaration.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/FieldDeclaration.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/FieldDeclaration.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/FieldModifiers.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/FieldModifiers.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/FieldModifiers.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/FieldModifiers.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/IndexerDeclaration.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/IndexerDeclaration.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/IndexerDeclaration.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/IndexerDeclaration.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/KnownParameters.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/KnownParameters.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/KnownParameters.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/KnownParameters.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/MethodPropertyBody.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/MethodPropertyBody.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/MethodPropertyBody.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/MethodPropertyBody.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/MethodSignature.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/MethodSignature.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/MethodSignature.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/MethodSignature.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/MethodSignatureBase.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/MethodSignatureBase.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/MethodSignatureBase.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/MethodSignatureBase.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/MethodSignatureModifiers.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/MethodSignatureModifiers.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/MethodSignatureModifiers.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/MethodSignatureModifiers.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/ModelTypeProvider.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ModelTypeProvider.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/ModelTypeProvider.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ModelTypeProvider.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/OutputLibrary.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/OutputLibrary.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/OutputLibrary.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/OutputLibrary.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Parameter.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/Parameter.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Parameter.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/Parameter.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/PropertyBody.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/PropertyBody.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/PropertyBody.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/PropertyBody.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/PropertyDeclaration.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/PropertyDeclaration.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/PropertyDeclaration.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/PropertyDeclaration.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/PropertyDescriptionBuilder.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/PropertyDescriptionBuilder.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/PropertyDescriptionBuilder.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/PropertyDescriptionBuilder.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/TypeFactory.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/TypeFactory.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/TypeFactory.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/TypeFactory.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/TypeProvider.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/TypeProvider.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/TypeProvider.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/TypeProvider.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/TypeSignatureModifiers.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/TypeSignatureModifiers.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/TypeSignatureModifiers.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/TypeSignatureModifiers.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/ValidationType.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ValidationType.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/ValidationType.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/OutputTypes/ValidationType.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/GeneratedCodeWorkspace.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/PostProcessing/GeneratedCodeWorkspace.cs similarity index 96% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/GeneratedCodeWorkspace.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/PostProcessing/GeneratedCodeWorkspace.cs index 9169b4c451..83f012e1e4 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/GeneratedCodeWorkspace.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/PostProcessing/GeneratedCodeWorkspace.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; @@ -18,8 +18,8 @@ namespace Microsoft.Generator.CSharp { internal class GeneratedCodeWorkspace { - public static readonly string GeneratedFolder = Constants.DefaultGeneratedCodeFolderName; - public static readonly string GeneratedTestFolder = Constants.DefaultGeneratedTestFolderName; + private const string GeneratedFolder = "Generated"; + private const string GeneratedCodeProjectName = "GeneratedCode"; private static readonly Lazy> _assemblyMetadataReferences = new(() => new List() { MetadataReference.CreateFromFile(typeof(object).Assembly.Location) }); @@ -116,7 +116,7 @@ private static Project CreateGeneratedCodeProject() var workspace = new AdhocWorkspace(); var newOptionSet = workspace.Options.WithChangedOption(FormattingOptions.NewLine, LanguageNames.CSharp, _newLine); workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(newOptionSet)); - Project generatedCodeProject = workspace.AddProject(Constants.DefaultGeneratedCodeProjectFolderName, LanguageNames.CSharp); + Project generatedCodeProject = workspace.AddProject(GeneratedCodeProjectName, LanguageNames.CSharp); generatedCodeProject = generatedCodeProject .AddMetadataReferences(_assemblyMetadataReferences.Value) diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SA1505Rewriter.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/PostProcessing/SA1505Rewriter.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SA1505Rewriter.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/PostProcessing/SA1505Rewriter.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/WorkspaceMetadataReferenceResolver.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/PostProcessing/WorkspaceMetadataReferenceResolver.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/WorkspaceMetadataReferenceResolver.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/PostProcessing/WorkspaceMetadataReferenceResolver.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.JsonElementSnippets.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/ExtensibleSnippets.JsonElementSnippets.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.JsonElementSnippets.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/ExtensibleSnippets.JsonElementSnippets.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.ModelSnippets.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/ExtensibleSnippets.ModelSnippets.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.ModelSnippets.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/ExtensibleSnippets.ModelSnippets.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.RestOperationsSnippets.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/ExtensibleSnippets.RestOperationsSnippets.cs similarity index 88% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.RestOperationsSnippets.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/ExtensibleSnippets.RestOperationsSnippets.cs index 1f3efc2a16..4a061486b7 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.RestOperationsSnippets.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/ExtensibleSnippets.RestOperationsSnippets.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; @@ -18,7 +18,6 @@ public abstract class RestOperationsSnippets public abstract MethodBodyStatement DeclareHttpMessage(MethodSignatureBase createRequestMethodSignature, out TypedValueExpression message); public abstract MethodBodyStatement DeclareContentWithUtf8JsonWriter(out TypedValueExpression content, out Utf8JsonWriterExpression writer); - public abstract MethodBodyStatement DeclareContentWithXmlWriter(out TypedValueExpression content, out XmlWriterExpression writer); public abstract MethodBodyStatement InvokeServiceOperationCallAndReturnHeadAsBool(TypedValueExpression pipeline, TypedValueExpression message, TypedValueExpression clientDiagnostics, bool async); public abstract StreamExpression GetContentStream(TypedValueExpression response); } diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/ExtensibleSnippets.cs similarity index 82% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/ExtensibleSnippets.cs index b4137e484b..fc60785295 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/ExtensibleSnippets.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. namespace Microsoft.Generator.CSharp.Expressions @@ -8,8 +8,6 @@ public abstract partial class ExtensibleSnippets public abstract JsonElementSnippets JsonElement { get; } public abstract ModelSnippets Model { get; } public abstract RestOperationsSnippets RestOperations { get; } - public abstract XElementSnippets XElement { get; } - public abstract XmlWriterSnippets XmlWriter { get; } protected static InvokeStaticMethodExpression InvokeExtension(CSharpType extensionType, ValueExpression instance, string methodName) => new(extensionType, methodName, new[] { instance }, CallAsAsync: false, CallAsExtension: true); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Snippets.Argument.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/Snippets.Argument.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Snippets.Argument.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/Snippets.Argument.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Snippets.DeclarationStatements.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/Snippets.DeclarationStatements.cs similarity index 96% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Snippets.DeclarationStatements.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/Snippets.DeclarationStatements.cs index a30c29fb5e..334baf861c 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Snippets.DeclarationStatements.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/Snippets.DeclarationStatements.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; @@ -73,9 +73,6 @@ public static MethodBodyStatement Var(string name, StringExpression value, out S public static MethodBodyStatement Var(string name, Utf8JsonWriterExpression value, out Utf8JsonWriterExpression variable) => Var(name, value, d => new Utf8JsonWriterExpression(d), out variable); - public static MethodBodyStatement Var(string name, XDocumentExpression value, out XDocumentExpression variable) - => Var(name, value, d => new XDocumentExpression(d), out variable); - public static MethodBodyStatement Var(string name, TypedValueExpression value, out TypedValueExpression variable) { var reference = new VariableReference(value.Type, name); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Snippets.Linq.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/Snippets.Linq.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Snippets.Linq.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/Snippets.Linq.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Snippets.New.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/Snippets.New.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Snippets.New.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/Snippets.New.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Snippets.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/Snippets.cs similarity index 94% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Snippets.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/Snippets.cs index 8c63311f9d..2a7b760bfb 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Snippets.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Snippets/Snippets.cs @@ -59,10 +59,6 @@ public static TypedValueExpression RemoveAllNullConditional(TypedValueExpression public static BoolExpression Equal(ValueExpression left, ValueExpression right) => new(new BinaryOperatorExpression("==", left, right)); public static BoolExpression NotEqual(ValueExpression left, ValueExpression right) => new(new BinaryOperatorExpression("!=", left, right)); - public static BoolExpression Is(XElementExpression value, string name, out XElementExpression xElement) - => Is(value, name, d => new XElementExpression(d), out xElement); - public static BoolExpression Is(XAttributeExpression value, string name, out XAttributeExpression xAttribute) - => Is(value, name, d => new XAttributeExpression(d), out xAttribute); public static BoolExpression Is(ValueExpression left, ValueExpression right) => new(new BinaryOperatorExpression("is", left, right)); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/ClientSourceInput.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/ClientSourceInput.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/ClientSourceInput.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/ClientSourceInput.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/CodeGenAttributes.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/CodeGenAttributes.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/CodeGenAttributes.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/CodeGenAttributes.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/CompilationCustomCode.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/CompilationCustomCode.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/CompilationCustomCode.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/CompilationCustomCode.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/ModelTypeMapping.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/ModelTypeMapping.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/ModelTypeMapping.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/ModelTypeMapping.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/ProtocolCompilationCustomCode.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/ProtocolCompilationCustomCode.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/ProtocolCompilationCustomCode.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/ProtocolCompilationCustomCode.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/SourceInputHelper.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/SourceInputHelper.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/SourceInputHelper.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/SourceInputHelper.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/SourceInputModel.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/SourceInputModel.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/SourceInputModel.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/SourceInputModel.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/SourcePropertySerializationMapping.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/SourcePropertySerializationMapping.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Source/SourcePropertySerializationMapping.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/SourceInput/SourcePropertySerializationMapping.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/AssignValueIfNullStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/AssignValueIfNullStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/AssignValueIfNullStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/AssignValueIfNullStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/AssignValueStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/AssignValueStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/AssignValueStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/AssignValueStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/CatchStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/CatchStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/CatchStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/CatchStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/DeclareLocalFunctionStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/DeclareLocalFunctionStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/DeclareLocalFunctionStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/DeclareLocalFunctionStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/DeclareVariableStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/DeclareVariableStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/DeclareVariableStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/DeclareVariableStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/CodeBlocks/DiagnosticScopeMethodBodyBlock.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/DiagnosticScopeMethodBodyBlock.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/CodeBlocks/DiagnosticScopeMethodBodyBlock.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/DiagnosticScopeMethodBodyBlock.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/EmptyLineStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/EmptyLineStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/EmptyLineStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/EmptyLineStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/ForStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/ForStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/ForStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/ForStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/ForeachStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/ForeachStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/ForeachStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/ForeachStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/IfElsePreprocessorDirective.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/IfElsePreprocessorDirective.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/IfElsePreprocessorDirective.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/IfElsePreprocessorDirective.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/IfElseStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/IfElseStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/IfElseStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/IfElseStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/IfStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/IfStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/IfStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/IfStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/InvokeInstanceMethodStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/InvokeInstanceMethodStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/InvokeInstanceMethodStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/InvokeInstanceMethodStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/InvokeStaticMethodStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/InvokeStaticMethodStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/InvokeStaticMethodStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/InvokeStaticMethodStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/KeywordStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/KeywordStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/KeywordStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/KeywordStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/MethodBodyStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/MethodBodyStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/MethodBodyStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/MethodBodyStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/MethodBodyStatements.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/MethodBodyStatements.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/MethodBodyStatements.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/MethodBodyStatements.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/CodeBlocks/ParameterValidationBlock.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/ParameterValidationBlock.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/CodeBlocks/ParameterValidationBlock.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/ParameterValidationBlock.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/SingleLineCommentStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/SingleLineCommentStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/SingleLineCommentStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/SingleLineCommentStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/SwitchCase.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/SwitchCase.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/SwitchCase.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/SwitchCase.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/SwitchStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/SwitchStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/SwitchStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/SwitchStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/ThrowStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/ThrowStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/ThrowStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/ThrowStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/TryCatchFinallyStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/TryCatchFinallyStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/TryCatchFinallyStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/TryCatchFinallyStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/UnaryOperatorStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/UnaryOperatorStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/UnaryOperatorStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/UnaryOperatorStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/UsingDeclareVariableStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/UsingDeclareVariableStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/UsingDeclareVariableStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/UsingDeclareVariableStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/UsingScopeStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/UsingScopeStatement.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/Statements/UsingScopeStatement.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/UsingScopeStatement.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/DiagnosticScope.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Writers/DiagnosticScope.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/DiagnosticScope.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Writers/DiagnosticScope.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Utilities/Disposable.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Writers/Disposable.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Utilities/Disposable.cs rename to packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Writers/Disposable.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/CommandLineOptionsTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/CommandLineOptionsTests.cs index 24553ca462..b750b941ee 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/CommandLineOptionsTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/CommandLineOptionsTests.cs @@ -12,6 +12,7 @@ namespace Microsoft.Generator.CSharp.Tests { internal class CommandLineOptionsTests { + private const string GeneratedFolder = "Generated"; /// /// Test data for validating parsing different command line options. These test cases simply validate that the parser @@ -49,21 +50,21 @@ public static IEnumerable ParseInputPathTestCases { get { - yield return new TestCaseData("./src", $"{Path.Combine(Path.GetFullPath("./src"), Constants.DefaultGeneratedCodeFolderName)}"); - yield return new TestCaseData("../src", $"{Path.Combine(Path.GetFullPath("../src"), Constants.DefaultGeneratedCodeFolderName)}"); + yield return new TestCaseData("./src", $"{Path.Combine(Path.GetFullPath("./src"), GeneratedFolder)}"); + yield return new TestCaseData("../src", $"{Path.Combine(Path.GetFullPath("../src"), GeneratedFolder)}"); yield return new TestCaseData("./Generated", Path.GetFullPath("./Generated")); yield return new TestCaseData("c://Generated", Path.GetFullPath("c://Generated")); yield return new TestCaseData("c://src///Generated", Path.GetFullPath("c://src///Generated")); - yield return new TestCaseData("./myDir", $"{Path.Combine(Path.GetFullPath("./myDir"), "src", Constants.DefaultGeneratedCodeFolderName)}"); - yield return new TestCaseData("./myDir/src", $"{Path.Combine(Path.GetFullPath("./myDir"), "src", Constants.DefaultGeneratedCodeFolderName)}"); - yield return new TestCaseData("./myDir/src/", $"{Path.Combine(Path.GetFullPath("./myDir"), "src", Constants.DefaultGeneratedCodeFolderName)}"); - yield return new TestCaseData("./myDir/src/Generated", $"{Path.Combine(Path.GetFullPath("./myDir"), "src", Constants.DefaultGeneratedCodeFolderName)}"); - yield return new TestCaseData("./myDir/src/Generated/", $"{Path.Combine(Path.GetFullPath("./myDir"), "src", Constants.DefaultGeneratedCodeFolderName)}\\"); - yield return new TestCaseData("c://someDir", $"{Path.Combine(Path.GetFullPath("c://someDir"), "src", Constants.DefaultGeneratedCodeFolderName)}"); - yield return new TestCaseData("c://someDir//src", $"{Path.Combine(Path.GetFullPath("c://someDir"), "src", Constants.DefaultGeneratedCodeFolderName)}"); - yield return new TestCaseData("c://someDir//src//", $"{Path.Combine(Path.GetFullPath("c://someDir"), "src", Constants.DefaultGeneratedCodeFolderName)}"); - yield return new TestCaseData("c://someDir//src//Generated", $"{Path.Combine(Path.GetFullPath("c://someDir"), "src", Constants.DefaultGeneratedCodeFolderName)}"); - yield return new TestCaseData("c://someDir//src//Generated//", $"{Path.Combine(Path.GetFullPath("c://someDir"), "src", Constants.DefaultGeneratedCodeFolderName)}\\"); + yield return new TestCaseData("./myDir", $"{Path.Combine(Path.GetFullPath("./myDir"), "src", GeneratedFolder)}"); + yield return new TestCaseData("./myDir/src", $"{Path.Combine(Path.GetFullPath("./myDir"), "src", GeneratedFolder)}"); + yield return new TestCaseData("./myDir/src/", $"{Path.Combine(Path.GetFullPath("./myDir"), "src", GeneratedFolder)}"); + yield return new TestCaseData("./myDir/src/Generated", $"{Path.Combine(Path.GetFullPath("./myDir"), "src", GeneratedFolder)}"); + yield return new TestCaseData("./myDir/src/Generated/", $"{Path.Combine(Path.GetFullPath("./myDir"), "src", GeneratedFolder)}\\"); + yield return new TestCaseData("c://someDir", $"{Path.Combine(Path.GetFullPath("c://someDir"), "src", GeneratedFolder)}"); + yield return new TestCaseData("c://someDir//src", $"{Path.Combine(Path.GetFullPath("c://someDir"), "src", GeneratedFolder)}"); + yield return new TestCaseData("c://someDir//src//", $"{Path.Combine(Path.GetFullPath("c://someDir"), "src", GeneratedFolder)}"); + yield return new TestCaseData("c://someDir//src//Generated", $"{Path.Combine(Path.GetFullPath("c://someDir"), "src", GeneratedFolder)}"); + yield return new TestCaseData("c://someDir//src//Generated//", $"{Path.Combine(Path.GetFullPath("c://someDir"), "src", GeneratedFolder)}\\"); } } }