Skip to content

Commit

Permalink
fix: stackoverflow in gen wire
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhangli committed Jan 6, 2023
1 parent f0783bd commit 22f1bef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import com.github.suhli.ideagokratosplugin.helper.DirHelper
import com.intellij.openapi.diagnostic.Logger

class KratosConfig {
public var wireLocation = ""
get() {
return DirHelper.join(*wireLocation.split("/").toTypedArray())
}
private var wireLocation = ""

public var layoutRepository = ""

fun getWireLocation(): String {
return DirHelper.join(*wireLocation.split("/").toTypedArray())
}

companion object {
private val LOG = Logger.getInstance(KratosConfig::class.java)
fun fromLines(lines: List<String>): KratosConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ private fun genWire(dir: PsiDirectory, config: KratosConfig): List<KratosTask>?

val project = dir.project
var targetDir = dir
if (config.wireLocation.isNotEmpty()) {
targetDir = DirHelper.cd(dir, config.wireLocation) ?: throw RuntimeException("no such dir")
if (config.getWireLocation().isNotEmpty()) {
targetDir = DirHelper.cd(dir, config.getWireLocation()) ?: throw RuntimeException("no such dir")
}
val providerSets = collectProviderSets(dir)
val notExistRequirements = scanForNotProvideTypes(providerSets)
Expand Down

0 comments on commit 22f1bef

Please sign in to comment.