Skip to content

Commit 699f503

Browse files
committed
fix: formatting
1 parent 2a6a412 commit 699f503

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

server/e2e/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ test_suite(
176176
":partial_sync_test",
177177
":python_project_test",
178178
":remote_jdk_test",
179+
":rules_scala_bzlmod_test",
179180
":rust_project_test",
180181
":sample_repo_test",
181182
":server_downloads_bazelisk_test",
182-
":rules_scala_bzlmod_test",
183183
],
184184
)
185185

server/e2e/src/main/kotlin/org/jetbrains/bsp/bazel/RulesScalaBzlmodTest.kt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,14 @@ package org.jetbrains.bsp.bazel
33
import ch.epfl.scala.bsp4j.SourcesParams
44
import ch.epfl.scala.bsp4j.WorkspaceBuildTargetsResult
55
import io.kotest.matchers.collections.shouldContainExactlyInAnyOrder
6-
import io.kotest.matchers.paths.shouldExist
76
import io.kotest.matchers.shouldBe
8-
import io.kotest.matchers.maps.shouldContainAll
9-
import io.kotest.matchers.string.shouldEndWith
107
import kotlinx.coroutines.future.await
118
import org.jetbrains.bazel.label.Label
129
import org.jetbrains.bsp.bazel.base.BazelBspTestBaseScenario
1310
import org.jetbrains.bsp.bazel.base.BazelBspTestScenarioStep
1411
import org.jetbrains.bsp.bazel.install.Install
15-
import java.net.URI
1612
import kotlin.io.path.Path
1713
import kotlin.io.path.relativeTo
18-
import kotlin.io.path.toPath
1914
import kotlin.time.Duration.Companion.seconds
2015

2116
object RulesScalaBzlmodTest : BazelBspTestBaseScenario() {
@@ -72,10 +67,9 @@ object RulesScalaBzlmodTest : BazelBspTestBaseScenario() {
7267
.flatMap {
7368
it.sources
7469
}.map { Path(it.uri.removePrefix("file:")).relativeTo(Path(workspaceDir)).toString() } shouldContainExactlyInAnyOrder
75-
listOf(
76-
"Main.scala"
77-
)
70+
listOf(
71+
"Main.scala",
72+
)
7873
}
7974
}
80-
8175
}

server/server/src/main/kotlin/org/jetbrains/bsp/bazel/server/bsp/managers/BazelExternalRulesetsQuery.kt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import org.jetbrains.bazel.label.Label
88
import org.jetbrains.bsp.bazel.bazelrunner.BazelProcessResult
99
import org.jetbrains.bsp.bazel.bazelrunner.BazelRunner
1010
import org.jetbrains.bsp.bazel.logger.BspClientLogger
11-
import org.jetbrains.bsp.bazel.server.bzlmod.rootRulesToNeededTransitiveRules
1211
import org.jetbrains.bsp.bazel.server.bzlmod.BzlmodRepoMapping
1312
import org.jetbrains.bsp.bazel.server.bzlmod.RepoMapping
13+
import org.jetbrains.bsp.bazel.server.bzlmod.rootRulesToNeededTransitiveRules
1414
import org.jetbrains.bsp.bazel.workspacecontext.EnabledRulesSpec
1515
import org.w3c.dom.Document
1616
import org.w3c.dom.NodeList
@@ -43,14 +43,16 @@ class BazelExternalRulesetsQueryImpl(
4343
enabledRules.isNotEmpty() -> BazelEnabledRulesetsQueryImpl(enabledRules).fetchExternalRulesetNames(cancelChecker)
4444
else ->
4545
BazelBzlModExternalRulesetsQueryImpl(
46-
bazelRunner,
47-
isBzlModEnabled,
48-
bspClientLogger, repoMapping
49-
).fetchExternalRulesetNames(cancelChecker) + BazelWorkspaceExternalRulesetsQueryImpl(
46+
bazelRunner,
47+
isBzlModEnabled,
48+
bspClientLogger,
49+
repoMapping,
50+
).fetchExternalRulesetNames(cancelChecker) +
51+
BazelWorkspaceExternalRulesetsQueryImpl(
5052
bazelRunner,
5153
isWorkspaceEnabled,
5254
bspClientLogger,
53-
).fetchExternalRulesetNames(cancelChecker)
55+
).fetchExternalRulesetNames(cancelChecker)
5456
}
5557
}
5658

@@ -126,9 +128,9 @@ class BazelBzlModExternalRulesetsQueryImpl(
126128
graph { options.add("--output=json") }
127129
}
128130
val apparentRepoNameToCanonicalName =
129-
(repoMapping as? BzlmodRepoMapping)?.apparentRepoNameToCanonicalName ?: emptyMap()
131+
(repoMapping as? BzlmodRepoMapping)?.apparentRepoNameToCanonicalName ?: emptyMap()
130132
val canonicalNameToApparentRepoName =
131-
apparentRepoNameToCanonicalName.entries.associateBy({it.value}){ it.key}
133+
apparentRepoNameToCanonicalName.entries.associateBy({ it.value }) { it.key }
132134
val bzlmodGraphJson =
133135
bazelRunner
134136
.runBazelCommand(command, logProcessOutput = false, serverPidFuture = null)
@@ -154,8 +156,9 @@ class BazelBzlModExternalRulesetsQueryImpl(
154156
.flatten()
155157

156158
fun toApparentName(canonicalName: String) = canonicalNameToApparentRepoName.get(canonicalName)
157-
val deps = (directDeps + indirectDeps)
158-
.map { toApparentName("$it~") ?: toApparentName("$it+") ?: it}
159+
val deps =
160+
(directDeps + indirectDeps)
161+
.map { toApparentName("$it~") ?: toApparentName("$it+") ?: it }
159162
.distinct()
160163

161164
return deps

0 commit comments

Comments
 (0)