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

Please allow users to easily configure sensitivity to errors/warnings (squiggles) #1791

Open
RickJWagner opened this issue Feb 4, 2021 · 4 comments · May be fixed by eclipse-jdtls/eclipse.jdt.ls#1765

Comments

@RickJWagner
Copy link

RickJWagner commented Feb 4, 2021

Users are annoyed and distracted by a variety of error and warning indicators. (i.e. "the squiggle obfuscates the code when it applies to an entire block of code")

It's not an isolated complaint (see similar issue 1657). #1657

---------------------------------- Suggested remedies ------------------------------------------------------------------------------------------------ -
Could the yellow squiggly for warnings be removed or have the option to turn them on or off within the workspace plugin settings?

Maybe show a warning marker on the line number instead (or another option to turn on or off if people want yellow squiggly and marker on the line number)?

Or is there a lever / option to change the color of the squiggly in the workspace? Maybe make it more transparent? Possibly a theme option/setting?


Please consider these ideas, look for ways to make the Java extension even better. Thank you.

@rgrunber
Copy link
Member

rgrunber commented Feb 4, 2021

Currently, I don't think there's a nice to way to set this since there's so many possible options, and I don't think we have a UI to go through all of them, but it should be possible to configure.

For example, in a Maven project, I ensured there was a .settings/org.eclipse.jdt.core.prefs file. This file has a key=value format and the various options can be found at https://github.com/eclipse/eclipse.jdt.core/blob/master/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java#L270 (listing the key, possible values, and the default).

We do override some of these defaults in https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/PreferenceManager.java#L124 .

So it is possible to customize these options. With that said, do you have a rough idea of which errors/warnings are particularly annoying ? Maybe we could consider changing their default state.

@RickJWagner
Copy link
Author

Hi @rgrunber ,
Thanks for the above note.
We do not have a list of which messages are targeted. Maybe it would be best to start with the ability to turn off WARNs, we can further refine if we get more feedback.

@rgrunber
Copy link
Member

@fbricon , @testforstephen here's an example of a case where a global settings file would be beneficial. Also, some kind of location that lists the available options as opposed to having to reference the source javadoc.

@rgrunber
Copy link
Member

rgrunber commented May 5, 2021

I have a small draft of such a feature I can post soon. It works as follows. For every error/warning message that can actually be ignored, a code action is generated called "Ignore ${message}" . If performed, it will create/append a file under .settings/org.eclipse.jdt.core.prefs of the project with an entry to ignore that particular error/warning. A few things still to address :

  • If an element has something like 3 warnings, that's 3 different code actions, and this dynamic behaviour could produce some ugly menu popups if the number grows. Maybe have an option like "Ignore all errors/warnings for element" when more than 3 errors/warnings ? If a user still wanted to only disable a particular one, they would still be able to remove the unwanted ones from the settings file. Entry names are pretty intuitive.
  • Currently the options to ignore are saved to the project specific settings file, but we could potentially save to the global one. My preference is for the project file for now.
  • Noticed some odd behaviour in appending/creating the project settings file, where occasionally the options aren't respect. This seems to point more to some issues we may have with responding to changes in the settings file.

rgrunber added a commit to rgrunber/eclipse.jdt.ls that referenced this issue May 7, 2021
- Fixes redhat-developer/vscode-java#1791
- Some JDT core compiler problems can be ignored using the setting
  preference file, so offer a code action to do this for a given
  error/warning

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
rgrunber added a commit to rgrunber/eclipse.jdt.ls that referenced this issue Jun 4, 2021
- Fixes redhat-developer/vscode-java#1791
- Some JDT core compiler problems can be ignored using the setting
  preference file, so offer a code action to do this for a given
  error/warning
- Add testcase

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
rgrunber added a commit to rgrunber/eclipse.jdt.ls that referenced this issue Jun 9, 2021
- Fixes redhat-developer/vscode-java#1791
- Some JDT core compiler problems can be ignored using the setting
  preference file, so offer a code action to do this for a given
  error/warning
- Add testcase

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
rgrunber added a commit to rgrunber/eclipse.jdt.ls that referenced this issue Jun 11, 2021
- Fixes redhat-developer/vscode-java#1791
- Some JDT core compiler problems can be ignored using the setting
  preference file, so offer a code action to do this for a given
  error/warning
- Add testcase

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
rgrunber added a commit to rgrunber/eclipse.jdt.ls that referenced this issue Jun 16, 2021
- Fixes redhat-developer/vscode-java#1791
- Some JDT core compiler problems can be ignored using the setting
  preference file, so offer a code action to do this for a given
  error/warning
- Add testcase

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
rgrunber added a commit to rgrunber/eclipse.jdt.ls that referenced this issue Feb 25, 2022
- Fixes redhat-developer/vscode-java#1791
- Some JDT core compiler problems can be ignored using the setting
  preference file, so offer a code action to do this for a given
  error/warning
- Code action appears only when a `java.settings.url` is detected that
  is on the local filesystem
- Add testcase

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
rgrunber added a commit to rgrunber/eclipse.jdt.ls that referenced this issue Jun 25, 2022
- Fixes redhat-developer/vscode-java#1791
- Some JDT core compiler problems can be ignored using the setting
  preference file, so offer a code action to do this for a given
  error/warning
- Code action appears only when a `java.settings.url` is detected that
  is on the local filesystem
- Add testcase

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
@rgrunber rgrunber moved this to 🏗 In progress in IDE Cloudaptors May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants