Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c09819

Browse files
committed
feat(devins): introduce ActionLocationEditor and ShireActionLocation enums for enhanced action location handling #379
1 parent 717008b commit 9c09819

36 files changed

+104
-57
lines changed

core/src/223/main/resources/META-INF/autodev-core.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@
230230
interface="cc.unitmesh.devti.indexer.provider.LangDictProvider"
231231
dynamic="true"
232232
/>
233+
234+
<extensionPoint qualifiedName="cc.unitmesh.shireActionLocationEditor"
235+
interface="cc.unitmesh.devti.devins.ActionLocationEditor"
236+
dynamic="true"/>
233237
</extensionPoints>
234238

235239
<!-- <projectListeners>-->

core/src/233/main/resources/META-INF/autodev-core.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@
239239
interface="cc.unitmesh.devti.indexer.provider.LangDictProvider"
240240
dynamic="true"
241241
/>
242+
243+
<extensionPoint qualifiedName="cc.unitmesh.shireActionLocationEditor"
244+
interface="cc.unitmesh.devti.devins.ActionLocationEditor"
245+
dynamic="true"/>
242246
</extensionPoints>
243247

244248
<projectListeners>

core/src/main/kotlin/cc/unitmesh/devti/AutoDevIcons.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,7 @@ object AutoDevIcons {
109109

110110
@JvmField
111111
val LOCAL_AGENT: Icon = IconLoader.getIcon("/icons/local-agent.svg", AutoDevIcons::class.java)
112+
113+
@JvmField
114+
val VARIABLE: Icon = IconLoader.getIcon("/icons/variable.svg", AutoDevIcons::class.java)
112115
}
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
package cc.unitmesh.devti.language.provider
1+
package cc.unitmesh.devti.devins
22

3-
import cc.unitmesh.devti.language.ast.config.ShireActionLocation
4-
import cc.unitmesh.devti.language.provider.action.VariableActionEventDataHolder
53
import com.intellij.ide.DataManager
64
import com.intellij.openapi.actionSystem.CommonDataKeys
75
import com.intellij.openapi.editor.Editor
@@ -16,7 +14,7 @@ interface ActionLocationEditor {
1614

1715
companion object {
1816
private val EP_NAME: ExtensionPointName<ActionLocationEditor> =
19-
ExtensionPointName.create("cc.unitmesh.shireActionLocationEditor")
17+
ExtensionPointName.Companion.create("cc.unitmesh.shireActionLocationEditor")
2018

2119
fun provide(project: Project, location: ShireActionLocation? = null): Editor? {
2220
if (location == null) {
@@ -51,4 +49,4 @@ interface ActionLocationEditor {
5149
fun defaultEditor(project: Project) =
5250
FileEditorManager.getInstance(project).selectedTextEditor
5351
}
54-
}
52+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cc.unitmesh.devti.language.ast.config
1+
package cc.unitmesh.devti.devins
22

33
enum class ShireActionLocation(val location: String, val description: String) {
44
CONTEXT_MENU("ContextMenu", "Show in Context Menu by Right Click"),
@@ -29,4 +29,4 @@ enum class ShireActionLocation(val location: String, val description: String) {
2929

3030
fun default(): String = RUN_PANEL.location
3131
}
32-
}
32+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cc.unitmesh.devti.language.provider.action
1+
package cc.unitmesh.devti.devins
22

33
import com.intellij.openapi.actionSystem.DataContext
44
import com.intellij.openapi.util.Key

core/src/main/kotlin/cc/unitmesh/devti/devins/JvmShireQLFuncType.kt renamed to core/src/main/kotlin/cc/unitmesh/devti/devins/shireql/JvmShireQLFuncType.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cc.unitmesh.devti.devins
1+
package cc.unitmesh.devti.devins.shireql
22

33
enum class JvmShireQLFuncType(val methodName: String, val description: String) {
44
GET_NAME("getName", "Get class name"),
Lines changed: 14 additions & 0 deletions
Loading

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/console/AutoDevConsoleAction.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package cc.unitmesh.devti.language.actions.console
22

33
import cc.unitmesh.devti.language.actions.DevInsRunFileAction
4-
import cc.unitmesh.devti.language.ast.config.ShireActionLocation
5-
import cc.unitmesh.devti.language.provider.action.VariableActionEventDataHolder
4+
import cc.unitmesh.devti.devins.ShireActionLocation
5+
import cc.unitmesh.devti.devins.VariableActionEventDataHolder
66
import cc.unitmesh.devti.language.startup.DynamicShireActionService
77
import com.intellij.openapi.actionSystem.ActionUpdateThread
88
import com.intellij.openapi.actionSystem.AnAction

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/context/AutoDevContextMenuActionGroup.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package cc.unitmesh.devti.language.actions.context
22

33
import com.intellij.openapi.actionSystem.*
44
import cc.unitmesh.devti.language.actions.base.validator.WhenConditionValidator
5-
import cc.unitmesh.devti.language.ast.config.ShireActionLocation
5+
import cc.unitmesh.devti.devins.ShireActionLocation
66
import cc.unitmesh.devti.language.startup.DynamicShireActionService
77

88
class AutoDevContextMenuActionGroup : ActionGroup() {

0 commit comments

Comments
 (0)