pub enum Region {
Lines {
start: u32,
end: u32,
},
AstNode {
node_kind: String,
name: Option<String>,
start_byte: u32,
end_byte: u32,
},
WholeFile,
}Expand description
A region within a file that participates in a conflict.
Regions localize conflicts to specific parts of a file — either line ranges
or AST node spans. This is the difference between “file has conflict” and
“lines 42-67 of function process_order have a conflict.”
§Serialization
Uses #[serde(tag = "kind")] with snake_case variant names:
{ "kind": "lines", "start": 42, "end": 67 }
{ "kind": "ast_node", "node_kind": "function", "name": "process_order", "start_byte": 1024, "end_byte": 2048 }Variants§
Lines
A contiguous range of lines (1-indexed, inclusive start, exclusive end).
§Example
Region::Lines { start: 10, end: 15 } means lines 10..15.
Fields
AstNode
An AST node identified by tree-sitter node kind and optional name.
Used when the merge engine has parsed the file and can identify conflicts at the syntax-tree level rather than raw line ranges.
§Example
AstNode { node_kind: "function_item", name: Some("process_order"), start_byte: 1024, end_byte: 2048 }Fields
WholeFile
The entire file (used when region-level granularity is not available).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Region
impl<'de> Deserialize<'de> for Region
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Region
impl StructuralPartialEq for Region
Auto Trait Implementations§
impl Freeze for Region
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnsafeUnpin for Region
impl UnwindSafe for Region
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.