mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[gitlab] use provided scope
GitOrigin-RevId: 60e9267d9ff9888732efdf57f8afa9529378ff11
This commit is contained in:
committed by
intellij-monorepo-bot
parent
422f6a997f
commit
8cd1016e97
@@ -1,14 +1,13 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gitlab
|
||||
|
||||
import com.intellij.collaboration.async.disposingScope
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.project.Project
|
||||
import git4idea.remote.hosting.HostedGitRepositoriesManager
|
||||
import git4idea.remote.hosting.gitRemotesFlow
|
||||
import git4idea.remote.hosting.mapToServers
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.flow.*
|
||||
import org.jetbrains.plugins.gitlab.api.GitLabServerPath
|
||||
import org.jetbrains.plugins.gitlab.authentication.accounts.GitLabAccountManager
|
||||
@@ -16,7 +15,7 @@ import org.jetbrains.plugins.gitlab.util.GitLabProjectMapping
|
||||
|
||||
interface GitLabProjectsManager : HostedGitRepositoriesManager<GitLabProjectMapping>
|
||||
|
||||
internal class GitLabProjectsManagerImpl(project: Project) : GitLabProjectsManager, Disposable {
|
||||
internal class GitLabProjectsManagerImpl(project: Project, cs: CoroutineScope) : GitLabProjectsManager {
|
||||
|
||||
override val knownRepositoriesState: StateFlow<Set<GitLabProjectMapping>> by lazy {
|
||||
val gitRemotesFlow = gitRemotesFlow(project).distinctUntilChanged()
|
||||
@@ -31,11 +30,9 @@ internal class GitLabProjectsManagerImpl(project: Project) : GitLabProjectsManag
|
||||
LOG.debug("New list of known repos: $it")
|
||||
}
|
||||
|
||||
knownRepositoriesFlow.stateIn(disposingScope(), SharingStarted.Eagerly, emptySet())
|
||||
knownRepositoriesFlow.stateIn(cs, SharingStarted.Eagerly, emptySet())
|
||||
}
|
||||
|
||||
override fun dispose() = Unit
|
||||
|
||||
companion object {
|
||||
private val LOG = logger<GitLabProjectsManager>()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user