Skip to content

Commit

Permalink
Added redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Razz4780 committed Jan 7, 2025
1 parent 1ff38d8 commit 51d7e2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/316.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added dropdown menu action that redirects to the plugin docs.g
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import javax.swing.JComponent

const val DISCORD_URL = "https://discord.gg/metalbear"
const val MIRRORD_FOR_TEAMS_URL = "https://app.metalbear.co/"
const val DOCS_URL = "https://mirrord.dev/docs/using-mirrord/intellij-plugin/"

/**
* Copied from internal [com.intellij.execution.ui.TogglePopupAction].
Expand Down Expand Up @@ -164,6 +165,12 @@ class MirrordDropDown : TogglePopupAction(), DumbAware {
}
}

private class DocsAction : AnAction("How To Use?") {
override fun actionPerformed(e: AnActionEvent) {
BrowserUtil.browse(DOCS_URL)
}
}

override fun getActionGroup(e: AnActionEvent): ActionGroup {
val project = e.project ?: throw Error("mirrord requires an open project")
val service = project.service<MirrordProjectService>()
Expand All @@ -180,6 +187,7 @@ class MirrordDropDown : TogglePopupAction(), DumbAware {
}

addSeparator("Help")
add(DocsAction())
add(DiscordAction())
}
}
Expand Down

0 comments on commit 51d7e2c

Please sign in to comment.