STweep Formatter for CODESYS

The STweep formatter for CODESYS is a source code formatter for Structured Text.
With STweep you can enforce a consisting code style based on your preferences!
“STweep is a must have tool for developers and companies who want to speed up development.”

Current Version : 4.2.1.0
Article no : 2101000014
Category:

Description

 

 

 

 

 

The STweep formatter for CODESYS is a source code formatter for Structured Text.

Main functionalities:

  • Configurable code style
  • Line breaking of long lines
  • Aligning of similar code in columns (e.g. variable declarations and assignments).
  • Aligning of function call arguments in columns
  • Configurable indentation style
  • Set desired number of blank lines.

Integration:

STweep for Codesys also supports ABB automation Builder and e!Cockpit. See system requirements for the details.

Try Stweep now for free as 30 day demo!

More info at: www.STweep.com

Requirements

Version Release Notes Release date
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/3.5.2.0/STweep.Codesys.3.5.2.package” name=”3.5.2.0″}} Added

  • Support for STRUCT PERSISTENT, STRUCT CONSTANT and STRUCT NON_RETAIN
  • Added settings to support line breaks in FOR statement
  • Added setting to make spaces between nested parentheses optional
  • Support for blank lines at file start
  • Support for STRUCT RETAIN
  • Support for access specifiers in a function declaration

Changed

  • Miscellaneous improvements and bug fixes

Fixed

  • Incorrect number of blank lines at file end if a code file did not contain a code part, but only comments
2024-01-16
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/4.1.2.0/STweep.Codesys.4.1.2.package” name=”4.1.2.0″}} Added

  • Support for single line if statements
    • Added setting: “Place simple if statements on a single line.”
  • Improved formatting for IF statements.
    • Added setting: “Line break after IF”
    • Added setting: “Line break before THEN.”
    • Added setting: “IF statement line break mode.”
    • Added setting: “Indent THEN in if statement.”
  • Improved formatting of implicit enums.
    • Added setting: “Line break after left parenthesis in implicit enum.”
    • Added setting: “Line break before left parenthesis in implicit enum.”
    • Added setting: “Line break before right parenthesis in implicit enum.”
    • Added setting: “Maximum implicit enums on single Line.”
    • Added setting: “Implicit enum parentheses style”
  • Search functionality in the settings editor
  • By clicking on a changed setting in the editor you navigate to this setting.

Changed

  • Signed package
  • In the settingsceditor the preview screen shows the formatted settings with the current (edited) settings.
  • Improved preview code.

Fixed

  • Incorrect loading of parameter line break after IF
  • Incorrect loading of parameter line break before THEN
  • Clicking on a changed setting did not always trigger the navigation to this canged setting.
  • Incorrect formatting exception when there was a semicolon after END_TYPE in a struct.
  • Improved handling when the user code contains parsing errors.
  • In some cases a single line comment on the first line was mistakenly aligned with an end of line comment on the second line.
  • Minimum number of blank lines was not always correctly taken into accoun, when updating number of blank lines before a statement.
  • Specified numer of blank lines after a code block was not always respected when the specified number of blank lines before the next code block was lower.
  • Formatting was not executed if code contained a ADR operator with a string literal as argument.
2022-10-19
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/4.0.2.0/STweep.Codesys.4.0.2.package” name=”4.0.2.0″}} Changed

  • Improved handling when the user code contains parsing errors.
  • Upgrade minimum installed .NET framework to 4.7.2.

Fixed

  • Parameter: >Spaces >Binary operators >Around assignment operator in function block initializer parameter assignment was not properly saved.
  • Possible formatting time out when formatting chained assign statements (A:=B:=C;). Exception only occurred when assignments are aligned in columns. And there is an assign statements in the previous line.
2022-05-25
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/4.0.0.0/STweep.Codesys.4.0.0.package” name=”4.0.0.0″}} Added

  • Option to align all members of an alignment in columns to tabs.

Changed

  • Miscellaneous improvements and bug fixes.

Fixed

  • Possible incorrect formatting of array initializer elements.
  • Incorrect formatting of property getter and setter declarations with an access specifier.
  • ncorrect formatting of a program declaration with access specifier.
  • Exception when formatting an empty array initializer.
  • Incorrect formatting of a variable declaration initializer with a REF= assignment.
  • Possible incorrect indenting of function call arguments when used in a multiline binary expression.
  • Incorrect formatting when empty single line comment ‘//’ was used.
  • Alignment of invocation call parameters were formatted with the incorrect settings when tabs are used.
  • Possible exception when align in columns with tabs and no spaces were used before alignment.
2022-01-31
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/3.5.2.0/STweep.Codesys.3.5.2.package” name=”3.5.2.0″}} Added

  • Support for conditional formatting with {STweep.Disable} and {STweep.Enable}.
  • Support for conditional formatting with (*STweep.Disable*) and (*STweep.Enable*).
  • Option to select indent style for align similar code in columns when tabs are used.
  • Settings editor shows number of unsaved settings and unsaved settings details if clicked.

