sqruff-lib-core 0.36.0

Core library that underpins the sqruff library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use hashbrown::HashMap;

use crate::lint_fix::LintFix;
use crate::segments::AnchorEditInfo;

pub fn compute_anchor_edit_info(
    anchor_info: &mut HashMap<u32, AnchorEditInfo>,
    fixes: Vec<LintFix>,
) {
    for fix in fixes {
        let anchor_id = fix.anchor().id();
        anchor_info.entry(anchor_id).or_default().add(fix);
    }
}