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

Online help for problem markers #569

Merged
merged 1 commit into from
Feb 4, 2024

Conversation

Bananeweizen
Copy link
Collaborator

  • Register a problem marker help provider.
  • Calculate a context help topic for each marker and dynamically forward it to the original online help of the related check.

For the end user, pressing F1 on a marker has the result of opening the integrated Eclipse help and showing the checkstyle problem description online.

Fixes #568.

See the modifier order problem marker selected and its help shown:
grafik

group = "misc";
}
var file = moduleName.toLowerCase();
return "https://checkstyle.org/checks/" + group + "/" + file + ".html#" + moduleName;
Copy link
Member

Choose a reason for hiding this comment

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

I am not seeing this check, so I would recommend ensuring it is a Checkstyle check. You don't want to assume all are as this would cause issues with 3rd parties like sevntu checks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

AFAIK we will not be asked for a context in line 80 if we returned false from line 70. E.g. first comes the "hasContext", and only then the "getContext" call (if hasContext was true). But I could add a second identical check in getContext to be on the safe side. We will not get into this method (with your comment) if getContext() doesn't return a context.

Copy link
Member

@rnveach rnveach Sep 19, 2023

Choose a reason for hiding this comment

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

I will take your word at this, as I don't know EclipseCS enough on how context connects to if the check is from checkstyle or a 3rd party. I was just raising the concern that the link create will be invalid if you run it for a 3rd party check as it's documentation will not be on Checkstyle's website.

* Register a problem marker help provider.
* Calculate a context help topic for each marker and dynamically forward
it to the original online help of the related check.

For the end user, pressing F1 on a marker has the result of opening the
integrated Eclipse help and showing the checkstyle problem description
online.

Fixes checkstyle#568.
@Calixte Calixte merged commit 07a65b2 into checkstyle:master Feb 4, 2024
7 checks passed
@Bananeweizen Bananeweizen deleted the markerHelp branch February 20, 2024 16:56
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.

Provide marker help
3 participants