Skip to content

Commit bffa88c

Browse files
committed
don't inject <mark> in db, db returns spans
1 parent 6644107 commit bffa88c

3 files changed

Lines changed: 161 additions & 96 deletions

File tree

src/db/models.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,19 @@ pub struct ReferenceResult {
6565
pub column: usize,
6666
}
6767

68+
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
69+
pub struct SearchMatchSpan {
70+
pub start: usize,
71+
pub end: usize,
72+
}
73+
6874
#[derive(Debug, Clone, Serialize, Deserialize)]
6975
pub struct SearchSnippet {
7076
pub start_line: i32,
7177
pub end_line: i32,
7278
pub match_line: i32,
7379
pub content_text: String,
80+
pub match_spans: Vec<SearchMatchSpan>,
7481
}
7582

7683
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -89,6 +96,7 @@ pub struct SearchResult {
8996
pub end_line: i32,
9097
pub match_line: i32, // The actual line where the match occurs
9198
pub content_text: String,
99+
pub match_spans: Vec<SearchMatchSpan>,
92100
pub snippets: Vec<SearchSnippet>,
93101
pub branches: Vec<String>,
94102
pub live_branches: Vec<String>,

0 commit comments

Comments
 (0)