Skip to content

Commit

Permalink
Remove PsiFile.basePath
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex committed May 5, 2024
1 parent 3e4a72b commit 09a6773
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.detekt.parser

import io.github.detekt.psi.absolutePath
import io.github.detekt.psi.basePath
import io.github.detekt.psi.lineSeparator
import io.github.detekt.psi.relativePath
import org.intellij.lang.annotations.Language
Expand Down Expand Up @@ -34,7 +33,6 @@ open class KtCompiler(
this.absolutePath = normalizedAbsolutePath
this.lineSeparator = content.determineLineSeparator()
val normalizedBasePath = basePath.absolute().normalize()
this.basePath = normalizedBasePath.absolute()
this.relativePath = normalizedBasePath.relativize(normalizedAbsolutePath)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.github.detekt.parser

import io.github.detekt.psi.basePath
import io.github.detekt.psi.lineSeparator
import io.github.detekt.psi.relativePath
import io.github.detekt.test.utils.resourceAsPath
Expand All @@ -26,8 +25,6 @@ class KtCompilerSpec {
assertThat(ktFile.lineSeparator).isEqualTo("\n")
assertThat(ktFile.relativePath)
.isEqualTo(Path("DefaultLf.kt"))
assertThat(ktFile.basePath)
.endsWith(Path("cases"))
}

@Test
Expand All @@ -37,8 +34,6 @@ class KtCompilerSpec {
assertThat(ktFile.lineSeparator).isEqualTo("\r\n")
assertThat(ktFile.relativePath)
.isEqualTo(Path("DefaultCrLf.kt"))
assertThat(ktFile.basePath)
.endsWith(Path("cases"))
}

@Test
Expand Down
2 changes: 0 additions & 2 deletions detekt-psi-utils/api/detekt-psi-utils.api
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ public final class io/github/detekt/psi/FunctionMatcher$Companion {
}

public final class io/github/detekt/psi/KeysKt {
public static final fun getBasePath (Lorg/jetbrains/kotlin/com/intellij/psi/PsiFile;)Ljava/nio/file/Path;
public static final fun getLineSeparator (Lorg/jetbrains/kotlin/com/intellij/psi/PsiFile;)Ljava/lang/String;
public static final fun getRelativePath (Lorg/jetbrains/kotlin/com/intellij/psi/PsiFile;)Ljava/nio/file/Path;
public static final fun setBasePath (Lorg/jetbrains/kotlin/com/intellij/psi/PsiFile;Ljava/nio/file/Path;)V
public static final fun setLineSeparator (Lorg/jetbrains/kotlin/com/intellij/psi/PsiFile;Ljava/lang/String;)V
public static final fun setRelativePath (Lorg/jetbrains/kotlin/com/intellij/psi/PsiFile;Ljava/nio/file/Path;)V
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ import org.jetbrains.kotlin.psi.UserDataProperty
import java.nio.file.Path

var PsiFile.relativePath: Path? by UserDataProperty(Key("relativePath"))
var PsiFile.basePath: Path? by UserDataProperty(Key("basePath"))
var PsiFile.lineSeparator: String by NotNullableUserDataProperty(Key("lineSeparator"), System.lineSeparator())

0 comments on commit 09a6773

Please sign in to comment.