Skip to content

Commit 0fe37c6

Browse files
committed
highlighter: Derive Clone for Syntax and inner types
1 parent e2d6093 commit 0fe37c6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

highlighter/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl Language {
8181
/// separate injections. That is done while parsing/running the query capture. As
8282
/// a result the injections form a tree. Note that such other queries must account for
8383
/// such multi injection nodes.
84-
#[derive(Debug)]
84+
#[derive(Debug, Clone)]
8585
pub struct Syntax {
8686
layers: Slab<LayerData>,
8787
root: Layer,
@@ -212,7 +212,7 @@ pub struct Injection {
212212
matched_node_range: Range,
213213
}
214214

215-
#[derive(Debug)]
215+
#[derive(Debug, Clone)]
216216
pub struct LayerData {
217217
pub language: Language,
218218
parse_tree: Option<Tree>,

highlighter/src/locals.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl Scope {
2020
}
2121
}
2222

23-
#[derive(Debug)]
23+
#[derive(Debug, Clone)]
2424
pub struct Locals {
2525
scopes: Vec<ScopeData>,
2626
}
@@ -149,13 +149,13 @@ impl ScopeCursor<'_> {
149149
}
150150
}
151151

152-
#[derive(Debug)]
152+
#[derive(Debug, Clone)]
153153
pub struct Definition {
154154
pub capture: Capture,
155155
pub range: Range,
156156
}
157157

158-
#[derive(Debug)]
158+
#[derive(Debug, Clone)]
159159
pub struct ScopeData {
160160
definitions: HashMap<KString, Definition>,
161161
range: Range,

0 commit comments

Comments
 (0)