refactor: consolidate nvim crates, extract server library, and update workspace dependencies
This commit is contained in:
1 parent
a083719cf1
commit
533adfd41b
53 files changed
+5967
-1230
No files matched your search
@@ -30,7 +30,7 @@ pub fn spawn_watcher(state: Arc<MemoryState>) {
|
||||
.duration_since(std::time::UNIX_EPOCH)
|
||||
.unwrap()
|
||||
.as_secs(),
|
||||
content: text,
|
||||
content: text.clone(),
|
||||
expires_at: None,
|
||||
};
|
||||
|
||||
@@ -38,9 +38,38 @@ pub fn spawn_watcher(state: Arc<MemoryState>) {
|
||||
notes.push(note.clone());
|
||||
});
|
||||
|
||||
state.record_activity(
|
||||
"clipboard",
|
||||
"Auto-ingested clipboard content into sticky notes",
|
||||
Some(&text),
|
||||
);
|
||||
|
||||
// We use rebuild_index to index the new sticky note
|
||||
state.rebuild_index().await;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use tempfile::tempdir;
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_spawn_watcher_lifecycle() {
|
||||
let dir = tempdir().unwrap();
|
||||
let state = Arc::new(MemoryState::new(dir.path().to_str().unwrap()));
|
||||
|
||||
// Set watch mode to disabled first
|
||||
*state.clipboard_watch_mode.write().await = false;
|
||||
spawn_watcher(state.clone());
|
||||
|
||||
tokio::time::sleep(Duration::from_millis(50)).await;
|
||||
|
||||
// Enable watch mode
|
||||
*state.clipboard_watch_mode.write().await = true;
|
||||
tokio::time::sleep(Duration::from_millis(150)).await;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user