Using Code Insights Explain
To generate summaries of selected code or the entire program
- In the editor, perform one of these actions:
- For a summary of a code snippet, right-click and select Code Insights > Explain Code Selection.
- For a summary of the whole program, select Explain Program. For JCL, select Explain JCL.
If the selected code snippet contains the PERFORM paragraph, the DevX Code Insights extension includes the paragraph with the code sent to the AI Services APIs for the explanation process and attached to the Code tab.
- If you select a code snippet or program containing more than 20,000 words, then it might take several minutes to explain. In the notification dialog box, click Proceed to continue.
- If you receive a notification that you selected an incomplete code snippet. In the notification dialog box, click Proceed to continue.
- If the selected code has a copy statement and that copybook is not downloaded, you will see a notification to download copybooks. If you select Download Copybooks, the copybooks will be downloaded, and the explanation process will start. If you do not want to download copybooks, click Skip to proceed or click Cancel to cancel the process.
- In the Code Insights Explain dialog box, you can perform the following tasks:
- Explanation tab: Displays the summary of the code.
- Click
or
icon to provide your feedback if you like or dislike the code explanation you got.
- Click Copy
to copy the summary to the clipboard.
- If you're unsatisfied with the summary, click Regenerate
to receive a new one.
- Click
- Explanation tab: Displays the summary of the code.
- Comment tab: Displays the summary converted into a comment for the code.
- Click
to copy the comments to the clipboard.
- Click
to paste the comment to the file. You must open the file in edit mode when you use this option.
- Click
to convert the comments to uppercase.
- Click
- Code tab: Displays the selected code to be explained. Click
to copy the code to the clipboard.
To get a summary of a procedure, right-click on any procedure and select Explain Procedure. You can view the Explain <procedure line number> tab and view the summary in the Explanation, Comment, and Code tabs.
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*