From eb4f2d1996ea76d740529f0d27715d224012635c Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Wed, 5 Nov 2025 23:41:46 +0100 Subject: [PATCH] [eel] Add `separator` to fs. While NIO has one, it represents local (the one used by `Path`) separator. This one represents separator on Eel GitOrigin-RevId: aadfc084314e353000be25c477fefa797ca564e9 --- .../intellij/platform/eel/fs/EelFileSystemApi.kt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/platform/eel/src/com/intellij/platform/eel/fs/EelFileSystemApi.kt b/platform/eel/src/com/intellij/platform/eel/fs/EelFileSystemApi.kt index 124b216ec9f7..4b9afab59842 100644 --- a/platform/eel/src/com/intellij/platform/eel/fs/EelFileSystemApi.kt +++ b/platform/eel/src/com/intellij/platform/eel/fs/EelFileSystemApi.kt @@ -12,10 +12,16 @@ import java.nio.ByteBuffer @get:ApiStatus.Internal val EelFileSystemApi.pathSeparator: String - get() = when (this) { - is EelFileSystemPosixApi -> ":" - is EelFileSystemWindowsApi -> ";" - else -> throw UnsupportedOperationException("Unsupported OS: ${this::class.java}") + get() = when (descriptor.osFamily) { + EelOsFamily.Posix -> ":" + EelOsFamily.Windows -> ";" + } + +@get:ApiStatus.Internal +val EelFileSystemApi.separator: Char + get() = when (descriptor.osFamily) { + EelOsFamily.Posix -> '/' + EelOsFamily.Windows -> '\\' } @ApiStatus.Internal @@ -1180,4 +1186,4 @@ suspend fun EelFileSystemApi.copy( suspend fun EelFileSystemApi.createTemporaryDirectory(setup: (EelFileSystemApi.CreateTemporaryEntryOptions.Builder).() -> Unit): EelResult { val options = EelFileSystemApi.CreateTemporaryEntryOptions.Builder().apply(setup).build() return createTemporaryDirectory(options) -} \ No newline at end of file +}