Skip to content

Commit bc209cc

Browse files
authored
Update SqlCoreEnvironment.kt (#710)
Make localFileSystem, jarFileSystem protected as they are inherited properties in SqlDelight Unless there is some reason due to Isolation for these to be private Fix fixture tests with `file.toAbsolutePath` as the relative path breaks tests in SqlDelight
1 parent ba770ea commit bc209cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

environment/src/main/kotlin/com/alecstrong/sql/psi/core/SqlCoreEnvironment.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ open class SqlCoreEnvironment(
7676
env.coreApplicationEnvironment,
7777
)
7878

79-
private val localFileSystem: VirtualFileSystem = StandardFileSystems.local()
80-
private val jarFileSystem: VirtualFileSystem = StandardFileSystems.jar()
79+
protected val localFileSystem: VirtualFileSystem = StandardFileSystems.local()
80+
protected val jarFileSystem: VirtualFileSystem = StandardFileSystems.jar()
8181

8282
init {
8383
projectEnvironment.registerProjectComponent(
@@ -225,7 +225,7 @@ private class CoreFileIndex(
225225
val jarFilePath = file.toUri().toString().removePrefix("jar:file://")
226226
jarFileSystem.findFileByPath(jarFilePath)
227227
}
228-
StandardFileSystems.FILE_PROTOCOL -> localFileSystems.findFileByPath(file.pathString)
228+
StandardFileSystems.FILE_PROTOCOL -> localFileSystems.findFileByPath(file.toAbsolutePath().toString())
229229
else -> error("Not supported schema $schema")
230230
} ?: throw NullPointerException("File ${file.pathString} not found")
231231

0 commit comments

Comments
 (0)