Skip to content

Commit

Permalink
refactor(runner): rename context variable and add editor to ShireRunn…
Browse files Browse the repository at this point in the history
…erContext

Renamed the 'context' variable to 'shireRunnerContext' for clarity. Also added 'editor' as a new property to the ShireRunnerContext data class. Updated all instances where the renamed variable and the updated data class are used.
  • Loading branch information
phodal committed Jun 29, 2024
1 parent 0350433 commit 734ab43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,22 @@ open class ShireRunConfigurationProfileState(
}

val agent = compileResult.executeAgent
val context = ShireRunnerContext(
val shireRunnerContext = ShireRunnerContext(
configuration = configuration,
processHandler = processHandler,
console = console!!,
myProject = myProject,
hole = hobbitHole,
prompt = promptText
prompt = promptText,
editor = editor,
)
val shireRunner: ShireRunner = when {
agent != null -> {
CustomRemoteAgentRunner(context, agent)
CustomRemoteAgentRunner(shireRunnerContext, agent)
}
else -> {
val isLocalMode = compileResult.isLocalCommand
ShireDefaultRunner(context, isLocalMode)
ShireDefaultRunner(shireRunnerContext, isLocalMode)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.phodal.shirelang.run.runner

import com.intellij.execution.console.ConsoleViewWrapperBase
import com.intellij.execution.process.ProcessHandler
import com.intellij.execution.ui.ConsoleView
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.phodal.shirecore.agent.InteractionType
import com.phodal.shirelang.compiler.hobbit.HobbitHole
Expand All @@ -10,10 +11,11 @@ import com.phodal.shirelang.run.ShireConfiguration
data class ShireRunnerContext(
val configuration: ShireConfiguration,
val processHandler: ProcessHandler,
val console: ConsoleViewWrapperBase,
val console: ConsoleView,
val myProject: Project,
val hole: HobbitHole?,
val prompt: String,
val editor: Editor?,
)

abstract class ShireRunner(open val context: ShireRunnerContext) {
Expand Down

0 comments on commit 734ab43

Please sign in to comment.