fwcd / kotlin-language-server

Kotlin code completion, diagnostics and more for any editor/IDE using the Language Server Protocol
MIT License
1.62k stars 204 forks source link

Too strict regular matching makes it fail to match kotlin stdlib in bazel #468

Open xinzhengzhang opened 1 year ago

xinzhengzhang commented 1 year ago

I am using [project root]/kls-classpath to provider classpath from bazel to language server and the content of kls-classpath like this

# kls-classpath
# I have made a aspects to provide all header-jars which depend by the target

bazel build "//examples/android:app" --config=android_arm64 --aspects=@bis//:bisproject_aspect.bzl%bis_aspect --output_groups="bis all index dependents //examples/android:app_lib_kt,bis all index dependents @//examples/android:app_lib_kt,bis all index dependents @@//examples/android:app_lib_kt" 2> >(grep -o 'bazel-.*\.jar') | tr '\n' ':'

For kotlin stdlib the output path is bazel-out/<CONFIGURATION>/<PATH>/header_kotlin-stdlib-jdk8-1.8.20.jar with header prefix. And the file path can not be matched with val parser = Regex("""(kotlin-stdlib(-[^-]+)?)(?:-(\d+)\.(\d+)\.(\d+))?\.jar""") Can you make the regex a little broader here?

For example

Screenshot 2023-05-11 at 00 24 07