Compare commits

...

1 Commits

Author SHA1 Message Date
Dmitriy Kovalenko 918fc0ecdb chore: fix fmt
docs / docs (push) Has been cancelled
2026-03-12 08:01:30 -07:00
7 changed files with 18 additions and 10 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
# - os: ubuntu-latest TODO uncomment once bun stop crashing
- os: macos-latest
- os: windows-latest
target: x86_64-pc-windows-msvc
-4
View File
@@ -31,10 +31,6 @@ use ffi_types::{
FffResult, GrepSearchOptionsJson, InitOptions, MultiGrepOptionsJson, ScanProgress,
SearchOptions,
};
use mimalloc::MiMalloc;
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
/// Opaque fff_handle holding all per-instance state.
///
+2 -1
View File
@@ -858,7 +858,7 @@ fn scan_filesystem(
.build_parallel();
let walker_start = std::time::Instant::now();
info!("SCAN: Starting file walker");
debug!("SCAN: Starting file walker");
let files = Arc::new(std::sync::Mutex::new(Vec::new()));
walker.run(|| {
@@ -903,6 +903,7 @@ fn scan_filesystem(
let frecency = shared_frecency
.read()
.map_err(|_| Error::AcquireFrecencyLock)?;
files
.par_iter_mut()
.try_for_each(|file| -> Result<(), Error> {
+4 -1
View File
@@ -167,7 +167,10 @@ impl FrecencyTracker {
}
}
if read_errors > 0 {
tracing::warn!(read_errors, "Skipped corrupted entries during compaction read");
tracing::warn!(
read_errors,
"Skipped corrupted entries during compaction read"
);
}
entries
}
+7
View File
@@ -17,6 +17,7 @@ use clap::Parser;
use fff_core::file_picker::FilePicker;
use fff_core::frecency::FrecencyTracker;
use fff_core::{FFFMode, SharedFrecency, SharedPicker};
use git2::Repository;
use mimalloc::MiMalloc;
use rmcp::{ServiceExt, transport::stdio};
use server::FffServer;
@@ -205,6 +206,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.to_string_lossy()
.to_string()
});
if !Repository::discover(&base_path).is_ok() {
tracing::error!("MCP server must be run within a Git repository");
return Err(format!("Not a Git repository: {}", base_path).into());
}
let frecency_db_path = args.frecency_db_path.unwrap_or_default();
let shared_picker: SharedPicker = Arc::new(RwLock::new(None));
+2 -2
View File
@@ -34,7 +34,7 @@ impl PathCache {
}
}
#[tracing::instrument(skip(self), fields(path = %path.display(), max_size))]
#[tracing::instrument(skip(self), fields(path = %path.display(), max_size), level = tracing::Level::TRACE)]
fn get(&self, path: &Path, max_size: usize) -> Option<&str> {
self.map.get(path).and_then(|entry| {
// Only return cached value if max_size matches
@@ -85,7 +85,7 @@ pub fn shorten_path_with_cache(
.read()
.map_err(|_| "Failed to acquire path cache lock".to_string())?;
if let Some(cached) = cache.get(path, max_size) {
tracing::debug!("Cache hit for path '{}'", path.display());
tracing::trace!("Cache hit for path '{}'", path.display());
return Ok(cached.to_string());
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
{
"private": true,
"workspaces": ["packages/fff-bun", "packages/fff-mcp"],
"packageManager": "bun@1.3.9",
"scripts": {
"format": "biome format --write",
"format:check": "biome format",
@@ -11,4 +12,4 @@
"devDependencies": {
"@biomejs/biome": "^2.4.4"
}
}
}