Skip to content

astyle-format/vscode-format

Repository files navigation

Format-AStyle

Format code with AStyle

Average time to resolve an issue Percentage of issues still open


Requirements

You need to install AStyle

Installation

Debian

If you on *.debian systems, try

sudo apt install astyle

But remember, in repository may have older version!

The best way - build app using cmake

Common way to build using cmake

mkdir build
cd build
cmake ..
make
sudo make install

Windows

  • Download source from sourceforge
  • Extract archive
  • Put bin/AStyle.exe into your bin path or add current folder path to your env PATH
  • In settings set where is astyle -> AStyle.exe (it means that you add folder bin into PATH and this contains program named AStyle.exe)
  • Put astylerc file with astyle options into %APPDATA%\astylerc

How to use

For format document you need to click CTRL+ALT+L combination (just like in IDEA Studio) in opened, and saved document in HDD.

For Mac CMD+ALT+L (i don't have a MacBook...)

Extension Settings

This extension contributes the following settings:

  • astyleFormat.show-message: Show message when formatting. By default is true
  • astyleFormat.astylerc: Where is file .astylerc. By default is null (it means that file .astylerc exist in your HOME folder)
  • astyleFormat.messageTimeout: Delay for hide message about formatting

Known Issues

  • All

    • Need to check for .astylerc file
    • If document not exists, format will not be proceed
    • Try find astylerc file into current project (in root dir)
  • Windows

    • Add set custom astylerc file