Skip to content

Commit 479a9c3

Browse files
committed
refactor(intellij): some code cleanup
1 parent 2dcdf7c commit 479a9c3

File tree

7 files changed

+8
-46
lines changed

7 files changed

+8
-46
lines changed

intellij-client/src/main/kotlin/dev/robotcode/robotcode4ij/debugging/RobotCodeDebugProcess.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,6 @@ class RobotCodeDebugProcess(
144144
return executionResult.processHandler
145145
}
146146

147-
override fun sessionInitialized() {
148-
super.sessionInitialized()
149-
}
150-
151147
override fun getBreakpointHandlers(): Array<out XBreakpointHandler<*>?> {
152148
return arrayOf(breakpointHandler, exceptionBreakpointHandler)
153149
}

intellij-client/src/main/kotlin/dev/robotcode/robotcode4ij/debugging/RobotCodeDebuggerEvaluator.kt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,4 @@ class RobotCodeDebuggerEvaluator(val debugServer: IDebugProtocolServer, val fram
4444
}
4545
}
4646

47-
override fun getEvaluationMode(text: String, startOffset: Int, endOffset: Int, psiFile: PsiFile?): EvaluationMode? {
48-
return super.getEvaluationMode(text, startOffset, endOffset, psiFile)
49-
}
50-
51-
override fun getExpressionInfoAtOffset(
52-
project: Project,
53-
document: Document,
54-
offset: Int,
55-
sideEffectsAllowed: Boolean
56-
): ExpressionInfo? {
57-
return super.getExpressionInfoAtOffset(project, document, offset, sideEffectsAllowed)
58-
}
59-
60-
override fun getExpressionRangeAtOffset(
61-
project: Project?,
62-
document: Document?,
63-
offset: Int,
64-
sideEffectsAllowed: Boolean
65-
): TextRange? {
66-
return super.getExpressionRangeAtOffset(project, document, offset, sideEffectsAllowed)
67-
}
6847
}

intellij-client/src/main/kotlin/dev/robotcode/robotcode4ij/debugging/breakpoints/RobotCodeExceptionBreakpointType.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ class RobotCodeExceptionBreakpointType :
3636
return RobotCodeExceptionBreakpointProperties()
3737
}
3838

39-
override fun addBreakpoint(
40-
project: Project?,
41-
parentComponent: JComponent?
42-
): XBreakpoint<RobotCodeExceptionBreakpointProperties>? {
43-
return super.addBreakpoint(project, parentComponent)
44-
}
45-
4639
override fun getBreakpointsDialogHelpTopic(): @NonNls String? {
4740
return "reference.dialogs.breakpoints"
4841
}

intellij-client/src/main/kotlin/dev/robotcode/robotcode4ij/execution/RobotCodeConfigurationType.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,4 @@ class RobotCodeConfigurationType : ConfigurationTypeBase(
1515
addFactory(configurationFactory)
1616
}
1717

18-
override fun isDumbAware(): Boolean {
19-
return super.isDumbAware()
20-
}
2118
}

intellij-client/src/main/kotlin/dev/robotcode/robotcode4ij/execution/RobotCodeRunLineMarkerContributor.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import dev.robotcode.robotcode4ij.testing.testManger
88

99
class RobotCodeRunLineMarkerContributor : RunLineMarkerContributor() {
1010
override fun getInfo(element: PsiElement): Info? {
11-
var testElement = element.project.testManger.findTestItem(element) ?: return null
11+
val testElement = element.project.testManger.findTestItem(element) ?: return null
1212
if (testElement.type != "test" && testElement.children.isNullOrEmpty()) {
1313
return null
1414
}
@@ -17,11 +17,8 @@ class RobotCodeRunLineMarkerContributor : RunLineMarkerContributor() {
1717
"robotcode", "/", newLocalFileUrl(testElement.source!!).toString()
1818
).addParameters(mapOf("line" to ((testElement.lineno ?: 1) - 1).toString()))
1919

20-
var icon = getTestStateIcon(uri.toString(), element.project, testElement.type != "test")
20+
val icon = getTestStateIcon(uri.toString(), element.project, testElement.type != "test")
2121
return withExecutorActions(icon)
2222
}
2323

24-
override fun getSlowInfo(element: PsiElement): Info? {
25-
return super.getSlowInfo(element)
26-
}
2724
}

intellij-client/src/main/kotlin/dev/robotcode/robotcode4ij/execution/RobotSMTestLocator.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ class RobotSMTestLocator : SMTestLocator {
2121
val line = uri.parameters?.drop(1)?.split("&")?.firstOrNull { it.startsWith("line=") }?.substring(5)
2222
?.toIntOrNull()
2323

24-
LocalFileSystem.getInstance().findFileByPath(uri.path)?.let {
25-
PsiManager.getInstance(project).findFile(it)?.let {
26-
val document = PsiDocumentManager.getInstance(project).getDocument(it)
27-
document?.let { doc ->
24+
LocalFileSystem.getInstance().findFileByPath(uri.path)?.let { virtualFile ->
25+
PsiManager.getInstance(project).findFile(virtualFile)?.let { psiFile ->
26+
27+
PsiDocumentManager.getInstance(project).getDocument(psiFile)?.let { doc ->
2828
val offset = doc.getLineStartOffset(line ?: 0)
29-
it.findElementAt(offset)
29+
psiFile.findElementAt(offset)
3030
}
3131
}
3232
}?.let {

intellij-client/src/main/kotlin/dev/robotcode/robotcode4ij/utils/NetUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ object NetUtils {
88
try {
99
ServerSocket(startPort).use { return startPort }
1010
} catch (_: Exception) {
11-
11+
1212
}
1313

1414
return if (endPort == null) {

0 commit comments

Comments
 (0)