Skip to content

Commit

Permalink
Fixed Issues with DataLoaders in Resolver Compiler (#7162)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib authored Jun 12, 2024
1 parent 862c810 commit 7f3b67b
Show file tree
Hide file tree
Showing 57 changed files with 819 additions and 572 deletions.
4 changes: 2 additions & 2 deletions src/HotChocolate/Core/src/Types.Analyzers/Errors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class Errors

public static readonly DiagnosticDescriptor ObjectTypePartialKeywordMissing =
new(
id: "HC00XX",
id: "HC0080",
title: "Partial Keyword Missing.",
messageFormat: "A split object type class needs to be a partial class.",
category: "TypeSystem",
Expand All @@ -34,7 +34,7 @@ public static class Errors

public static readonly DiagnosticDescriptor ObjectTypeStaticKeywordMissing =
new(
id: "HC00XX",
id: "HC0081",
title: "Static Keyword Missing.",
messageFormat: "A split object type class needs to be a static class.",
category: "TypeSystem",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;

namespace HotChocolate.Types.Analyzers.Generators;
namespace HotChocolate.Types.Analyzers.FileBuilders;

public sealed class DataLoaderSyntaxGenerator : IDisposable
public sealed class DataLoaderFileBuilder : IDisposable
{
private StringBuilder _sb;
private CodeWriter _writer;
private bool _disposed;

public DataLoaderSyntaxGenerator()
public DataLoaderFileBuilder()
{
_sb = StringBuilderPool.Get();
_writer = new CodeWriter(_sb);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
using System.Text;
using HotChocolate.Types.Analyzers.Helpers;
using HotChocolate.Types.Analyzers.Models;
using Microsoft.CodeAnalysis.Text;

namespace HotChocolate.Types.Analyzers.Generators;
namespace HotChocolate.Types.Analyzers.FileBuilders;

public sealed class ModuleSyntaxGenerator : IDisposable
public sealed class ModuleFileBuilder : IDisposable
{
private readonly string _moduleName;
private readonly string _ns;
private StringBuilder _sb;
private CodeWriter _writer;
private bool _disposed;

public ModuleSyntaxGenerator(string moduleName, string ns)
public ModuleFileBuilder(string moduleName, string ns)
{
_moduleName = moduleName;
_ns = ns;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System.Text;
using HotChocolate.Types.Analyzers.Helpers;
using HotChocolate.Types.Analyzers.Inspectors;
using HotChocolate.Types.Analyzers.Models;
using Microsoft.CodeAnalysis;

namespace HotChocolate.Types.Analyzers.Generators;
namespace HotChocolate.Types.Analyzers.FileBuilders;

public sealed class ObjectTypeExtensionSyntaxGenerator(StringBuilder sb, string ns)
public sealed class ObjectTypeExtensionFileBuilder(StringBuilder sb, string ns)
{
private readonly CodeWriter _writer = new(sb);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
using System.Text;
using HotChocolate.Types.Analyzers.Helpers;
using HotChocolate.Types.Analyzers.Inspectors;
using HotChocolate.Types.Analyzers.Models;
using Microsoft.CodeAnalysis.Text;

namespace HotChocolate.Types.Analyzers.Generators;
namespace HotChocolate.Types.Analyzers.FileBuilders;

public sealed class OperationFieldSyntaxGenerator: IDisposable
public sealed class OperationFieldFileBuilder : IDisposable
{
private StringBuilder _sb;
private CodeWriter _writer;
private bool _first = true;
private bool _disposed;

public OperationFieldSyntaxGenerator()
public OperationFieldFileBuilder()
{
_sb = StringBuilderPool.Get();
_writer = new CodeWriter(_sb);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.Text;
using HotChocolate.Types.Analyzers.Helpers;
using HotChocolate.Types.Analyzers.Inspectors;
using HotChocolate.Types.Analyzers.Models;
using Microsoft.CodeAnalysis.Text;
using static HotChocolate.Types.Analyzers.WellKnownTypes;

namespace HotChocolate.Types.Analyzers.Generators;
namespace HotChocolate.Types.Analyzers.FileBuilders;

public sealed class RequestMiddlewareSyntaxGenerator : IDisposable
public sealed class RequestMiddlewareFileBuilder : IDisposable
{
private readonly string _moduleName;
private readonly string _ns;
Expand All @@ -15,7 +15,7 @@ public sealed class RequestMiddlewareSyntaxGenerator : IDisposable
private CodeWriter _writer;
private bool _disposed;

public RequestMiddlewareSyntaxGenerator(string moduleName, string ns)
public RequestMiddlewareFileBuilder(string moduleName, string ns)
{
_moduleName = moduleName;
_ns = ns;
Expand Down
Loading

0 comments on commit 7f3b67b

Please sign in to comment.