mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 15:06:56 +07:00
[settingsSync] added SettingsSyncCommunicatorProvider.isAvailable
(cherry picked from commit 15f48b82f639c89aee0f25343f9c2306e16e4167) IJ-CR-154861 GitOrigin-RevId: 5854a8461a79b8f22af213d2487467a3e5120612
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4e157689c8
commit
0c4475b506
@@ -78,7 +78,7 @@ object RemoteCommunicatorHolder : SettingsSyncEventListener {
|
||||
|
||||
fun getAvailableProviders(): List<SettingsSyncCommunicatorProvider> {
|
||||
val extensionList = arrayListOf<SettingsSyncCommunicatorProvider>()
|
||||
extensionList.addAll(SettingsSyncCommunicatorProvider.PROVIDER_EP.extensionList)
|
||||
extensionList.addAll(SettingsSyncCommunicatorProvider.PROVIDER_EP.extensionList.filter { it.isAvailable() })
|
||||
if (extensionList.find { it.providerCode == DEFAULT_PROVIDER_CODE } == null) {
|
||||
extensionList.add(DummyDefaultCommunicatorProvider)
|
||||
}
|
||||
|
||||
@@ -21,6 +21,11 @@ interface SettingsSyncCommunicatorProvider {
|
||||
*/
|
||||
fun createCommunicator(userId: String): SettingsSyncRemoteCommunicator?
|
||||
|
||||
/**
|
||||
* Indicates whether provider is available. Allows to control provider availability inside the plugin
|
||||
*/
|
||||
fun isAvailable(): Boolean = true
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
val PROVIDER_EP = ExtensionPointName.create<SettingsSyncCommunicatorProvider>("com.intellij.settingsSync.communicatorProvider")
|
||||
|
||||
@@ -22,7 +22,5 @@ class JbaCommunicatorProvider : SettingsSyncCommunicatorProvider, Disposable {
|
||||
CloudConfigServerCommunicator(null, authServiceLazy.value)
|
||||
}.value
|
||||
|
||||
override fun dispose() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
override fun dispose() {}
|
||||
}
|
||||
Reference in New Issue
Block a user