Skip to content
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

Render Gradle problem reports as Eclipse error markers #1306

Merged
merged 17 commits into from
Jul 22, 2024

Conversation

donat
Copy link
Contributor

@donat donat commented Jun 10, 2024

The Gradle Tooling API now exposes problem reports via Tooling API events. This change implements a listener consuming problem events an converting them to Eclipse error markers.

The feature is not enabled by default. Users need to explicitly opt-in for the time being.
image

Reported problems show up in the Eclipse Problems view under the Gradle Problem type. The reports are cleared and recreated for every build invocation (sync and task execution).
image

The error marker has a custom properties page with the report details. Documentation links are navigable and there's a button for copying the stacktrace, just like on the generic Eclipse marker properties page.
image

Tasks

  • Add additional data to UI
  • Use release version of Tooling API

@donat donat changed the title Render Gradle problem reports with Eclipse error markers Render Gradle problem reports as Eclipse error markers Jun 10, 2024
private void reportProblem(SingleProblemEvent event) {
List<Location> locations = event.getLocations();

// 1/4 offset in file location
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could make this bit a bit cleaner; let's discuss details.

@donat
Copy link
Contributor Author

donat commented Jun 10, 2024

@reinsch82 I'm interested in your initial feedback.

@donat donat self-assigned this Jun 10, 2024
@donat donat requested review from reinsch82 June 10, 2024 15:50
Copy link
Contributor

@reinsch82 reinsch82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial feedback :)

Thanks for the work

build.gradle Outdated Show resolved Hide resolved
@donat donat marked this pull request as ready for review July 19, 2024 13:22
Copy link
Contributor

@reinsch82 reinsch82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 minor comments

LGTM

@@ -33,14 +33,14 @@ class WorkspaceConfigurationTest extends WorkspaceSpecification {
}

@Rollup
def "Can save workpsace configuration"(GradleDistribution distribution, String gradleUserHome, String javaHome, boolean offlineMode, boolean buildScansEnabled, boolean autoSync, List args, List jvmArgs, boolean showConsole, boolean showExecutions, moduleSupportEnabled) {
def "Can save workspace configuration"(GradleDistribution distribution, String gradleUserHome, String javaHome, boolean offlineMode, boolean buildScansEnabled, boolean autoSync, List args, List jvmArgs, boolean showConsole, boolean showExecutions, moduleSupportEnabled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I guess that should be there

Suggested change
def "Can save workspace configuration"(GradleDistribution distribution, String gradleUserHome, String javaHome, boolean offlineMode, boolean buildScansEnabled, boolean autoSync, List args, List jvmArgs, boolean showConsole, boolean showExecutions, moduleSupportEnabled) {
def "Can save workspace configuration"(GradleDistribution distribution, String gradleUserHome, String javaHome, boolean offlineMode, boolean buildScansEnabled, boolean autoSync, List args, List jvmArgs, boolean showConsole, boolean showExecutions, boolean moduleSupportEnabled) {

}

public static int countLines(String str) {
return Lists.newArrayList(Splitter.on(System.lineSeparator()).split(str)).size();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Maybe?

Suggested change
return Lists.newArrayList(Splitter.on(System.lineSeparator()).split(str)).size();
return Splitter.on(System.lineSeparator()).splitToList(str).size();

@donat donat merged commit ec8eee3 into master Jul 22, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants