Hello, thanks for this project!
The latest version (3.4.15) breaks cpp code when using scientific notation of numbers.
Original line of code:
if ( vertex.isValid() && !InputUtils::equals( point, vertex.coordinates(), 1e-8 ) )
Formatted line of code:
if ( vertex.isValid() && !InputUtils::equals( point, vertex.coordinates(), 1e - 8 ) )
Note the change for 1e - 8 this is invalid syntax and breaks compilation.
I also found another weird scenario. Function call with multiplication in arguments is formatted as pointer:
Original line of code:
f.setPixelSize( pixelSize * mDp );
Formatted line of code:
f.setPixelSize( pixelSize *mDp );
Version 3.4.15
Used parameters:
--preserve-date
--convert-tabs
--indent=spaces=2
--indent-classes
--indent-labels
--indent-namespaces
--indent-switches
--min-conditional-indent=-1
--suffix=none
--break-after-logical
--style=allman
--align-pointer=name
--align-reference=name
--keep-one-line-statements
--keep-one-line-blocks
--pad-paren-in
--pad-oper
--unpad-paren
--pad-header
Removing --pad-oper is a workaround for the bug with scientific notation.
Thx, it will be fixed soon
Fixed in 3.4.16. The second case (multiplication) cannot be resolved by astyle, a long term goal is to include LSP support to fix these issues.
Do you mean this LSP?
Yes, I have made a C++ client for my other pet project (highlight). astyle could make use of semantic token responses by clangd.