Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,4 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)..\..\Microsoft.Generator.CSharp\src\Shared\StringExtensions.cs" LinkBase="Shared" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
using System.Text.RegularExpressions;
using Microsoft.CodeAnalysis.CSharp;

namespace Microsoft.Generator.CSharp
namespace Microsoft.Generator.CSharp.Input
{
internal static class StringExtensions
public static class StringExtensions
{
private static bool IsWordSeparator(char c) => !SyntaxFacts.IsIdentifierPartCharacter(c) || c == '_';
private static readonly Regex HumanizedCamelCaseRegex = new Regex(@"([A-Z])", RegexOptions.Compiled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using Microsoft.Generator.CSharp.Input;

namespace Microsoft.Generator.CSharp.Expressions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Generator.CSharp.Expressions;
using Microsoft.Generator.CSharp.Input;
using Microsoft.Generator.CSharp.Primitives;
using Microsoft.Generator.CSharp.Statements;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace Microsoft.Generator.CSharp.Providers
{
public sealed class ModelProvider : TypeProvider
public class ModelProvider : TypeProvider
{
private const string AdditionalBinaryDataPropsFieldDescription = "Keeps track of any properties unknown to the library.";
private readonly InputModelType _inputModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,7 @@ public string? Deprecated

private TypeSignatureModifiers? _declarationModifiers;

public TypeSignatureModifiers DeclarationModifiers
{
get => _declarationModifiers ??= GetDeclarationModifiersInternal();
private set => _declarationModifiers = value;
}
public TypeSignatureModifiers DeclarationModifiers => _declarationModifiers ??= GetDeclarationModifiersInternal();

protected virtual TypeSignatureModifiers GetDeclarationModifiers() => TypeSignatureModifiers.None;

Expand Down Expand Up @@ -332,7 +328,9 @@ public void Update(
IEnumerable<FieldProvider>? fields = null,
IEnumerable<TypeProvider>? serializations = null,
IEnumerable<TypeProvider>? nestedTypes = null,
XmlDocProvider? xmlDocs = null)
XmlDocProvider? xmlDocs = null,
TypeSignatureModifiers? modifiers = null,
string? relativeFilePath = null)
{
if (methods != null)
{
Expand Down Expand Up @@ -362,6 +360,14 @@ public void Update(
{
XmlDocs = xmlDocs;
}
if (modifiers != null)
{
_declarationModifiers = modifiers;
}
if (relativeFilePath != null)
{
_relativeFilePath = relativeFilePath;
}
}
public IReadOnlyList<EnumTypeMember> EnumValues => _enumValues ??= BuildEnumValues();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using Microsoft.Generator.CSharp.Input;
using Microsoft.Generator.CSharp.Providers;

namespace Microsoft.Generator.CSharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Text;
using Microsoft.CodeAnalysis;
using Microsoft.Generator.CSharp.Expressions;
using Microsoft.Generator.CSharp.Input;
using Microsoft.Generator.CSharp.Primitives;
using Microsoft.Generator.CSharp.Providers;
using Microsoft.Generator.CSharp.Snippets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using Microsoft.Generator.CSharp.Input;
using NUnit.Framework;

namespace Microsoft.Generator.CSharp.Tests.Utilities
Expand Down
Loading