-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Integrate Java compiler with the problems API #27596
Comments
It would be great if that new API is also exposed to Gradle-Plugins not only Tooling API (like. IDEs). Usecase: The API would allow me to implement such a thing, because it would be able to track the occurred warnings reliably. |
Might be a moonshot but it could be a good idea to define a "standard" API for diagnostics to allow passing fix suggestions to the Problems API, so that IDEs could provide a "quick fix" action for example. Error Prone for instance produces such suggestions, and having them surfaced somehow down to the Problems API through the compiler diagnostics could allow IDEs to propose them as "quick fixes" directly. The feature request for the Gradle GitHub Action to surface problems reported through the Problems API as comments on pull request (gradle/actions#30) could take advantage of such structured information to add GitHub suggestions to the comments as equivalent to IDE "quick fixes" too. |
Goal
The Java compiler outputs compilation problems directly to the standard output. The problem with that is that the information is buried in the build output, and users must scroll up in the build log to figure out what made the build fail. This is a subpar experience, which we could improve by integrating the compiler task with the Problems API. By using the API, we can create a comprehensive report at the end of the build.
In addition to the reporting capabilities, structured problems could help IDEs and tools establish what went wrong and where. This is already the case in some of the tools, but it relies on parsing the console output vs. receiving well-defined, structured information about what happened. As an example, build scans can render a separated, focused report about compilation problems, which doesn't rely on the console output.
Resources
Deliverables
DiagnosticListener
for the Java compiler task emitting Problem events and delegate to default rendering-Werror
is specified.javac -source -1
IDE Integration improvements
section)Acceptance criteria
Stakeholders
Communication plan
Associated tasks
Tasks and issues
int
location types tolong
#27998-Werror
flag should transform warnings to errors #27948IllegalArgumentException
with Java 8 is used with an annotation processor present #29113compileJava
tasks fails because of invalid compiler argument problems #29406DiagnosticFormatter
#29352contextualLabel
instead ofdetails
in Java problems #29605The text was updated successfully, but these errors were encountered: