Skip to content

Commit

Permalink
fix enum name
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurnikov committed Feb 3, 2024
1 parent 3815104 commit d252ac3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface MoveSettingsListener {
enum class Blockchain {
APTOS, SUI;

fun name(): String = if (this == APTOS) "Aptos" else "Sui"
override fun toString(): String = if (this == APTOS) "Aptos" else "Sui"
}

private const val settingsServiceName: String = "MoveProjectSettingsService_1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class InvalidBlockchainCliConfiguration(project: Project): MvEditorNotificationP
}

return EditorNotificationPanel().apply {
text = "${blockchain.name()} CLI path is not provided or invalid"
text = "$blockchain CLI path is not provided or invalid"
createActionLabel("Configure") {
project.showSettings<PerProjectMoveConfigurable>()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class NoMoveProjectDetectedNotificationProvider(project: Project): MvEditorNotif
@Suppress("UnstableApiUsage")
if (!project.isTrusted()) return null

val blockchain = project.blockchain
val moveProjectsService = project.moveProjectsService
// HACK: Reloads projects once on an opening of any Move file, if not yet reloaded.
// It should be invoked somewhere else where it's more appropriate,
Expand All @@ -39,7 +40,7 @@ class NoMoveProjectDetectedNotificationProvider(project: Project): MvEditorNotif
if (moveProjectsService.allProjects.isEmpty()) {
// no move projects available
return EditorNotificationPanel().apply {
text = "No ${project.blockchain.name()} projects found"
text = "No $blockchain projects found"
createActionLabel("Do not show again") {
disableNotification(file)
updateAllNotifications(project)
Expand All @@ -49,7 +50,7 @@ class NoMoveProjectDetectedNotificationProvider(project: Project): MvEditorNotif

if (moveProjectsService.findMoveProjectForFile(file) == null) {
return EditorNotificationPanel().apply {
text = "File does not belong to any known ${project.blockchain.name()} project"
text = "File does not belong to any known $blockchain project"
createActionLabel("Do not show again") {
disableNotification(file)
updateAllNotifications(project)
Expand Down

0 comments on commit d252ac3

Please sign in to comment.