Skip to content

Commit

Permalink
Support dynamic reloading (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-gibson committed Sep 2, 2024
1 parent 06f163a commit f82ccf9
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

## Unreleased

- Fix warnings and deprecations
- Support dynamic reloading

## 4.5.0 - 2024-09-02

- Fix BitBucket cloud URL generation when the remote contains scm (#333)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pluginGroup = uk.co.ben_gibson.git.link
pluginName = GitLink
# SemVer format -> https://semver.org
pluginVersion = 4.5.0
pluginVersion = 4.5.1

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
Expand Down
3 changes: 1 addition & 2 deletions src/main/kotlin/uk/co/ben_gibson/git/link/GitLinkBundle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ import com.intellij.openapi.options.ShowSettingsUtil
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.NonNls
import org.jetbrains.annotations.PropertyKey
import java.net.URL

@NonNls
private const val BUNDLE = "messages.MyBundle"

object GitLinkBundle : DynamicBundle(BUNDLE) {
val URL_BUG_REPORT = URL("https://github.com/ben-gibson/GitLink/issues")
const val URL_BUG_REPORT = "https://github.com/ben-gibson/GitLink/issues"

@Suppress("SpreadOperator")
@JvmStatic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package uk.co.ben_gibson.git.link.settings

import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.util.xmlb.XmlSerializerUtil
Expand All @@ -10,6 +11,7 @@ import com.intellij.util.xmlb.XmlSerializerUtil
* The [State] and [Storage] annotations define the name of the data and the file name where
* these persistent application settings are stored.
*/
@Service(Service.Level.PROJECT)
@State(name = "uk.co.ben_gibson.git.link.SettingsState", storages = [Storage("GitLink.xml")])
class ProjectSettings : PersistentStateComponent<ProjectSettings?> {
var host: String? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CustomPlatformSettingsConfigurable : BoundConfigurable(message("settings.c
.align(Align.FILL)
}
row {
browserLink(message("actions.report-bug.title"), GitLinkBundle.URL_BUG_REPORT.toString())
browserLink(message("actions.report-bug.title"), GitLinkBundle.URL_BUG_REPORT)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class DomainRegistrySettings : BoundConfigurable(message("settings.domain-regist
.align(Align.FILL)
}
row {
browserLink(message("actions.report-bug.title"), GitLinkBundle.URL_BUG_REPORT.toString())
browserLink(message("actions.report-bug.title"), GitLinkBundle.URL_BUG_REPORT)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ProjectSettingsConfigurable(project : Project) : BoundConfigurable(message
}
}
row {
browserLink(message("actions.report-bug.title"), GitLinkBundle.URL_BUG_REPORT.toString())
browserLink(message("actions.report-bug.title"), GitLinkBundle.URL_BUG_REPORT)
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
</description>

<extensions defaultExtensionNs="com.intellij">
<projectService serviceImplementation="uk.co.ben_gibson.git.link.settings.ProjectSettings"/>
<applicationService serviceImplementation="uk.co.ben_gibson.git.link.settings.ApplicationSettings"/>
<notification.parentGroup id="git.link.notifications"/>
<notificationGroup id="git.link.notification.general" displayType="BALLOON" key="notification.group.general.name" />
<notificationGroup id="git.link.notification.important" displayType="STICKY_BALLOON" key="notification.group.important.name" />
<postStartupActivity implementation="uk.co.ben_gibson.git.link.listener.ApplicationStartupListener"/>
Expand Down

0 comments on commit f82ccf9

Please sign in to comment.