File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
core/src/main/kotlin/cc/unitmesh/devti/observer/test Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView
12
12
import com.intellij.execution.ui.ExecutionConsole
13
13
import com.intellij.execution.ui.RunContentManager
14
14
import com.intellij.openapi.application.runReadAction
15
+ import com.intellij.openapi.editor.RangeMarker
15
16
import com.intellij.openapi.project.Project
16
17
import com.intellij.openapi.util.TextRange
17
18
import com.intellij.openapi.vfs.VirtualFile
18
19
import com.intellij.psi.search.GlobalSearchScope
19
- import com.intellij.refactoring.suggested.range
20
20
import java.lang.reflect.Field
21
21
22
22
object RunTestUtil {
@@ -141,4 +141,18 @@ object RunTestUtil {
141
141
return null
142
142
}
143
143
}
144
- }
144
+ }
145
+
146
+
147
+ val RangeMarker .range: TextRange ?
148
+ get() {
149
+ if (! isValid) return null
150
+ val start = startOffset
151
+ val end = endOffset
152
+ return if (start in 0 .. end) {
153
+ TextRange (start, end)
154
+ } else {
155
+ // Probably a race condition had happened and range marker is invalidated
156
+ null
157
+ }
158
+ }
You can’t perform that action at this time.
0 commit comments