Skip to content

Be able to configure in settings JSON files the compiler error/warning/ignore levels #4125

Open

Description

@robmv

Eclipse allows to configure the JDT compiler error/warning/ignore levels for many options. For example to ignore creating a class that extends an annotation (pretty common on CDI injections *Literal classes).

There is a quick fix:

Image

But that action doesn't add anything to the settings files at any of the User/Workspace/Folder levels and there is no obvious ways to revert the action. Clean Language Server Workspace appear to do it, but it would be useful if all the compiler error level settings, could be individually controlled using VS Code settings files.

Activity

  1. robmv commented on Jul 25, 2025

    @robmv
    Author

    I have noticed that if .settings/org.eclipse.jdt.core.prefs is present, for example if the project was imported to an Eclipse workspace and m2eclipse auto generated it, Quick Fix setting are stored there.

    The problem with this is that projects imported to Eclipse with m2eclipse, usually have .classpath, .project and .settings added to .gitignore, in order to not have duplicate configuration files (pom.xml and Eclipse ones). For someone still using Eclipse but testing a migration for this extension, this makes things complicated.

    In an ideal world, this extension would use its own configuration settings more inline with VS Code conventions. I would love to have all compiler settings on a file on the project much like java.format.settings.url currently works for code formatter settings.

  2. rgrunber commented on Jul 30, 2025

    @rgrunber
    Member

    "Ignore compiler problem(s)" works as described at #1791 (comment) .

    It now respects java.settings.url and will save the options there. If that setting is not defined / file doesn't exist, then the setting will be saved to the project metadata location (it applies the option for every Java project imported). A simple Java: Clean Java Language Server Workspace can be used to clear these out.

    As for something like a settings JSON to configure more options :

    There is a settings java.settings.url which takes a path to an Eclipse preference file (eg. .vscode/settings.prefs. You can set your preferences in that file (eg. foo=bar). You can place anything from https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Language-Server-Settings-&-Capabilities#java-compiler-options there. See #2358 (comment) as an example.

  3. robmv commented on Aug 4, 2025

    @robmv
    Author

    Thanks @rgrunber. I missed thet java.settings.url could be used for compiler options because it was mentioned on the Java Formatter Options section first and missed it later, my mistake.

    I still think that something like:

    ...
    "java.settings": {
      "org.eclipse.jdt.core.compiler.debug.localVariable": .....
    }
    ...
    

    Directly on VS Code files would be nice. Currently there is no UI to build these files, unless you go to Eclipse and export them. If you are using plain VS Code having the settings directly, VS Code can give auto completion, and help directly on the JSON entries, reducing greatly the need to build a custom UI.

  4. rgrunber commented on Aug 5, 2025

    @rgrunber
    Member

    That's fair. I think The VS Code Java pack provides a UI for the format settings, and I think I had a draft that converted the compiler options to a wizard using https://github.com/redhat-developer/vscode-wizard . Maybe I can look into reviving that.

  5. datho7561 commented on Jun 17, 2026

    @datho7561
    Contributor

    @rgrunber did you ever merge a UI to configure the compiler options for a project? If not, I think that'd be something worthwhile. I know UIs are discouraged and clunkky in VS Code, but I think we could deliver something a bit less clunky than manually editing the .prefs folder.

  6. rgrunber commented on Jun 18, 2026

    @rgrunber
    Member

    I didn't. I think initially https://github.com/microsoft/vscode-java-pack/tree/main/src/project-settings had one but never migrated it to vscode-java. I can look through my old local branches and see if I still have something based off of vscode-wizard, if that approach is still useful.

  7. datho7561 commented on Jun 19, 2026

    @datho7561
    Contributor

    Okay, thanks. I was thinking this could be something @MeherSru could work on if not (or maybe she could help with the rebase), since the feature seems pretty helpful.

  8. rgrunber commented on Jun 19, 2026

    @rgrunber
    Member

    At this point, you would probably have better results just having some LLM look at https://github.com/microsoft/vscode-java-pack/tree/main/src/project-settings/assets/compiler/features and its usage of https://vscode-elements.github.io/ and construct a similar page with all the options from https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjdt%2Fcore%2FJavaCore.html . I would probably stick to the UI used in the other extensions for wizard pages than being the only/few adopters of vscode-wizard.

    The script at https://gist.github.com/rgrunber/73a64539f4e008619d747d0b25f6c5ab (load script, call function) is what I used to keep https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Language-Server-Settings-&-Capabilities#java-compiler-options up to date.

    Related issue at #2776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions