These preferences are available from the
Tools > Options > Text Editor > Micro Focus COBOL > Code Style > Code Cleanup page.
Generate .editorconfig file from settings
- Click this button to create an
.editorconfig file that contains the code style settings. See
Sharing the Visual Studio Formatting Preferences with an EditorConfig File.
The following preferences enable you to specify what code changes should be applied when you either use the
Edit > Advanced > Format
filename with Code Cleanup command:
General preferences
- Keyword case
- Specify whether formatting with code cleanup should change the case of keywords. The options are:
- No preference - default. Code cleanup does not change the case of keywords.
- Prefer uppercase - code cleanup forces uppercase for keywords.
- Prefer lowercase - code cleanup forces lowercase for keywords.
Identification Division preferences
- Identification Division header
- Specify your preferences for the style of the IDENTIFICATION keyword:
- No preference - no code style changes will be applied.
- Prefer 'ID' keyword - formatting with code cleanup changes IDENTIFICATION to ID.
- Prefer 'IDENTIFICATION' keyword - formatting with code cleanup changes ID to IDENTIFICATION.
Data Division preferences
- Data item qualification separator
- Specify the prefix to use in field names - either OF or IN (A-COUNT of A-WORK-1):
- No preference - no code style changes will be applied.
- Prefer 'OF' keyword - formatting with code cleanup changes the prefix in field names to OF.
- Prefer 'IN' keyword - formatting with code cleanup changes the prefix in field names to IN.
- PICTURE clause
- Specify your preferences for the style of the PICTURE keyword:
- No preference - no code style changes will be applied.
- Prefer 'PIC' keyword - formatting with code cleanup changes all instances of PICTURE with PIC.
- Prefer 'PICTURE' keyword - formatting with code cleanup changes all instances of PIC with PICTURE.
- USAGE clause
- Specify whether to use the USAGE keyword:
- No preference - no code style changes will be applied.
- Prefer removing 'USAGE' keyword - formatting with code cleanup removes the USAGE keyword and the IS keyword if it is used with USAGE.
- BINARY data format
- Specify your preferences for indicating BINARY data:
- No preference - no code style changes will be applied.
- Prefer 'BINARY' keyword - formatting with code cleanup sets the binary data format keyword to BINARY.
- Prefer 'COMP' keyword - formatting with code cleanup sets the binary data format keyword to COMP.
- Prefer 'COMP-4' keyword - formatting with code cleanup sets the binary data format keyword to COMP-4.
- COMP data format
- Specify your preferences for indicating COMP data:
- No preference - no code style changes will be applied.
- Prefer 'COMP' keyword - formatting with code cleanup changes all instances of COMPUTATIONAL with COMP.
- Prefer 'COMPUTATIONAL' keyword - formatting with code cleanup changes all instances of COMP with COMPUTATIONAL.
Procedure Division preferences
- Prefer symbols over keywords for operators
- Specify whether to use symbols for operators:
- No preference - no code style changes will be applied.
- Use where possible - formatting with code cleanup replaces keywords for operators with symbols.
- THEN clause
- Specify whether to use the THEN keyword:
- No preference - no code style changes will be applied.
- Prefer removing 'THEN' keyword - formatting with code cleanup removes the THEN keyword.