Skip to content

Commit

Permalink
Cleaned up diagnostic reporting by introducing a new type explicitly …
Browse files Browse the repository at this point in the history
…for this.
  • Loading branch information
MeltyPlayer committed Aug 2, 2023
1 parent cfd1d4d commit dbf70cf
Show file tree
Hide file tree
Showing 20 changed files with 285 additions and 261 deletions.
5 changes: 2 additions & 3 deletions Schema Tests/BinarySchemaTestUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ or StructDeclarationSyntax
var namedTypeSymbol = symbol as INamedTypeSymbol;
return new BinarySchemaStructureParser()
.ParseStructure(
namedTypeSymbol);
.ParseStructure(namedTypeSymbol);
})
.ToArray();

Expand Down Expand Up @@ -116,7 +115,7 @@ or StructDeclarationSyntax
}

public static void AssertDiagnostics(
IList<Diagnostic> actualDiagnostics,
IReadOnlyList<Diagnostic> actualDiagnostics,
params DiagnosticDescriptor[] expectedDiagnostics) {
var message = "";

Expand Down
8 changes: 1 addition & 7 deletions Schema/src/binary/BinarySchemaAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,7 @@ public void CheckType(
return;
}

var structure = this.parser_.ParseStructure(symbol);
var diagnostics = structure.Diagnostics;
if (diagnostics.Count > 0) {
foreach (var diagnostic in diagnostics) {
Rules.ReportDiagnostic(context, diagnostic);
}
}
this.parser_.ParseStructure(symbol, context);
} catch (Exception exception) {
if (Debugger.IsAttached) {
throw;
Expand Down
Loading

0 comments on commit dbf70cf

Please sign in to comment.