Changed

  • Minor performance improvements.
  • Minor text updates.

Fixed

  • Rare cases of incorrect line length overflow handling when alignment of end of line comments in columns is used.
  • Possible “No solution found” exception when formatting structure initializers nested in an array initializer.
  • Possible incorrect line length overflow calculation when tabs are used.
  • Incorrect formatting when aligning in columns of assignment, number of blank lines before single line statement is 1 and number of blank lines after single line statement is 0.
  • Incorrect formatting when aligning in columns of address assignment, variable declaration and variable initializers when number of blank lines before single line declaration is 1 and number of blank lines after single line declaration is 0.
2021-05-10
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/3.4.0.0/STweep_for_Codesys_3.4.0.0.package” name=”3.4.0.0″}} Added

  • Option to align enum members in columns
  • Option to set line breaking mode for chained methods.
  • Aligning in columns for address assignments.

Changed

  • Chained variable access (A := B.C;) will now preferably break before the dot in case of an line length overflow. This was after the dot.
  • Set line breaks around ‘(‘ , ‘)’ , ‘[‘, ‘]’ are now placed if their construction is multiline. Before this was only the corresponding line break mode was set to “Break of long or multiline” or “Break always.”
  • Function block initializers for arrays are formatted according to the settings for functions block initializers. Before they where formatted according to the array initializers settings.
  • Minor UI Tweaks.
  • Minor translation updates.

Fixed

  • Incorrect formatting of statements containing ‘THIS’ without deference: ‘A(THIS);’
  • Incorrect formatting around statements like: ‘A REF= 0;’.
  • Incorrect formatting and possible exception of an array initializer with a trailing comma.
  • Incorrect formatting and possible exception of a structure initializer with a trailing comma.
  • Incorrect formatting and possible exception of a function block initializer with a trailing comma.
  • Incorrect formatting of array size specifier with a trailing comma.
  • Not working setting setting preview for array initializer indent mode.
2021-04-12
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/3.1.1.0/STweep_for_Codesys_3.1.1.0.package” name=”3.1.1.0″}} Added

  • Option to set parameter line break mode of structure initializers.
  • Option to place line break after ‘(‘ in structure initializer.
  • Option to place line break before ‘)’ in structure initializer.
  • Option to place line break before ‘(‘ in structure initializer.
  • Option to set maximum number of parameters in structure initializer.
  • Option to set spaces before structure initializer parentheses.
  • Option to set spaces inside structure initializer parentheses.
  • Option to align structure initializer parameters in columns.
  • Option to align structure initializer parameter assignments in columns.
  • Option to set structure initializer parenthesis indentation style.
  • Option to set parameter line break mode of array initializers.
  • Option to place line break after ‘(‘ in array initializer.
  • Option to place line break before ‘)’ in array initializer.
  • Option to place line break before ‘(‘ in array initializer.
  • Option to set maximum number of parameters in array initializer.
  • Option to set spaces before array initializer parentheses.
  • Option to set spaces inside array initializer parentheses.
  • Option to align array initializer parameters in columns.
  • Option to align array initializer parameter assignments in columns.
  • Option to set array initializer parenthesis indentation style.
  • Option to set spaces around argument assignment in function block and structure initializers.
  • Option to set parameter line break mode of function block initializers.
  • Option to place line break after ‘(‘ in function block initializer.
  • Option to place line break before ‘)’ in function block initializer.
  • Option to place line break before ‘(‘ in function block initializer.
  • Option to set maximum number of parameters in function block initializer.
  • Option to set spaces before function block initializer parentheses.
  • Option to set spaces inside function block initializer parentheses.
  • Option to align function block initializer parameters in columns.
  • Option to align function block initializer parameter assignments in columns.
  • Option to set function block initializer parenthesis indentation style.

Changed

  • In case of a line length overflow line breaks are not placed directly after a semicolon anymore.
  • Improved line breaking after an assignment operator in case of a line overflow.
  • Minor updates in translations and UI.

Fixed

  • Setting “Blank lines after single line case” was not properly loaded in the UI.
  • Setting “Blank lines after multi line case” was not properly loaded in the UI.
  • Setting “Blank lines before single line declaration” was not properly loaded in the UI.
  • Incorrect formatting of a reference assign in a reference declaration : A : POINTER TO B REF= C;
  • Depending on the used settings the number of blank lines at the file end was not correctly set if the last element is a comment.
2021-03-11
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/2.1.0.0/STweep_for_Codesys_2.1.0.0.package” name=”2.1.0.0″}} Added

  • Option to place STRUCT keyword on a new line.
  • Option to indent else case in a case statement.
  • Option to add blank lines at the end of a code file.
  • Separate setting for Spaces around argument assignment.
  • “Documentation” command in menu bar.
  • “Report a bug or submit feedback” command in menu bar.

 

Changed

  • Minor UI changes.
  • Updated/improved German translations.
  • Improved STweep menu structure.
  • STweep setting file format for improved handling
  • Improved code readability when wrapping functionblock declarations with EXTEND and IMPLEMENT.
  • Improved code readability when wrapping array initializer.
  • Improved code readability when wrapping struct initializer.

 

Fixed

  • Incorrect formatting of function block initializers without arguments : VAR A : B(); END_VAR
  • Depending on the settings: if the first element in a file was a comment, the number of blank lines between file-start and the comment where not properly set.
  • Depending on the settings: if last element in a file was a comment the number of blank lines between file-end and the comment where not properly set.
  • Incorrect formatting of a statement similar to: ‘THIS^.a REF= var;’
  • Depending on the settings: incorrect blank line inserted when multi line comment exceeded the line length limit.
  • Incorrect formatting of pointer to array declaration: “A:POINTER TO ARRAY[0..1] OF BOOL;”.
  • Setting “Keep existing blank lines” was not respected at the end of a file.
  • Setting “Keep existing line breaks” was not respected at the end of a file.
  • Number of blank lines at start of file was not correctly set if first element is a comment.
2021-02-09
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/1.3.2.0/STweep_for_Codesys_1.4.2.0.package” name=”1.4.2.0″}}

