-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add a mode to buildTarget/sources to return unmanaged sources only? #184
Comments
I think you mean The protocol already allows to send/receive source directories rather than individual files. So technically, a build server can respond with the base directory of the generated sources and trigger the generation asynchronously or even postpone the generation for when it's really needed ( That's not how it is implemented today in sbt, but maybe we should. @jastice Would that work in IntelliJ if the source generation is postponed to the first |
Yep, I've update description with the correct target. IntelliJ's project model only supports source directories so it would be just as happy to receive managed source directories. Another advantage of this approach that it makes it possible to import a project that has some erroneous code that would prevent the source generators from completing. But leaving the source generation until the first compile isn't ideal because a) the user can't see / program against the generated APIs until that point. |
In sbt we could implement something like this: case r if r.method == "buildTarget/sources" =>
val target = ...
callback.appendExec(s"bspBuildTargetSources $target", Some(r.id))
callback.appendExec(s"$target / managedSources", None) // trigger the source generations after responding That would prevent the build import from failing if the source generation fails. But it does not make the overall import time better because the next request, Actually I think it's not so bad to postpone the source generation until
Or even better, we could introduce |
Yes, triggering a build after import is feasible and probably not too disruptive. But if the build then generates new source directories that are not already reported by |
Yes but we can report the |
Yes, for the sbt use case this should work well. Other build tools may have a different approach and only report actually generated sources. |
This ticket is in the same spirit of #14, looking for ways to reduce long delays on IDE import.
I have been trying to use BSP to import scala/scala into IntelliJ. I noticed that the import triggers all source generators. In our project, this requires compilation of most of the project.
I would prefer to have source generators run in a second pass after the initial import. For the initial import, the IDE would be only need to know the base directories for generated sources. This would be enough to get the IDE into a working state while a background process triggered source generation (and any compilation transitively needed.)
/cc @jastice
The text was updated successfully, but these errors were encountered: