refactor(cursor): PathResolver::new takes a required home argument - #211
Open
ecalifornica wants to merge 1 commit into
Open
refactor(cursor): PathResolver::new takes a required home argument#211ecalifornica wants to merge 1 commit into
ecalifornica wants to merge 1 commit into
Conversation
|
🔍 Preview deployed: https://3aba5a36.toolpath.pages.dev |
ecalifornica
force-pushed
the
robert/config-cursor
branch
from
August 14, 2026 19:49
e61af47 to
ac65ad8
Compare
ecalifornica
commented
Aug 17, 2026
Comment on lines
+118
to
120
| // The resolver applies $APPDATA only on Windows; injecting it on | ||
| // other platforms would change resolution there. | ||
| #[cfg(windows)] |
Collaborator
Author
There was a problem hiding this comment.
Stale comment, non-Windows ignores the value.
) toolpath-cursor reads no environment variable. The caller supplies the home directory and the Windows roaming-application-data root. The crate keeps the layout below them: the Anysphere tree is <home>/.cursor, and the Electron user-data root is the per-platform default. CursorConvo::new(home) and CursorIO::new(home) take the same argument. Deleted: the Default impls on PathResolver, CursorIO, and CursorConvo; PathResolver::with_home; the private home-directory helper; the NoHomeDirectory error variant. with_anysphere_dir and with_user_data_dir stay as the full overrides. PathResolver::with_appdata(appdata) sets %APPDATA%, the Windows roaming-application-data root. The Windows default user-data directory is <appdata>/Cursor. Every other platform ignores the value. The home directory is always present, so the 10 path accessors and CursorIO::db_path return a value instead of a Result. The CHANGELOG lists them. find_workspace_id and ensure_workspace_storage_entry keep their Result. path-cli: providers::cursor_resolver returns Option<PathResolver>, harness_bundle omits Cursor when it is None, and the 5 commands that target Cursor go through providers::require_cursor_resolver. Config reads $APPDATA and passes it to the resolver on Windows.
ecalifornica
force-pushed
the
robert/config-cursor
branch
from
August 18, 2026 20:09
ac65ad8 to
4ec9e8d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #185: the crate reads no environment variable,
Configowns every read, and the caller supplies what the crate used to resolve itself.Judgment calls:
appdatais a dedicated argument, not a pre-computedwith_user_data_dir(appdata.join("Cursor"))in the CLI. Context:%APPDATA%is the Windows roaming-application-data root, and only Cursor's Windows default user-data directory consults it.with_appdata(appdata)stores the root and the resolver appendsCursor: the crate owns the layout, the CLI owns only the value. Every other platform's default ignores the value, andwith_user_data_dirwins against both.$APPDATAunder#[cfg(windows)]. The gate is belt-and-braces: a non-Windows resolver takes and ignores the value, so injection elsewhere would change nothing.