Added

  • Support for inline/local enum declaration. For example VAR A : (A,B,C); END_VAR

Changed

  • A setting row is now selected when the containing setting is changed, this to show the preview.

Fixed

  • Incorrect formatting of function block initializer. fb : fb(arg1,arg2) could lead to a missing parentheses after formatting.
  • Incorrect maintaining of blank lines between statements if there was a comment between the statements.
  • Possible exception when code to format has parsing errors (missing semicolon).
  • Possible exception when aligning long lines in columns.
  • Incorrect indentation of symbolic constants when used as case label.
  • No solution found bug when “Maximum invocation parameters on single line” was set to one and one not last argument had a end of line comment. For example: A(A,//Comment B);
  • Possible bug when “Maximum invocation parameters on single line” was set to “1”, this could cause an exception.
  • Exception while formatting a reference declaration with an assignment. For example A : REFERENCE TO BOOL := A.A;
2021-01-11
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/1.3.2.0/STweep_for_Codesys_1.3.2.0.package” name=”1.3.2.0″}}

Changed

  • Loading STweep formatting settings with an higher minor version is now allowed.
  • Improved handling for line length overflows in declaration code.

Fixed

  • Unable to format interfaces and methods declared in an interface.
  • Incorrect license display.
  • Incorrect blank space by first statement in a statement list, if there was a preceding comment.
  • Bug where CODESYS sometimes gave an error message, because the abort request was checked from a non UI thread.
  • Incorrect functioning of the formatting time out check.
  • UI was not properly blocked while running the formatting task.

Added

  • Support for line break after TYPE keyword.
  • Support for Import and export of settings.
  • Enhanced error message in case of any formatting exceptions.
  • Caret position is restored after formatting.
  • Optional indentation of derived data types in a ‘TYPE’ declaration.
  • Support for string size initialization with “(” and “)” for example A:STRING(20);

 

 2020-12-14
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/1.1.3.0/STweep_for_Codesys_1.1.3.0.package” name=”1.1.5.0″}}

Fixed

  • Possible licensing bug when licensed in softcontainer.

Added

  • Support for chained method calls e.g.: ‘A().B().C();’
  • Support for method and function calls which return a pointer. This can result in method calls like: ‘A()^();’
2020-11-23
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/1.1.3.0/STweep_for_Codesys_1.1.3.0.package” name=”1.1.3.0″}}

Fixed

  • Potential installation problem for Codesys SP15 and lower.

Added

  • Support for ABB Automation Builder 2.3 and higher.
  • Support for e!Cockpit 1.7.0.5 and higher.
2020-11-02
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/1.1.1.0/STweep_for_Codesys_1.1.1.0.package” name=”1.1.1.0″}}

Changed

  • Improved labels for blank line settings.
  • Improved label for blank lines around declarations category.

Added

  • Previews in settings screen.
2020-10-24
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/1.0.4.0/STweep_for_Codesys_1.0.4.0.package” name=”1.0.4.0″}}

Added

  • Support for German.

Changed

  • Minor UI improvements.
2020-10-18
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/1.0.3.0/STweep_for_Codesys_1.0.3.0.package” name=”1.0.3.0″}}

Fixed

  • Licensing bug
2020-10-13
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/1.0.2.0/STweep_for_Codesys_1.0.2.0.package” name=”1.0.2.0″}}

Fixed

  • Missing PInvoke package on installation.
  • Incorrect capital use on manifest file extension.
  • Incorrect capital use on package file extension
2020-10-13
{{widget type=”Codesys\AllVersionWidget\Block\Widget\AllVersion” url=”https://store.codesys.com/ftp_download/Barteling/STweep/2101000014/1.0.1.0/STweep_for_Codesys_1.0.1.0.package” name=”1.0.1.0″}} Initial Release 2020-10-12

Additional information

Article no :

2101000014