Code cleanup: unnecessary local variable applied
This commit is contained in:
@@ -42,8 +42,7 @@ class CommandExecutor(private val runner: KotlinConsoleRunner) {
|
||||
private fun getTrimmedCommandText(): String {
|
||||
val consoleView = runner.consoleView
|
||||
val document = consoleView.editorDocument
|
||||
val inputText = document.text.trim()
|
||||
return inputText
|
||||
return document.text.trim()
|
||||
}
|
||||
|
||||
private fun sendCommandToProcess(command: String) {
|
||||
|
||||
@@ -151,13 +151,13 @@ class ReplOutputProcessor(
|
||||
logError(this::class.java, internalErrorText)
|
||||
}
|
||||
|
||||
private fun getAttributesForSeverity(start: Int, end: Int, severity: Severity): TextAttributes {
|
||||
val attributes = when (severity) {
|
||||
Severity.ERROR -> getAttributesForSeverity(HighlightInfoType.ERROR, HighlightSeverity.ERROR, CodeInsightColors.ERRORS_ATTRIBUTES, start, end)
|
||||
Severity.WARNING -> getAttributesForSeverity(HighlightInfoType.WARNING, HighlightSeverity.WARNING, CodeInsightColors.WARNINGS_ATTRIBUTES, start, end)
|
||||
Severity.INFO -> getAttributesForSeverity(HighlightInfoType.WEAK_WARNING, HighlightSeverity.WEAK_WARNING, CodeInsightColors.WEAK_WARNING_ATTRIBUTES, start, end)
|
||||
}
|
||||
return attributes
|
||||
private fun getAttributesForSeverity(start: Int, end: Int, severity: Severity): TextAttributes = when (severity) {
|
||||
Severity.ERROR ->
|
||||
getAttributesForSeverity(HighlightInfoType.ERROR, HighlightSeverity.ERROR, CodeInsightColors.ERRORS_ATTRIBUTES, start, end)
|
||||
Severity.WARNING ->
|
||||
getAttributesForSeverity(HighlightInfoType.WARNING, HighlightSeverity.WARNING, CodeInsightColors.WARNINGS_ATTRIBUTES, start, end)
|
||||
Severity.INFO ->
|
||||
getAttributesForSeverity(HighlightInfoType.WEAK_WARNING, HighlightSeverity.WEAK_WARNING, CodeInsightColors.WEAK_WARNING_ATTRIBUTES, start, end)
|
||||
}
|
||||
|
||||
private fun getAttributesForSeverity(
|
||||
|
||||
Reference in New Issue
Block a user