Skip to content
This repository was archived by the owner on Aug 5, 2024. It is now read-only.

Commit 9915acf

Browse files
xuansontrinhSpace Team
authored andcommitted
[fix] Kotlin is set to have higher precedence than Java to always return Kotlin data object if exists.
Merge-request: BAZEL-MR-670 Merged-by: Xuan Son Trinh <[email protected]>
1 parent e6ad2a0 commit 9915acf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/src/main/kotlin/org/jetbrains/bsp/bazel/server/sync/BspProjectMapper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class BspProjectMapper(
160160
val label = BspMappings.toBspId(module)
161161
val dependencies =
162162
module.directDependencies.map(BspMappings::toBspId)
163-
val languages = module.languages.flatMap(Language::allNames)
163+
val languages = module.languages.flatMap(Language::allNames).distinct()
164164
val capabilities = inferCapabilities(module)
165165
val tags = module.tags.mapNotNull(BspMappings::toBspTag)
166166
val baseDirectory = BspMappings.toBspUri(module.baseDirectory)

server/src/main/kotlin/org/jetbrains/bsp/bazel/server/sync/languages/LanguagePluginsService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class LanguagePluginsService(
3232

3333
fun getPlugin(languages: Set<Language>): LanguagePlugin<*> =
3434
when {
35+
languages.contains(Language.KOTLIN) -> kotlinLanguagePlugin
3536
languages.contains(Language.SCALA) -> scalaLanguagePlugin
3637
languages.contains(Language.JAVA) -> javaLanguagePlugin
37-
languages.contains(Language.KOTLIN) -> kotlinLanguagePlugin
3838
languages.contains(Language.CPP) -> cppLanguagePlugin
3939
languages.contains(Language.THRIFT) -> thriftLanguagePlugin
4040
languages.contains(Language.PYTHON) -> pythonLanguagePlugin

0 commit comments

Comments
 (0)