Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPirates committed Dec 28, 2024
1 parent 5d6beb2 commit 49a1f6f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/nl/hannahsten/texifyidea/util/files/FileSet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ fun findTectonicTomlInclusions(project: Project): List<Set<PsiFile>> {
// Actually, according to https://tectonic-typesetting.github.io/book/latest/v2cli/build.html?highlight=tectonic.toml#remarks Tectonic.toml files can appear in any parent directory, but we only search in the project for now
val tomlFiles = findTectonicTomlFiles(project)
val filesets = tomlFiles.mapNotNull { tomlFile ->
val data = TomlMapper().readValue(File(tomlFile.path), Map::class.java)
val outputList = data.getOrDefault("output", null) as? List<*> ?: return@mapNotNull null
val inputs = (outputList.firstOrNull() as? Map<*, *>)?.getOrDefault("inputs", null) as? List<*> ?: return@mapNotNull null
// Inputs can be either a map "inline" -> String or file name
// Actually it can also be just a single file name, but then we don't need all this gymnastics
inputs.filterIsInstance<String>().mapNotNull {
tomlFile.parent.findFile("src/$it")?.psiFile(project)
}.toSet()
}
val data = TomlMapper().readValue(File(tomlFile.path), Map::class.java)
val outputList = data.getOrDefault("output", null) as? List<*> ?: return@mapNotNull null
val inputs = (outputList.firstOrNull() as? Map<*, *>)?.getOrDefault("inputs", null) as? List<*> ?: return@mapNotNull null
// Inputs can be either a map "inline" -> String or file name
// Actually it can also be just a single file name, but then we don't need all this gymnastics
inputs.filterIsInstance<String>().mapNotNull {
tomlFile.parent.findFile("src/$it")?.psiFile(project)
}.toSet()
}

return filesets
}
Expand Down

0 comments on commit 49a1f6f

Please sign in to comment.