From 8f9debad905d9917f8a0249daaa1085ce2e9947b Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 17 Jun 2019 12:22:40 +0200 Subject: [PATCH] add @ApiStatus.Internal GitOrigin-RevId: 63e6bf0997f6aea7b52f5f768388c506a8c337ea --- .../src/com/intellij/configurationStore/storageUtil.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/configurationStore/storageUtil.kt b/platform/platform-impl/src/com/intellij/configurationStore/storageUtil.kt index 9c7a95ff3583..c212264bd7a6 100644 --- a/platform/platform-impl/src/com/intellij/configurationStore/storageUtil.kt +++ b/platform/platform-impl/src/com/intellij/configurationStore/storageUtil.kt @@ -23,6 +23,7 @@ import com.intellij.util.io.createDirectories import com.intellij.util.io.inputStream import com.intellij.util.io.systemIndependentPath import gnu.trove.THashSet +import org.jetbrains.annotations.ApiStatus import org.jetbrains.annotations.TestOnly import java.io.IOException import java.nio.file.Path @@ -33,6 +34,7 @@ const val NOTIFICATION_GROUP_ID = "Load Error" @TestOnly var DEBUG_LOG: String? = null +@ApiStatus.Internal fun doNotify(macros: MutableSet, project: Project, substitutorToStore: Map) { val productName = ApplicationNamesInfo.getInstance().productName val content = "

${macros.joinToString(", ")} ${if (macros.size == 1) "is" else "are"} undefined. Fix it

" + @@ -45,6 +47,7 @@ fun doNotify(macros: MutableSet, project: Project, substitutorToStore: M .notify(project) } +@ApiStatus.Internal fun checkUnknownMacros(project: Project, notify: Boolean) { // use linked set/map to get stable results val unknownMacros = LinkedHashSet() @@ -115,6 +118,7 @@ private fun collect(componentManager: ComponentManager, substitutorToStore.put(substitutor, store) } +@ApiStatus.Internal fun getOrCreateVirtualFile(file: Path, requestor: StorageManagerFileWriteRequestor): VirtualFile { val virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByPath(file.systemIndependentPath) if (virtualFile != null) { @@ -134,6 +138,7 @@ fun getOrCreateVirtualFile(file: Path, requestor: StorageManagerFileWriteRequest } // runWriteAction itself cannot do such check because in general case any write action must be tracked regardless of current action +@ApiStatus.Internal inline fun runAsWriteActionIfNeeded(crossinline runnable: () -> T): T { return when { ApplicationManager.getApplication().isWriteAccessAllowed -> runnable() @@ -142,6 +147,7 @@ inline fun runAsWriteActionIfNeeded(crossinline runnable: () -> T): T { } @Throws(IOException::class) +@ApiStatus.Internal fun readProjectNameFile(nameFile: Path): String? { return nameFile.inputStream().reader().useLines { line -> line.firstOrNull { !it.isEmpty() }?.trim() } } \ No newline at end of file