-
Notifications
You must be signed in to change notification settings - Fork 337
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
improvement: fetch missing dependency sources #5819
Conversation
1955642
to
0610210
Compare
0610210
to
7062b8c
Compare
223f168
to
6c67b4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Just two comments.
metals/src/main/scala/scala/meta/internal/metals/JarSourcesProvider.scala
Outdated
Show resolved
Hide resolved
.when(groupId.nonEmpty && version.nonEmpty && artifactId.nonEmpty) { | ||
Dependency.of(groupId, artifactId, version) | ||
} | ||
.filterNot(dep => isSbtDap(dep) || isMetalsPlugin(dep)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we filter those out? This might be added manually to the build even by the user. There is no way to see if it was added on purpose or automatically. I think it's fine to leave it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't get sbt-debug-adapter
to resolve correctly.
private def fetchDependencySources( | ||
dependency: Dependency | ||
): List[Path] = { | ||
Fetch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot about it and I think we do it wrong in most places. Could we make sure we handle an issue if there is no internet available? Make sure it doesn't get stuck etc. Probably we should have some timeout and do it in a separate future
try resolving debug adapter plugin
c02e2c6
to
2c3950f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes, but looks good!
.addClassifiers(Classifier.sources) | ||
.future() | ||
.map(_.map(_.toPath()).toList) | ||
.withTimeout(5, TimeUnit.MINUTES) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.withTimeout(5, TimeUnit.MINUTES) | |
.withTimeout(1, TimeUnit.MINUTES) |
would be enough I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if could fail quickly if maven central is not available?
metals/src/main/scala/scala/meta/internal/metals/JarSourcesProvider.scala
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
When build server fails to provide dependency sources for a build target metals will try to resolve/download the missing sources.
resolves: #4780