From 1b2d4f927ce1fccd509b567067727f0cdc9f5e7d Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 12:38:41 +0000 Subject: [PATCH] fix(server): name the app in the lockfile note from the path as given On Windows the note named the app from the path read back from the file URI, which is spelled differently from the folder the user gave, so test/cli.js did not find the app's folder in it. The note now walks the given path made absolute, as the folder walk does. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012jSfzj1UNFUHV9YmmbjLg4 --- server/src/cli.rs | 4 +++- test/cli.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/cli.rs b/server/src/cli.rs index bfa3e10..ad1800a 100644 --- a/server/src/cli.rs +++ b/server/src/cli.rs @@ -335,7 +335,9 @@ fn check_file( let real = util::file_path(&uri).unwrap_or_else(|| path.to_path_buf()); let project = Project::memoized(projects, &real, Some(view_roots)); let mut checked = Checked::new(OK); - checked.unlocked_app = project.rails_root_without_lockfile(&real).map(|app| { + // Spelled as given, made absolute: a path back from the file URI may be written differently on Windows. + let typed = std::path::absolute(path).unwrap_or_else(|_| real.clone()); + checked.unlocked_app = project.rails_root_without_lockfile(&typed).map(|app| { let shown = shown_path(&app, output.cwd); let shown = if shown.as_os_str().is_empty() { Path::new(".") } else { shown }; (app.clone(), shown.to_path_buf()) diff --git a/test/cli.js b/test/cli.js index 5d629b2..03faa8f 100644 --- a/test/cli.js +++ b/test/cli.js @@ -65,6 +65,7 @@ try { assert.ok( lockNotes[0].includes(root) && /Rails\/\*, Stimulus\/\* and Turbo\/\*/.test(lockNotes[0]), + `the note names ${root}\n${r.stderr}`, ); r = run(["check", "app/views/users/index.html.slim"], undefined, root); assert.match(