mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
Python: findPathInHelpers must not be nullable.
Unless user breaks installation, helpers are always there GitOrigin-RevId: 080832690128e72128eef661f0a887ce4a85798d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
770520e473
commit
19c3576535
@@ -68,14 +68,18 @@ interface PythonHelpersLocator {
|
||||
*/
|
||||
@JvmStatic
|
||||
@RequiresBackgroundThread
|
||||
fun findPathInHelpers(resourceName: String): Path? {
|
||||
fun findPathInHelpers(resourceName: String): Path {
|
||||
return findPathInHelpersPossibleNull(resourceName) ?: error("File $resourceName does not exist in helpers root. Installation broken?")
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@RequiresBackgroundThread
|
||||
fun findPathInHelpersPossibleNull(resourceName: String): Path? {
|
||||
for (helperRoot in getHelpersRoots()) {
|
||||
val path = Path.of(helperRoot.pathString, resourceName)
|
||||
if (path.exists())
|
||||
return path
|
||||
}
|
||||
|
||||
LOG.info("File $resourceName does not exist in helpers root")
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -101,7 +105,7 @@ interface PythonHelpersLocator {
|
||||
@Internal
|
||||
@JvmStatic
|
||||
@RequiresBackgroundThread
|
||||
fun findPathStringInHelpers(@NonNls resourceName: String): String = findPathInHelpers(resourceName)?.absolutePathString() ?: ""
|
||||
fun findPathStringInHelpers(@NonNls resourceName: String): String = findPathInHelpers(resourceName).absolutePathString()
|
||||
|
||||
@Deprecated("Use {@link PythonHelpersLocator#findPathInHelpers}.", ReplaceWith("findPathInHelpers(resourceName)"), DeprecationLevel.ERROR)
|
||||
@JvmStatic
|
||||
|
||||
Reference in New Issue
Block a user