Improve shell classpath and stdlib resolution #460
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).