Добавлена настройка генерации деталировки
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user