@@ -19,7 +19,6 @@ import com.intellij.openapi.ui.popup.JBPopupFactory
19
19
import com.intellij.openapi.ui.popup.JBPopupListener
20
20
import com.intellij.openapi.ui.popup.LightweightWindowEvent
21
21
import com.intellij.openapi.wm.IdeFocusManager
22
- import com.intellij.terminal.JBTerminalWidget
23
22
import com.intellij.ui.DocumentAdapter
24
23
import com.intellij.ui.awt.RelativePoint
25
24
import com.intellij.ui.components.JBLabel
@@ -48,11 +47,13 @@ class ShellCommandSuggestAction : AnAction() {
48
47
49
48
showContentRenamePopup(contextComponent, getPreferredPopupPoint(e)) { data ->
50
49
val widget = TerminalUtil .getCurrentTerminalWidget(project) ? : return @showContentRenamePopup
51
- suggestCommand(widget, data, project)
50
+ suggestCommand(data, project) { string ->
51
+ widget.terminalStarter?.sendString(string, true )
52
+ }
52
53
}
53
54
}
54
55
55
- private fun suggestCommand (widget : JBTerminalWidget , data : String , project : Project ) {
56
+ open fun suggestCommand (data : String , project : Project , function : (str: String ) -> Unit? ) {
56
57
val templateRender = TemplateRender (GENIUS_PRACTISES )
57
58
val template = templateRender.getTemplate(" shell-suggest.vm" )
58
59
@@ -77,7 +78,7 @@ class ShellCommandSuggestAction : AnAction() {
77
78
throw Exception (" Shell command suggestion failed" )
78
79
}
79
80
80
- widget.terminalStarter?.sendString (it, true )
81
+ function (it)
81
82
}
82
83
} finally {
83
84
AutoDevStatusService .notifyApplication(AutoDevStatus .Ready )
0 commit comments