mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[eel][wsl] IJPL-196973 Compile error open target not source in wsl
- Split EelDescriptor in to EelDescriptor and the EelMachine - Add EelPathBoundDescriptor GitOrigin-RevId: e0b7e5d5f3532682498466642b034e1892ef3cda
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cc05795d91
commit
2fa1af099c
+6
-5
@@ -8,6 +8,7 @@ import com.intellij.openapi.diagnostic.fileLogger
|
||||
import com.intellij.openapi.util.registry.RegistryManager
|
||||
import com.intellij.platform.eel.EelApi
|
||||
import com.intellij.platform.eel.EelDescriptor
|
||||
import com.intellij.platform.eel.EelMachine
|
||||
import com.intellij.platform.eel.provider.getEelDescriptor
|
||||
import com.intellij.platform.eel.provider.localEel
|
||||
import com.intellij.python.community.impl.installer.PySdkToInstallManager
|
||||
@@ -49,13 +50,13 @@ internal suspend fun getCacheTimeout(): Duration? =
|
||||
@Internal
|
||||
internal class SystemPythonServiceImpl(scope: CoroutineScope) : SystemPythonService, SimplePersistentStateComponent<MyServiceState>(MyServiceState()) {
|
||||
private val findPythonsMutex = Mutex()
|
||||
private val _cacheImpl: CompletableDeferred<Cache<EelDescriptor, SystemPython>?> = CompletableDeferred()
|
||||
private val _cacheImpl: CompletableDeferred<Cache<EelMachine, SystemPython>?> = CompletableDeferred()
|
||||
private suspend fun cache() = _cacheImpl.await()
|
||||
|
||||
init {
|
||||
scope.launch {
|
||||
_cacheImpl.complete(getCacheTimeout()?.let { interval ->
|
||||
Cache<EelDescriptor, SystemPython>(scope, interval) { eelDescriptor ->
|
||||
Cache<EelMachine, SystemPython>(scope, interval) { eelDescriptor ->
|
||||
searchPythonsPhysicallyNoCache(eelDescriptor.toEelApi())
|
||||
}
|
||||
})
|
||||
@@ -67,7 +68,7 @@ internal class SystemPythonServiceImpl(scope: CoroutineScope) : SystemPythonServ
|
||||
.getOr(PySystemPythonBundle.message("py.system.python.service.python.is.broken", pythonPath)) { return it }
|
||||
val systemPython = SystemPython(pythonWithLangLevel, null)
|
||||
state.userProvidedPythons.add(pythonPath.pathString)
|
||||
cache()?.get(pythonPath.getEelDescriptor())?.add(systemPython)
|
||||
cache()?.get(pythonPath.getEelDescriptor().machine)?.add(systemPython)
|
||||
return Result.success(systemPython)
|
||||
}
|
||||
|
||||
@@ -80,10 +81,10 @@ internal class SystemPythonServiceImpl(scope: CoroutineScope) : SystemPythonServ
|
||||
cache.startUpdate()
|
||||
if (forceRefresh) {
|
||||
logger.info("pythons refresh requested")
|
||||
cache.updateCache(eelApi.descriptor) // Update cache and suspend till update finished
|
||||
cache.updateCache(eelApi.descriptor.machine) // Update cache and suspend till update finished
|
||||
}
|
||||
else {
|
||||
cache.get(eelApi.descriptor)
|
||||
cache.get(eelApi.descriptor.machine)
|
||||
}.sorted()
|
||||
} ?: searchPythonsPhysicallyNoCache(eelApi).sorted()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user