File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
server/server/src/main/kotlin/org/jetbrains/bsp/bazel/server/sync/languages/scala Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,10 @@ class ScalaSdkResolver(private val bazelPathsResolver: BazelPathsResolver) {
4343 JarFile (path.toFile()).use { jar ->
4444 jar.manifest?.mainAttributes?.let { attributes ->
4545 attributes.getValue(" Bundle-Version" )?.let {
46- val version = it.split(" -" ).first()
47- return version
46+ val versionMatcher = JAR_VERSION_PATTERN .matcher(it)
47+ if (versionMatcher.find()) {
48+ return versionMatcher.group(1 )
49+ }
4850 }
4951 }
5052 }
@@ -64,5 +66,6 @@ class ScalaSdkResolver(private val bazelPathsResolver: BazelPathsResolver) {
6466 companion object {
6567 private val VERSION_PATTERN =
6668 Pattern .compile(" (?:processed_)?scala3?-(?:library|compiler|reflect)(?:_3)?-([.\\ d]+)\\ .jar" )
69+ private val JAR_VERSION_PATTERN = Pattern .compile(" (\\ d+\\ .\\ d+\\ .\\ d+)" )
6770 }
6871}
You can’t perform that action at this time.
0 commit comments