Добавлена настройка генерации деталировки
All checks were successful
CI / build-test (push) Successful in 50s
Release / pack-and-publish (release) Successful in 42s

This commit is contained in:
FrigaT
2025-12-28 16:47:35 +03:00
parent cc7809871e
commit 0470309978
10 changed files with 21 additions and 17 deletions

View File

@@ -7,14 +7,13 @@ public abstract class BaseRuleVisitor : TSqlFragmentVisitor, IRule
{
protected readonly List<Violation> _violations = new();
protected Dictionary<TSqlFragment, TSqlFragment?> _parents
= new Dictionary<TSqlFragment, TSqlFragment?>();
protected Dictionary<TSqlFragment, TSqlFragment?>? _parents = null;
public void SetParents(Dictionary<TSqlFragment, TSqlFragment?> parents)
public void SetParents(Dictionary<TSqlFragment, TSqlFragment?>? parents)
=> _parents = parents;
protected TSqlFragment? GetParent(TSqlFragment node)
=> _parents.TryGetValue(node, out var parent) ? parent : null;
=> _parents is null ? null : _parents.TryGetValue(node, out var parent) ? parent : null;
public int DynamicSqlStartColumn { get; set; }

View File

@@ -13,5 +13,5 @@ public interface IRule
int DynamicSqlStartLine { get; set; }
IEnumerable<Violation> Analyze(TSqlFragment fragment);
void SetParents(Dictionary<TSqlFragment, TSqlFragment?> parents);
void SetParents(Dictionary<TSqlFragment, TSqlFragment?>? parents);
}