mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup [pycharm]: close target-specific symbols
GitOrigin-RevId: cb0788461d5d71d68cf3abc0e62cc9ae0e16293b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
35688d8784
commit
bb6d87f1c2
@@ -10,11 +10,14 @@ import com.intellij.remote.ProcessControlWithMappings
|
||||
import com.intellij.util.PathMapper
|
||||
import com.intellij.util.PathMappingSettings
|
||||
import com.jetbrains.python.run.target.targetEnvironment
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
|
||||
@ApiStatus.Internal
|
||||
fun ProcessHandler.guessPathMapper(): PathMapper? =
|
||||
(this as? ProcessControlWithMappings)?.mappingSettings ?: targetEnvironment?.collectAllPathMappings()
|
||||
|
||||
fun TargetEnvironment.collectAllPathMappings(): PathMappingSettings {
|
||||
@ApiStatus.Internal
|
||||
internal fun TargetEnvironment.collectAllPathMappings(): PathMappingSettings {
|
||||
val pathMappings = mutableListOf<PathMappingSettings.PathMapping>()
|
||||
if (this is ExternallySynchronized) {
|
||||
pathMappings += synchronizedVolumes.map(TargetEnvironment.SynchronizedVolume::toPathMapping)
|
||||
|
||||
@@ -6,13 +6,15 @@ import com.intellij.execution.target.TargetEnvironmentConfiguration
|
||||
import com.intellij.execution.target.TargetEnvironmentType
|
||||
import com.intellij.execution.target.getTargetType
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
|
||||
|
||||
/**
|
||||
* When module sits on this target, should allow user create sdk on [confType]?
|
||||
* ``\\wsl$`` projects allow WSL and Docker
|
||||
*/
|
||||
fun TargetConfigurationWithLocalFsAccess.allowCreationTargetOfThisType(confType: TargetEnvironmentType<*>): Boolean {
|
||||
@ApiStatus.Internal
|
||||
internal fun TargetConfigurationWithLocalFsAccess.allowCreationTargetOfThisType(confType: TargetEnvironmentType<*>): Boolean {
|
||||
val javaClass = asTargetConfig.getTargetType().javaClass
|
||||
return javaClass == confType.javaClass || javaClass in confType.canProbablyRunCodeForeignTypes
|
||||
}
|
||||
@@ -22,7 +24,8 @@ fun TargetConfigurationWithLocalFsAccess.allowCreationTargetOfThisType(confType:
|
||||
* When module sits on this target, should allow user to choose sdk with [config]?
|
||||
* ``\\wsl$`` projects allow Docker AND only WSL with right distro
|
||||
*/
|
||||
fun TargetConfigurationWithLocalFsAccess.codeCouldProbablyBeRunWithConfig(config: TargetEnvironmentConfiguration?): Boolean {
|
||||
@ApiStatus.Internal
|
||||
internal fun TargetConfigurationWithLocalFsAccess.codeCouldProbablyBeRunWithConfig(config: TargetEnvironmentConfiguration?): Boolean {
|
||||
if (config == null) return false // For now no local target could run remote
|
||||
if (asTargetConfig == config) return true // Same config (like same wsl distro)
|
||||
return asTargetConfig.getTargetType().javaClass in config.getTargetType().canProbablyRunCodeForeignTypes
|
||||
|
||||
@@ -39,7 +39,8 @@ import java.nio.file.Path
|
||||
* Append PYTHONPATH from system environment for local target if it is necessary
|
||||
* checkPythonPathInEnvs flag used for optionally checking envs already contains PYTHONPATH
|
||||
*/
|
||||
fun initPythonPath(envs: MutableMap<String, TargetEnvironmentFunction<String>>,
|
||||
@ApiStatus.Internal
|
||||
internal fun initPythonPath(envs: MutableMap<String, TargetEnvironmentFunction<String>>,
|
||||
passParentEnvs: Boolean,
|
||||
pythonPathList: MutableCollection<TargetEnvironmentFunction<String>>,
|
||||
targetEnvironmentRequest: TargetEnvironmentRequest,
|
||||
@@ -114,7 +115,8 @@ private fun collectPythonPath(context: Context,
|
||||
/**
|
||||
* List of [target->targetPath] functions. TargetPaths are to be added to ``PYTHONPATH`` because user did so
|
||||
*/
|
||||
fun getAddedPaths(sdkAdditionalData: SdkAdditionalData): List<TargetEnvironmentFunction<String>> {
|
||||
@ApiStatus.Internal
|
||||
internal fun getAddedPaths(sdkAdditionalData: SdkAdditionalData): List<TargetEnvironmentFunction<String>> {
|
||||
val pathList: MutableList<TargetEnvironmentFunction<String>> = ArrayList()
|
||||
if (sdkAdditionalData is PythonSdkAdditionalData) {
|
||||
val addedPaths = if (sdkAdditionalData is RemoteSdkProperties) {
|
||||
|
||||
+3
-1
@@ -4,10 +4,12 @@ package com.jetbrains.python.run.target
|
||||
import com.intellij.execution.target.TargetEnvironmentRequest
|
||||
import com.intellij.execution.target.local.LocalTargetEnvironmentRequest
|
||||
import com.intellij.execution.target.value.constantExplicit
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import java.nio.file.Path
|
||||
import kotlin.io.path.absolutePathString
|
||||
|
||||
class HelpersAwareLocalTargetEnvironmentRequest : HelpersAwareTargetEnvironmentRequest {
|
||||
@ApiStatus.Internal
|
||||
internal class HelpersAwareLocalTargetEnvironmentRequest : HelpersAwareTargetEnvironmentRequest {
|
||||
override val targetEnvironmentRequest: TargetEnvironmentRequest = LocalTargetEnvironmentRequest()
|
||||
|
||||
override fun preparePyCharmHelpers(): PythonHelpersMappings =
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.jetbrains.python.console.PyConsoleOptions
|
||||
import com.jetbrains.python.console.getPathMapper
|
||||
import com.jetbrains.python.remote.PyRemotePathMapper
|
||||
import com.jetbrains.python.remote.PythonRemoteInterpreterManager.appendBasicMappings
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import java.nio.file.Path
|
||||
|
||||
/**
|
||||
@@ -20,7 +21,8 @@ import java.nio.file.Path
|
||||
* @throws IllegalArgumentException if [localPath] cannot be found neither in SDK additional data nor within the registered uploads in the
|
||||
* request
|
||||
*/
|
||||
fun getTargetPathForPythonScriptExecution(project: Project,
|
||||
@ApiStatus.Internal
|
||||
internal fun getTargetPathForPythonScriptExecution(project: Project,
|
||||
sdk: Sdk?,
|
||||
pathMapper: PyRemotePathMapper?,
|
||||
localPath: Path): TargetEnvironmentFunction<String> {
|
||||
@@ -50,7 +52,8 @@ private fun PyRemotePathMapper.extendPythonSdkPathMapper(project: Project, sdk:
|
||||
* @throws IllegalArgumentException if [localPath] cannot be found neither in SDK additional data nor within the registered uploads in the
|
||||
* request
|
||||
*/
|
||||
fun getTargetPathForPythonConsoleExecution(project: Project,
|
||||
@ApiStatus.Internal
|
||||
internal fun getTargetPathForPythonConsoleExecution(project: Project,
|
||||
sdk: Sdk?,
|
||||
pathMapper: PyRemotePathMapper?,
|
||||
localPath: Path): TargetEnvironmentFunction<String> {
|
||||
|
||||
Reference in New Issue
Block a user