STweep for TwinCAT
Download the latest release of STweep for TwinCAT.
A formatting tool for Structured Text
Head revision
This is the latest stable version of STweep for TwinCAT
Downloads:
[4.2.3] – 2024-1-24
Changelog
Changed
- Performance update.
Fixed
- Miscellaneous improvements and bug fixes.
Downloads:
[4.2.2] – 2024-1-15
Changelog
Fixed
- Miscellaneous improvements and bug fixes.
- In file formatting of actions was not always possible.
Downloads:
[4.2.1] – 2024-1-11
Changelog
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 access specifiers in a function declaration.
- Support for STRUCT RETAIN
Fixed
- Miscellaneous improvements and bug fixes.
- File changed flag on any TwinCAT code file was unneeded raised when opening the context menu in the editor.
- Miscellaneous improvements and bug fixes.
- Incorrect number of blank lines at file end if a code file did not contain a code part, but only comments.
Downloads:
[4.1.2] – 2022-10-18
Changelog
Added
- Support for single line if statements.
- 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.
- In the settings editor by clicking on a changed setting you navigate to this setting.
Changed
- Improved translations.
- Improved handling when the user code contains parsing errors.
- Preview screen shows the formatted settings with the current (edited) settings
- Improved preview code.
- DLL and Msi files are now signed
- Miscellaneous improvements and bug fixes.
Fixed
- In some cases a single line comment on the first line was aligned with an end of line comment on the second line.
- Minimum number of blank lines was not always correctly taken into account, when updating number of blank lines before a statement.
- Specified number 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.
- Incorrect formatting exception when property declaration has a FINAL parameter.
- Incorrect formatting exception when there was a semicolon after END_TYPE in a struct.
Downloads:
[4.0.4] – 2022-05-22
Changelog
Changed
- Added XAE shell installer.
- Improved handling when the user code contains parsing errors.
- Miscellaneous improvements and bug fixes.
Fixed
- Parameter: >Spaces >Binary operators >Around assignment operator in function block initializer parameter assignment was not properly saved
Downloads:
[4.0.2] – 2022-03-16
Changelog
Changed
- Upgrade minimum installed .NET framework to 4.7.2.
- Miscellaneous improvements and bug fixes.
Fixed
- Possible formatting time out when formatting chained assign statements (A:=B:=C;).
[4.0.1] – 2022-01-26
Changelog
Changed
- STweep settings file format.
- 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.
- Incorrect 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.
[3.6.5] – 2021-09-28
Changelog
Added
- Option to align all members of an alignment in columns to tabs.
- Additional features for improved (debug) logging.
- Support for formatting from solution explorer (project formatting).
Changed
- Improved app startup time.
- Miscellaneous improvements and bug fixes.
Fixed
- Incorrect formatting when empty single line comment ‘//’ was used.
- Alignment of invocation call parameters where formatted with the incorrect settings when tabs are used.
- Possible exception when align in columns with tabs and no spaces where used before alignment.
[3.5.2] – 2021-05-10
Changelog
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 adress 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.
[3.4.0] – 2021-04-11
Changelog
Fixed
- Not working setting preview for array initializer indent mode.
- 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.
[3.3.2] – 2021-04-07
Changelog
Fixed
- Not working setting preview for array initializer indent mode.
- 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.
[3.3.1] – 2021-03-30
Changelog
Added
- 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 and translation updates.
[3.1.4] – 2021-03-10
Changelog
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.
[3.1.3] – 2021-03-09
Changelog
Added
- Check for updates feature.
- 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
- The STweep menu commands are now directly translated at startup (if needed).
- Internal optimizations.
- In case of a line length overflow line breaks are not placed directly after an semicolon anymore.
- Improved line breaking after an assignment operator in case of a line overflow.
- Minor updates in translations and UI.
Fixed
- Deprecated API warning in VS2019.
- Conflicting GUID with Codemaid.
- 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.
[2.1.0] – 2021-02-03
Changelog
Added
- Option to place STRUCT keyword on a new line.
- Option to indent ELSE case in a case statement.
Changed
- Minor UI changes.
- Minor changes in license handling.
- Improved performance for first format action after visual studio starts.
Fixed
- Incorrect formatting of function block initializer without arguments :
VAR
A : B();
END_VAR
[2.0.1] – 2021-01-28
Changelog
Added
- 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
- Improved STweep menu structure.
- Updated/improved German translations.
- Setting file format for improved handling.
Fixed
- 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.
- Depending on the settings: number of blank lines at start of file was not correctly set if first element is a comment.
- Copyright message mentioned Codesys instead of TwinCAT.
- 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 exceeds the line length limit.
- Incorrect formatting of pointer to array declaration: “A:POINTER TO ARRAY[0..1] OF BOOl;”.