Skip to content

Commit

Permalink
feat: update cli config for runner
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Oct 4, 2022
1 parent cc44c7f commit c9b7db4
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,22 @@ class FkRunConfigurationProducer : LazyRunConfigurationProducer<FkCommandConfigu
if (psiFile !is FkFile) return false
if (location.psiElement !is FeakinImplDeclaration) return false

val implName = (location.psiElement as FeakinImplDeclaration).implName.nameComponent.identifier.text
val feakinImplDecl = location.psiElement as FeakinImplDeclaration
val implName = feakinImplDecl.implName.nameComponent.identifier.text
log.debug("implName: $implName")

configuration.name = "Run $implName gen "
// configuration.command = "Run $implName gen "
configuration.command = fromImplDecl(feakinImplDecl, psiFile)

return true
}

private fun fromImplDecl(feakinImplDecl: FeakinImplDeclaration, psiFile: FkFile): String {
val path = psiFile.virtualFile.path
val implName = feakinImplDecl.implName.nameComponent.identifier.text
return "fkl gen --impl $implName --path $path"
}

override fun isConfigurationFromContext(
configuration: FkCommandConfiguration,
context: ConfigurationContext
Expand Down

0 comments on commit c9b7db4

Please sign in to comment.