Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Open the Extensions panel. Search for and install the Checkstyle for Java extension by ShengChen. Follow the configuration docs for the plugin. The important parts are: set the configuration file, by right clicking the checkstyle.xml file and select Set the Checkstyle Configuration File . You will need to use the command Checkstyle: Set the Checkstyle Version (Help>Show All Commands, or hit F1 on your keyboard) to manually set the Checkstyle version to 8.36.2. The extension will automatically download the required checkstyle jar file if it needs to. Other versions of Checkstyle jar are known to not work (8.18 and 9.2.1 as of this writing all currently throw errors).
  • You'll need to restart VSCode after adding the Checkstyle for Java extension
  • You will want to modify the setting for Java → Completion: Import Order (in the settings.json file for VScode): add this to your settings.json file: 

    "java.completion.importOrder": ["#","java","javax","com","org"],

Checking code style from commandline

...