Use java.nio.file.Path in CoursierPaths instead of java.io.File #3364
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.
Hello. The Scala Plugin for IDEA has a copy of the CoursierPaths source code in our project.
https://github.com/JetBrains/intellij-scala/blob/idea251.x/scala/scala-impl/src/org/jetbrains/plugins/scala/project/sdkdetect/repository/CoursierPaths.java
I'd like to remove this copy and use the version provided by coursier directly, since coursier is itself a dependency of the Scala Plugin for IDEA.
Unfortunately, we've recently started a migration to
java.nio.file.Path
and away fromjava.io.File
. This will be necessary for proper support of remote development and WSL support in IDEA. Ideally, the CoursierPaths implementation would also usejava.nio.file.Path
behind the scenes.This draft PR is the first step towards that, to kickstart the process. As an initial idea, I've added new methods which return a
java.nio.file.Path
and deprecated the already existing methods returning ajava.io.File
. I've also replaced the private implementation withjava.nio.file.Path
. I've not touched anything else.Should we continue along this way, or do you have some other suggestions? Thank you.