Skip to content

Commit faab726

Browse files
authored
Merge pull request #22 from devchat-ai/fix-show-settings
Fix show settings
2 parents 19939f6 + 7d9d9ad commit faab726

7 files changed

Lines changed: 36 additions & 23 deletions

File tree

.idea/misc.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group = "ai.devchat"
9-
version = "0.0.4"
9+
version = "0.0.1"
1010

1111
repositories {
1212
mavenCentral()
@@ -49,7 +49,8 @@ tasks {
4949
}
5050

5151
publishPlugin {
52-
token.set(System.getenv("PUBLISH_TOKEN"))
52+
token.set(System.getenv("INTELLIJ_PUBLISH_TOKEN"))
53+
channels.set(listOf("eap"))
5354
}
5455
}
5556
kotlin {

src/main/kotlin/ai/devchat/devchat/handler/ShowSettingDialogRequestHandler.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package ai.devchat.devchat.handler
22

33
import ai.devchat.devchat.BaseActionHandler
44
import ai.devchat.devchat.DevChatActions
5+
import ai.devchat.idea.settings.DevChatSettingsConfigurable
56
import com.alibaba.fastjson.JSONObject
67
import com.intellij.openapi.actionSystem.*
78
import com.intellij.openapi.application.ApplicationManager
@@ -14,8 +15,8 @@ class ShowSettingDialogRequestHandler(metadata: JSONObject?, payload: JSONObject
1415
val project = handler?.project
1516
val dataContext = DataContext { dataId -> project.takeIf { CommonDataKeys.PROJECT.name == dataId }}
1617
val settingsAction = ActionManager.getInstance().getAction("ShowSettings")
17-
val event = AnActionEvent.createFromDataContext(ActionPlaces.UNKNOWN, null, dataContext)
18+
val event = AnActionEvent.createFromDataContext(ActionPlaces.POPUP, null, dataContext)
1819
ApplicationManager.getApplication().invokeLater { settingsAction.actionPerformed(event) }
19-
ShowSettingsUtil.getInstance().showSettingsDialog(project, "DevChat")
20+
ShowSettingsUtil.getInstance().editConfigurable(project, DevChatSettingsConfigurable.get())
2021
}
2122
}

src/main/kotlin/ai/devchat/idea/settings/DevChatSettingsConfigurable.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,10 @@ class DevChatSettingsConfigurable : Configurable {
5555
override fun disposeUIResources() {
5656
devChatSettingsComponent = null
5757
}
58+
59+
companion object {
60+
fun get(): DevChatSettingsConfigurable {
61+
return DevChatSettingsConfigurable()
62+
}
63+
}
5864
}

src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<name>DevChat</name>
99

1010
<!-- A displayed Vendor name or Organization ID displayed on the Plugins Page. -->
11-
<vendor email="tao.hu@merico.dev" url="https://www.devchat.ai">DevChat</vendor>
11+
<vendor email="shiwen@merico.dev" url="https://www.devchat.ai">DevChat</vendor>
1212

1313
<!-- Description of the plugin displayed on the Plugin Page and IDE Plugin Manager.
1414
Simple HTML elements (text formatting, paragraphs, and lists) can be added inside of <![CDATA[ ]]> tag.
Lines changed: 5 additions & 17 deletions
Loading
Lines changed: 18 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)