refactor: eradicate deprecated tools (sticky_notes, pinned_files, context_workspaces, pr_checklist, preferences) and dead code
This commit is contained in:
1 parent
d80915635f
commit
79209da711
31 files changed
+1230
-3920
No files matched your search
@@ -167,6 +167,43 @@ async fn get_socket_path() -> Result<String, String> {
|
||||
}
|
||||
Err("Could not find Neovim socket".to_string())
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
async fn read_active_socket_file() -> Result<String, String> {
|
||||
let profile = dirs::home_dir()
|
||||
.map(|p| p.to_string_lossy().to_string())
|
||||
.or_else(|| std::env::var("USERPROFILE").ok())
|
||||
.ok_or_else(|| "Could not determine user home directory".to_string())?;
|
||||
let path = format!("{profile}\\.gemini\\active_nvim.txt");
|
||||
if let Ok(content) = tokio::fs::read_to_string(&path).await {
|
||||
let p = content.trim().to_string();
|
||||
if !p.is_empty() {
|
||||
let candidate = if p.starts_with(r"\\.\pipe\") {
|
||||
p
|
||||
} else if p.starts_with("nvim.") {
|
||||
format!(r"\\.\pipe\{p}")
|
||||
} else {
|
||||
p
|
||||
};
|
||||
return Ok(candidate);
|
||||
}
|
||||
}
|
||||
Err("Missing active_nvim.txt".to_string())
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
async fn read_active_socket_file() -> Result<String, String> {
|
||||
if let Some(home) = dirs::home_dir() {
|
||||
let path = home.join(".gemini/active_nvim.txt");
|
||||
if let Ok(content) = tokio::fs::read_to_string(&path).await {
|
||||
let p = content.trim().to_string();
|
||||
if !p.is_empty() {
|
||||
return Ok(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
Err("Missing active_nvim.txt".to_string())
|
||||
}
|
||||
use std::sync::Arc;
|
||||
use std::sync::LazyLock;
|
||||
use tokio::sync::{mpsc, oneshot};
|
||||
@@ -222,6 +259,24 @@ fn handle_nvim_notification(params: &[rmpv::Value]) {
|
||||
}
|
||||
|
||||
async fn get_nvim_connection() -> Result<mpsc::Sender<NvimRequest>, String> {
|
||||
// Fast path: If NVIM_CONN is already active and healthy, check if active_nvim.txt matches
|
||||
// without spawning any external nvim.exe child process!
|
||||
{
|
||||
let conn_lock = NVIM_CONN.lock().await;
|
||||
if let Some(sender) = conn_lock.as_ref() {
|
||||
if !sender.is_closed() {
|
||||
let active_lock = ACTIVE_SOCKET.lock().await;
|
||||
if let Some(ref current_socket) = *active_lock {
|
||||
if let Ok(target) = read_active_socket_file().await {
|
||||
if !target.is_empty() && &target == current_socket {
|
||||
return Ok(sender.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let interactive_socket = get_socket_path().await.ok();
|
||||
let mut should_kill_headless = false;
|
||||
|
||||
|
||||
Reference in new issue
Block a user