Skip to content

Commit

Permalink
fix(grit): correct calculation of line and column numbers (#3409)
Browse files Browse the repository at this point in the history
  • Loading branch information
arendjr committed Jul 11, 2024
1 parent 6d86cc2 commit a24d361
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion crates/biome_grit_patterns/src/grit_binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl<'a> Binding<'a, GritQueryContext> for GritBinding<'a> {
match self {
Self::Node(node) => {
let source = SourceFile::new(SourceCode {
text: node.text(),
text: node.source(),
line_starts: None,
});
source.to_grit_range(node.text_trimmed_range())
Expand Down
24 changes: 12 additions & 12 deletions crates/biome_grit_patterns/tests/specs/ts/identifier.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@ SnapshotResult {
matched_ranges: [
Range {
start: Position {
line: 1,
column: 4,
line: 3,
column: 8,
},
end: Position {
line: 1,
column: 4,
line: 3,
column: 11,
},
start_byte: 25,
end_byte: 28,
},
Range {
start: Position {
line: 1,
column: 4,
line: 6,
column: 3,
},
end: Position {
line: 1,
column: 4,
line: 6,
column: 6,
},
start_byte: 52,
end_byte: 55,
},
Range {
start: Position {
line: 1,
column: 4,
line: 11,
column: 2,
},
end: Position {
line: 1,
column: 4,
line: 11,
column: 5,
},
start_byte: 99,
end_byte: 102,
Expand Down

0 comments on commit a24d361

Please sign in to comment.