Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve shell classpath and stdlib resolution #460

Merged
merged 8 commits into from
Apr 14, 2023
Merged

Conversation

fwcd
Copy link
Owner

@fwcd fwcd commented Apr 14, 2023

This PR migrates the ShellClasspathResolver to accept naming conventions that are more in line with standard Unix conventions, e.g.

  • ~/.config/kotlin-language-server instead of ~/.config/KotlinLanguageServer
  • [project root]/kls-classpath instead of [project root]/kotlinLspClasspath.sh

The old names will still be supported for backwards compatibility. Additionally, .bat and .cmd files are now only resolved on Windows to have the language server pick the correct classpath script depending on platform.

Additionally, the PR improves the standard library resolution by filtering out source JARs when searching the local Gradle/Maven cache and by preferring the Kotlin CLI compiler stdlib over the local Gradle/Maven repository (if the user compiles Kotlin outside of Gradle/Maven, chances are that they use plain kotlinc, thus we should use the corresponding stdlib).

Update the ShellClassPathResolver to accept
~/.config/kotlin-language-server (instead of KotlinLanguageServer) and
kls-classpath.{sh,bat,cmd} instead of kotlinLspClasspath.{sh,bat,cmd},
along with scripts without a file extension to better adhere to Unix
conventions.
@fwcd fwcd added enhancement New feature or request dependency resolution Related to the project dependency/standard library resolver labels Apr 14, 2023
There are too many cases where manual formatting is more readable
with long lines.
@fwcd fwcd merged commit 31a9f2a into main Apr 14, 2023
@fwcd fwcd deleted the improve-shell-resolver branch April 14, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency resolution Related to the project dependency/standard library resolver enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant