Send spans instead of indexes

This commit is contained in:
Andras Schmelczer 2025-06-07 11:32:20 +01:00
parent 1475a549d4
commit a628ff348e
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
6 changed files with 28 additions and 16 deletions

View file

@ -15,17 +15,24 @@ pub struct WebSocketHandshake {
pub last_seen_vault_update_id: Option<VaultUpdateId>,
}
#[derive(TS, Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct CursorSpan {
pub start: usize,
pub end: usize,
}
#[derive(TS, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct CursorPositionFromClient {
pub document_to_cursors: HashMap<String, Vec<usize>>,
pub document_to_cursors: HashMap<String, Vec<CursorSpan>>,
}
#[derive(TS, Serialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct ClientCursors {
pub device_id: DeviceId,
pub cursors: HashMap<String, Vec<usize>>,
pub cursors: HashMap<String, Vec<CursorSpan>>,
}
#[derive(TS, Serialize, Clone, Debug)]