File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
coverage/src/main/kotlin/org/rust/coverage Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 5
5
6
6
package org.rust.coverage
7
7
8
+ import com.intellij.openapi.util.io.systemIndependentPath
8
9
import com.intellij.util.containers.PeekableIteratorWrapper
9
10
import org.rust.stdext.buildList
10
11
import java.io.File
@@ -18,7 +19,7 @@ class LcovCoverageReport {
18
19
val file = File (filePath).let {
19
20
if (it.isAbsolute || basePath == null ) it else File (basePath, filePath)
20
21
}
21
- val normalizedFilePath = getNormalizedPath( file)
22
+ val normalizedFilePath = file.systemIndependentPath
22
23
val oldReport = info[normalizedFilePath]
23
24
val result = normalizeLineHitsList(report).let {
24
25
if (oldReport == null ) it else doMerge(oldReport, report)
@@ -103,17 +104,6 @@ class LcovCoverageReport {
103
104
}
104
105
105
106
companion object {
106
- private const val UNIX_SEPARATOR : String = " /"
107
-
108
- fun getNormalizedPath (file : File ): String {
109
- val uri = file.toURI()
110
- val normalizedUri = uri.normalize()
111
- var normalizedPath = normalizedUri.path
112
- if (normalizedPath.startsWith(UNIX_SEPARATOR ) && File .separator != UNIX_SEPARATOR ) {
113
- normalizedPath = normalizedPath.substring(1 )
114
- }
115
- return normalizedPath
116
- }
117
107
118
108
private fun normalizeLineHitsList (lineHits : List <LineHits >): List <LineHits > =
119
109
lineHits.sortedBy { it.lineNumber }.distinctBy { it.lineNumber }
You can’t perform that action at this time.
0 commit comments