Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
denis_kusakin@epam.com committed Aug 15, 2021
2 parents 08cb5be + 5683e9d commit 991baf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
intellij {
version '2021.1'
version '2021.2'
}
patchPluginXml {
changeNotes """
Fix compatibility issue. Plugin is now available for IDEA 2021.1.
Fix compatibility issue. Plugin is now available for IDEA 2021.2.
"""
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ import org.deniskusakin.aem.groovyconsoleplugin.services.AemGroovyScriptsDetecti
import org.deniskusakin.aem.groovyconsoleplugin.services.PersistentStateService
import javax.swing.JComponent

class EditorDecorator(private val project: Project, private val notifications: EditorNotifications) : EditorNotifications.Provider<JComponent>() {
class EditorDecorator(private val project: Project) : EditorNotifications.Provider<JComponent>() {
companion object {
private val myKey = Key.create<JComponent>("aem.groovy.console.toolbar")
}

init {
val notifications = project.getService(EditorNotifications::class.java)
project.messageBus.connect(project).subscribe(SettingsChangedNotifier.TOPIC, object : SettingsChangedNotifier {
override fun settingsChanged() {
notifications.updateAllNotifications()
Expand All @@ -42,7 +43,8 @@ class EditorDecorator(private val project: Project, private val notifications: E
val service = ServiceManager.getService(project, PersistentStateService::class.java)
val serverFromFile = file.getUserData(AEMGroovyConsole.GROOVY_CONSOLE_CURRENT_SERVER)
val availableServerNames = service.getAEMServers().map { it.name }
val currentServerName = (if (serverFromFile == null || availableServerNames.contains(serverFromFile)) serverFromFile else null)
val currentServerName =
(if (serverFromFile == null || availableServerNames.contains(serverFromFile)) serverFromFile else null)
?: availableServerNames.firstOrNull()
file.putUserData(AEMGroovyConsole.GROOVY_CONSOLE_CURRENT_SERVER, currentServerName)
if (currentServerName == null) {
Expand Down

0 comments on commit 991baf9

Please sign in to comment.