Skip to content

Conversation

@lionel-
Copy link
Contributor

@lionel- lionel- commented Aug 27, 2025

Addresses posit-dev/positron#8790

The warnings only appear on Windows because the conversion to Path actually succeeds on Unixes. So we were calling `create() with non-file URIs on Unixes but not on Windows. To fix the warnings and make things more consistent, this PR:

  • Now uses Url (wrapped in a new FileId struct) as key in our map of file to indexer. This is more general and simplifies a bunch of Path to Url conversions, avoiding by the same token potential warnings. The FileId wrapper is used for stronger internal type checking / self-documentation, but not exposed in the public API.

  • Declines to index non-file URIs. This makes the check for [rR] files stronger.

QA Notes

Typing in the console should no longer produce warnings in logs on Windows. I haven't been able to check as I don't have access to my Windows laptop right now.

@lionel- lionel- requested a review from DavisVaughan August 27, 2025 12:50
Copy link
Contributor

@DavisVaughan DavisVaughan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea but have a few questions about behavior change (maybe it needs a test?) and some efficiency things

// Only index R files for file URIs. This discards `inmemory` (Console) and
// `ark` schemes in particular.

log::error!("=== Creating index for URI: {uri:?}");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log::error!("=== Creating index for URI: {uri:?}");
log::trace!("Creating index for URI: {uri:?}");

😞

Copy link
Contributor Author

@lionel- lionel- Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a debug printf of mine, not AI slop :P

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i appreciate you keeping me on my toes 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching things I no longer see in diffs after working on a PR for a while...

@DavisVaughan DavisVaughan mentioned this pull request Aug 27, 2025
@lionel- lionel- merged commit d06390a into main Aug 27, 2025
6 checks passed
@lionel- lionel- deleted the bugfix/indexer-warning branch August 27, 2025 15:56
@github-actions github-actions bot locked and limited conversation to collaborators Aug 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants