-
Notifications
You must be signed in to change notification settings - Fork 3k
Refresh deleted source file location #47950
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
Refresh deleted source file location #47950
Conversation
This comment has been minimized.
This comment has been minimized.
e273f3b
to
2a0bf8a
Compare
If a kotlin file is renamed a class that was previously provided by the old file will now be provided by the new one. This fix reloads the class file location to make sure that it is a true delete, otherwise the first reload after a rename will fail.
2a0bf8a
to
86c1182
Compare
Status for workflow
|
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!
TimestampSet timestampSet, boolean forceRefresh) { | ||
Path sourceFilePath = timestampSet.classFilePathToSourceFilePath.get(classFilePath); | ||
if (sourceFilePath == null || moduleChangedSourceFiles.contains(sourceFilePath)) { | ||
if (sourceFilePath == null || moduleChangedSourceFiles.contains(sourceFilePath) || forceRefresh) { |
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.
Wouldn't !Files.exists(sourceFilePath)
instead of forceRefresh
achieve the same?
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.
No, because this could result in the function returning null when previously it would have returned the non-existant file.
If a kotlin file is renamed a class that was previously provided by the old file will now be provided by the new one.
This fix reloads the class file location to make sure that it is a true delete, otherwise the first reload after a rename will fail.