Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show better exception message when vscode settings json is not found #2655

Merged
merged 3 commits into from
Aug 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cursorless-talon/src/apps/vscode_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ def vscode_get_setting_with_fallback(

def pick_path(paths: list[Path]) -> Path:
existing_paths = [path for path in paths if path.exists()]
if not existing_paths:
paths_str = ", ".join(str(path) for path in paths)
raise FileNotFoundError(
f"Couldn't find VSCode's settings JSON. Tried these paths: {paths_str}"
)
return max(existing_paths, key=lambda path: path.stat().st_mtime)


Expand Down
Loading