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 code slice to a new program
- Enables you to extract a specific section or paragraph into a new program. The new program is added to the project, and the
code is replaced by a call statement in the original code.
- Extract selected code to section / paragraph
- 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 section / paragraph
- Enables you to create a new section or a paragraph which are referenced in the code but the IDE has no information about where
they are defined.
- Implement missing abstract class methods
- Enables you to implement any missing methods, properties and events required by an abstract class.
- Implement missing interface methods
- Enables you to implement any missing methods, properties and events that an interface 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
- Enables you to either remove or comment out the portion of code that Code Analysis has identified as being 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.
- Simplify namespace
- Enables you to remove a namespace in places in the code where it is not required.