Skip to content

Commit

Permalink
Resolve false positives on workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthurvdv committed Dec 13, 2023
1 parent 40aadf3 commit 32d8997
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Design/Rule0004LookupPageIdAndDrillDownPageId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ public class Rule0004LookupPageIdAndDrillDownPageId : DiagnosticAnalyzer
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create<DiagnosticDescriptor>(DiagnosticDescriptors.Rule0004LookupPageIdAndDrillDownPageId);

public override void Initialize(AnalysisContext context)
=> context.RegisterSymbolAction(new Action<SymbolAnalysisContext>(this.CheckForLookupPageIdAndDrilldownPageId), SymbolKind.Page);
=> context.RegisterSymbolAction(new Action<SymbolAnalysisContext>(this.CheckForLookupPageIdAndDrillDownPageId), SymbolKind.Page);

private void CheckForLookupPageIdAndDrilldownPageId(SymbolAnalysisContext context)
private void CheckForLookupPageIdAndDrillDownPageId(SymbolAnalysisContext context)
{
if (context.Symbol.IsObsoletePending || context.Symbol.IsObsoleteRemoved) return;
IPageTypeSymbol pageTypeSymbol = (IPageTypeSymbol)context.Symbol;
if (pageTypeSymbol.PageType == PageTypeKind.List && pageTypeSymbol.RelatedTable != null)
CheckTable(pageTypeSymbol.RelatedTable, ref context);
if (pageTypeSymbol.PageType != PageTypeKind.List || pageTypeSymbol.RelatedTable == null) return;
if (pageTypeSymbol.RelatedTable.ContainingModule != context.Symbol.ContainingModule) return;
CheckTable(pageTypeSymbol.RelatedTable, ref context);
}

private void CheckTable(ITableTypeSymbol table, ref SymbolAnalysisContext context)
Expand Down

0 comments on commit 32d8997

Please sign in to comment.