Skip to content

Commit

Permalink
feat(core): allow OpenFileProcessor to accept arguments
Browse files Browse the repository at this point in the history
Updated the OpenFileProcessor in the core module to accept arguments. Previously, it only used the context's pipeData or genText. Now, it will first check if there are any arguments passed and use the first one if available.
  • Loading branch information
phodal committed Sep 20, 2024
1 parent d5a2d71 commit f54e0c0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class OpenFileProcessor : PostProcessor {
override fun isApplicable(context: PostProcessorContext): Boolean = true

override fun execute(project: Project, context: PostProcessorContext, console: ConsoleView?, args: List<Any>): String {
val file = context.pipeData["output"] ?: context.genText
val firstArg = args.firstOrNull()
val file = firstArg ?: context.pipeData["output"] ?: context.genText
if (file !is VirtualFile) {
if (file is String) {
// check has multiple files
Expand Down

0 comments on commit f54e0c0

Please sign in to comment.