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

Fix crates local index state updates #7031

Merged
merged 1 commit into from Apr 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -49,8 +49,10 @@ import java.util.concurrent.atomic.AtomicBoolean
/**
* Crates local index, created from user cargo registry index on host machine.
* Used for dependency code insight in project's `Cargo.toml`.
*
* Stores crates info in [crates] persistent hash map and hash for commit which has been used for index load in
* persistent state [CratesLocalIndexState].
* persistent state [CratesLocalIndexState]. Note, state's properties should be mutable in order to be serialized and
* saved.
*/
@State(name = "CratesLocalIndexState", storages = [Storage("rust.crateslocalindex.xml")])
class CratesLocalIndexServiceImpl
Expand Down Expand Up @@ -267,7 +269,7 @@ class CratesLocalIndexServiceImpl
}

companion object {
data class CratesLocalIndexState(val indexedCommitHash: String = "")
data class CratesLocalIndexState(var indexedCommitHash: String = "")

private val corruptionMarkerFile: Path
get() = baseCratesLocalRegistryDir.resolve(CORRUPTION_MARKER_NAME)
Expand Down