Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-syntax/src/tree_sitter.rs')
-rw-r--r--helix-syntax/src/tree_sitter.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/helix-syntax/src/tree_sitter.rs b/helix-syntax/src/tree_sitter.rs
index c2aa6fad..bb188d12 100644
--- a/helix-syntax/src/tree_sitter.rs
+++ b/helix-syntax/src/tree_sitter.rs
@@ -1,13 +1,19 @@
mod grammar;
mod parser;
mod query;
-mod query_captures;
+mod query_cursor;
+mod query_match;
mod ropey;
mod syntax_tree;
mod syntax_tree_node;
+use std::ops;
+
pub use grammar::Grammar;
pub use parser::{Parser, ParserInputRaw};
+pub use query::{Capture, ParserErrorLocation, Pattern, Query, QueryStr};
+pub use query_cursor::{InactiveQueryCursor, MatchedNode, MatchedNodeIdx, QueryCursor, QueryMatch};
+pub use ropey::RopeTsInput;
pub use syntax_tree::{InputEdit, SyntaxTree};
pub use syntax_tree_node::SyntaxTreeNode;
@@ -26,3 +32,14 @@ pub struct Range {
pub start_byte: u32,
pub end_byte: u32,
}
+
+pub trait TsInput {
+ type Cursor: regex_cursor::Cursor;
+ fn cursor_at(&mut self, offset: usize) -> &mut Self::Cursor;
+ fn eq(&mut self, range1: ops::Range<usize>, range2: ops::Range<usize>) -> bool;
+}
+
+pub trait IntoTsInput {
+ type TsInput: TsInput;
+ fn into_ts_input(self) -> Self::TsInput;
+}