COBOL Code Explanation
Code Explanation is available in two types: chat experience and code selection. By using the chat
experience
feature, seamlessly engage in a conversation with AI, getting quick and accurate answers to questions about
code.
Getting started with COBOL Explanation on VS Code
You can generate an explanation for an entire COBOL file or just a selection of code. A split editor panel opens on the right of the VS Code window to display the simple, detailed, or guided explanation.
2.4.10+ Obtain summary of large COBOL programs: This feature enables you to request a summary of
large COBOL files. While this request is being processed in
the background, you can continue to use Code Explanation to
generate explanations for other code. The resulting explanation is a Summary
, regardless of
the level of explanation (Simple, Detailed, or Guided) you chose.
2.6.0+ The Obtain summary of large COBOL programs
feature is available in the Chat Experience.
For any known limitations, see Troubleshooting.
- On the VS Code window, in the explorer panel, left-click on a COBOL file to open it in the editor panel.
- Select and right-click on the portion of COBOL code that you want to generate an explanation for.
- Hover over watsonx Code Assistant™ for Z to open the menu.
- Select any one of the explanation types: Simple, Detailed, or Guided.
Using the Chat Experience feature
- Click the watsonx
Code Assistant extension on the side panel to open
the
Chat Experience
feature. - Type /explain, press the space button, and then type @. A menu with a list of files opens in the VS Code workspace.
- Select the program and press Enter. Code explanation for the selected file is displayed in the chat window. You can type in follow-on questions in the chat area to seek further responses.
Alternatively with the code open in the VS Code workspace, right-click on the code snippet, and select Generate Detailed Explanation to view code explanation in the chat window. Follow-on questions are not supported for this method.
Getting started with COBOL Explanation on Eclipse
2.3.0+- From the outline view for COBOL Editor, paragraphs are enabled for explanations. You can choose to use a context menu or a keyboard shortcut.
- If you select a paragraph reference name for explanation, the source code of that paragraph is explained if it is contained within the same source file.
The procedure for code explanation is the same for both VS Code and Eclipse environments.