mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
index: shared indexes is enabled if we have a shared index downloader
GitOrigin-RevId: 21be0a9b21f88356d6b7091be0e0d154b9d75718
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2fca15eb8c
commit
a00746b6e1
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal
|
||||
|
||||
import com.intellij.index.SharedIndexExtensions
|
||||
import com.intellij.internal.SharedIndexesLogger.logDownloadNotifications
|
||||
import com.intellij.internal.SharedIndexesLogger.logNotification
|
||||
import com.intellij.notification.NotificationGroup
|
||||
@@ -26,7 +27,7 @@ import kotlinx.coroutines.runBlocking
|
||||
import org.jetbrains.concurrency.await
|
||||
import java.nio.file.Path
|
||||
|
||||
private fun isSharedIndexesDownloadEnabled() = ApplicationManager.getApplication()?.isUnitTestMode == false && Registry.`is`("shared.indexes.download")
|
||||
private fun isSharedIndexesDownloadEnabled() = ApplicationManager.getApplication()?.isUnitTestMode == false && Registry.`is`(SharedIndexExtensions.SHARED_INDEXES_DOWNLOAD_KEY)
|
||||
|
||||
class SharedJdkIndexChunkPreloader : JdkInstallerListener {
|
||||
override fun onJdkDownloadStarted(request: JdkInstallRequest, project: Project?) {
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.index;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.psi.stubs.StubSharedIndexExtension;
|
||||
import com.intellij.psi.stubs.StubUpdatingIndex;
|
||||
import com.intellij.util.indexing.FileBasedIndexExtension;
|
||||
import com.intellij.util.indexing.ID;
|
||||
import com.intellij.util.indexing.provided.OnDiskSharedIndexChunkLocator;
|
||||
import com.intellij.util.indexing.provided.SharedIndexExtension;
|
||||
import com.intellij.util.io.DataExternalizer;
|
||||
import com.intellij.util.io.KeyDescriptor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class SharedIndexExtensions {
|
||||
public static final String SHARED_INDEXES_DOWNLOAD_KEY = "shared.indexes.download";
|
||||
private static final String SHARED_INDEX_ENABLED = "shared.index.enabled";
|
||||
|
||||
public static boolean areSharedIndexesEnabled() {
|
||||
return System.getProperty(OnDiskSharedIndexChunkLocator.ROOT_PROP) != null || System.getProperty(SHARED_INDEX_ENABLED) != null;
|
||||
return System.getProperty(OnDiskSharedIndexChunkLocator.ROOT_PROP) != null ||
|
||||
System.getProperty(SHARED_INDEX_ENABLED) != null ||
|
||||
(!ApplicationManager.getApplication().isUnitTestMode() && Registry.is(SHARED_INDEXES_DOWNLOAD_KEY));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user