-
Notifications
You must be signed in to change notification settings - Fork 24
Key by Url instead of Path in workspace indexer
#910
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
Conversation
This reverts commit 70eb9bbfa4861b532fb9df73cced00b131b2aff8.
DavisVaughan
left a comment
There was a problem hiding this 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
crates/ark/src/lsp/indexer.rs
Outdated
| // Only index R files for file URIs. This discards `inmemory` (Console) and | ||
| // `ark` schemes in particular. | ||
|
|
||
| log::error!("=== Creating index for URI: {uri:?}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| log::error!("=== Creating index for URI: {uri:?}"); | |
| log::trace!("Creating index for URI: {uri:?}"); |
😞
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😬
There was a problem hiding this comment.
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 😆
There was a problem hiding this comment.
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...
Addresses posit-dev/positron#8790
The warnings only appear on Windows because the conversion to
Pathactually 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 newFileIdstruct) as key in our map of file to indexer. This is more general and simplifies a bunch ofPathtoUrlconversions, avoiding by the same token potential warnings. TheFileIdwrapper 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.