Skip to content

Commit

Permalink
feat: use tree sitter for AnyBrackets and AnyQuotes
Browse files Browse the repository at this point in the history
  • Loading branch information
oca159 committed Feb 12, 2025
1 parent 8411574 commit 191ae5a
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 362 deletions.
6 changes: 0 additions & 6 deletions crates/editor/src/display_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1369,12 +1369,6 @@ impl Sub<u32> for DisplayRow {
}

impl DisplayPoint {
pub fn offset_plus(&self, map: &DisplaySnapshot, count: usize) -> DisplayPoint {
let line_len = map.line_len(self.row()) as usize;
let new_col = (self.column() as usize + count).min(line_len);
DisplayPoint::new(self.row(), new_col as u32)
}

pub fn new(row: DisplayRow, column: u32) -> Self {
Self(BlockPoint(Point::new(row.0, column)))
}
Expand Down
2 changes: 2 additions & 0 deletions crates/editor/src/test/editor_lsp_test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ impl EditorLspTestContext {
("[" @open "]" @close)
("{" @open "}" @close)
("<" @open ">" @close)
("'" @open "'" @close)
("`" @open "`" @close)
("\"" @open "\"" @close)"#})),
indents: Some(Cow::from(indoc! {r#"
[
Expand Down
2 changes: 2 additions & 0 deletions crates/languages/src/typescript/brackets.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
("{" @open "}" @close)
("<" @open ">" @close)
("\"" @open "\"" @close)
("'" @open "'" @close)
("`" @open "`" @close)
Loading

0 comments on commit 191ae5a

Please sign in to comment.