The light bulb feature in this version of Visual Studio supports a number of quick actions that enable to you to implement
certain constructs in your COBOL code.
You can enable or disable any of the quick actions supported in COBOL from the IDE preferences - click
Tools > Options > Text Editor > Micro Focus COBOL > Quick Actions. The following quick actions are available:
- Enable Quick Actions
- Enabled by default. Uncheck this to disable all light bulbs in the COBOL editor.
- Add missing end scope terminator
- Enables you to insert missing end terminators (such as END IF) in source code compiled with the NOIMPLICITSCOPE Compiler directive.
- Add missing namespace
- Enables you to resolve unknown types either by generating a new class for them or by adding a an existing namespace to the
types.
- Convert to portable COBOL syntax
- Enables you to convert .NET types to COBOL predefined types that can be used on both .NET and JVM platforms.
- Create or find a copybook
- For copybooks referenced in an application that are not found in any of the copybook paths of the project, this quick action
enables you to either browse and find the copybook manually or create the copybook and add it to your project.
- Extract the selected code
- Enables you to move the selected code to a new location such as a section or a copybook. The new copybook is added to the
project and a reference to the new section is added in the place of the original selection.
- Generate missing section / paragraph
- Enables you to create either a section or a paragraph which are referenced in the code but the IDE has no information about
where they are defined.
- Implement missing methods
- Enables you to implement any missing methods, properties and events that an interface or an abstract class requires.
- Organize the $set ilusing statements in the document
- Enables you to insert $set ilusing statements in the code and to arrange multiple $set statements in a program in an alphabetical
order.
- Remove/ comment out dead code block
- Enables you to either remove or comment out the portion of code that has been identified as unused.
- Rename operation on an edited symbol
- Enables you to perform a refactoring rename of identifiers in the code. When you rename a symbol in the code, a light bulb
appears in the left margin of the line where you renamed the symbol and offers you a quick action to do a refactoring rename.
In native code, executing the quick action renames all instances of the identifier in the current source file. In
.NET COBOL code, you can choose to rename across the current project or the entire solution.
- Set CICS directive
- Enables you to set the CICSECM directive on files or project configurations when your application includes any EXEC CICS statements.
- Simplify namespace
- Enables you to remove a namespace in places in the code where it is not required.