skip to Main Content

I’m using Visual Studio Code (1.85.1) with Extension Pack for Java (Microsoft, 0.25.15).

The problem is that VS Code automatically adds import statements that are unwanted and lead to errors.

2

Answers


  1. While I have not personally used the Extensions Pack for Java, I do know that within File > Preferences > Settings, you can search for specific settings. Searching for "Import" or "Auto" within settings should pull up any settings related to the features added by these extensions.

    Settings search example

    If you aren’t able to find the source of the problem, then unfortunately the authors of said extensions did not easily add a way to configure this functionality, and you may need to toggle on/off each added extension to figure out which one is specifically causing the issue, and if you’re able to continue without that specific extension. Hope this helps!

    Login or Signup to reply.
  2. You may have accidentally enabled the following setting, change it to fasle.

        "java.saveActions.organizeImports": false,
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search