-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
refactor(lsp): reuse CliGraphResolverOptions::sloppy_imports_resolver #23764
refactor(lsp): reuse CliGraphResolverOptions::sloppy_imports_resolver #23764
Conversation
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.
Looks great! I think we'll need to update this to not use the state_cache
in the LSP because it might get out of date.
cli/resolver.rs
Outdated
@@ -1065,7 +1053,7 @@ impl SloppyImportsResolver { | |||
} | |||
|
|||
let probe_paths: Vec<(PathBuf, SloppyImportsResolutionReason)> = | |||
match (stat_sync)(&path) { | |||
match self.stat_cache.stat_sync(&path) { |
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.
One thing we're probably going to have to do with this change is not use a stat cache because it will get out of date.
Another point to note (that I mentioned on the last PR, but worth re-iterating to keep in mind) is that sloppy import resolution may change when a file is added or deleted. Probably in the future (I wouldn't suggest as part of this PR), we'll need to invalidate resolved resolution more when using sloppy imports.
…fallback resolution
…allback resolution
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.
LGTM
So we don't need to have separate hooks in
LspGraphResolver::resolve()
.Unrelated: Remove redundant 1-layer dep recursion in
op_script_names()
. Cleanup other resolver interfaces.