mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 15:06:56 +07:00
IJPL-149878 IJent WSL FS refactoring: explicitly define IjentWslNioFsToggler.unregisterAll
GitOrigin-RevId: a8f71609450d594e120de7cb1ec76d095a3e3ec5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1eacd1d1af
commit
70f6a49e54
@@ -29,7 +29,7 @@ internal class IjentWslNioFsToggleStrategy(
|
||||
|
||||
init {
|
||||
coroutineScope.coroutineContext.job.invokeOnCompletion {
|
||||
ownFileSystems.unregisterAll()
|
||||
unregisterAll()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,6 +108,10 @@ internal class IjentWslNioFsToggleStrategy(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun unregisterAll() {
|
||||
ownFileSystems.unregisterAll()
|
||||
}
|
||||
}
|
||||
|
||||
private fun FileSystemProvider.unwrapIjentWslNioFileSystemProvider(): IjentWslNioFileSystemProvider? =
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.intellij.openapi.util.SystemInfo
|
||||
import com.intellij.platform.core.nio.fs.MultiRoutingFileSystemProvider
|
||||
import com.intellij.platform.ijent.IjentId
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.cancel
|
||||
import org.jetbrains.annotations.ApiStatus.Internal
|
||||
import org.jetbrains.annotations.TestOnly
|
||||
import org.jetbrains.annotations.VisibleForTesting
|
||||
@@ -52,6 +51,12 @@ class IjentWslNioFsToggler(private val coroutineScope: CoroutineScope) {
|
||||
strategy?.disable(distro)
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
fun unregisterAll() {
|
||||
strategy ?: error("Not available")
|
||||
strategy.unregisterAll()
|
||||
}
|
||||
|
||||
private val strategy = run {
|
||||
val defaultProvider = FileSystems.getDefault().provider()
|
||||
when {
|
||||
@@ -69,9 +74,4 @@ class IjentWslNioFsToggler(private val coroutineScope: CoroutineScope) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
fun unregisterAll() {
|
||||
coroutineScope.cancel()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user