Skip to content

Commit

Permalink
chore; simplize className statement
Browse files Browse the repository at this point in the history
Co-authored-by: Evgeniy Zhelenskiy <55230817+zhelenskiy@users.noreply.github.com>
  • Loading branch information
zoobestik and zhelenskiy authored Dec 14, 2023
1 parent 6490ff8 commit 9102345
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,8 @@ fun <T> CLICompiler<*>.tryCompilation(inputDirectory: Path, inputFiles: List<Pat
}
val errorFilePath = location?.path?.let(::Path)?.outputFilePathString() ?: defaultFileName

val errorDescriptor =
ErrorDescriptor(textInterval, message, messageSeverity, className = messageSeverity.name.let {
when {
!message.startsWith(UNRESOLVED_REFERENCE_PREFIX) && severity == ERROR -> "red_wavy_line"
else -> it
}
})
val className = if (!message.startsWith(UNRESOLVED_REFERENCE_PREFIX) && severity == ERROR) "red_wavy_line" else messageSeverity.name
val errorDescriptor = ErrorDescriptor(textInterval, message, messageSeverity, className)

diagnosticsMap.getOrPut(errorFilePath) { mutableListOf() }.add(errorDescriptor)
return ""
Expand Down

0 comments on commit 9102345

Please sign in to comment.