Using Code Insights Explain


This GenAI-based Code Insights Explain feature leverages advanced AI algorithms to assist you in understanding complex codebases more efficiently. This feature significantly reduces the time and effort required to comprehend large and intricate programs by providing summaries and detailed explanations of the COBOL program code logic. You can host Code Insights Explain on premises so you don't need to share your code outside your organization. To use the Code Insights Explain feature in BMC AMI DevX Workbench for VS Code, you must set theBMC AMI AI Services by configuring the CES setting where the Code Insights Explain instance is provisioned. Alternatively, if you have your local AI service set up, you can select your local settings. For more information, see Configuring-AMI-Platform.

After configuring  the BMC AMI AI Services, you can generate a summary of a selected paragraph or the whole program. You can then copy and paste the summary as a comment in a program in the code with one click.

BMC AMI AI Services also recognizes COBOL programs with copybooks and generates explanations. The Explain Code and Explain Program options are available from the Code Pipeline and Debug extensions' source code.

To generate summaries of selected code or the entire COBOL program

  1. In the editor, perform one of these actions:
    • For a summary of a snippet of the code, right-click and select Code Insights > Explain Code Selection.
    • For a summary of the whole program select Explain Program.
      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.
  1. 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.
  2. If you receive a notification that you selected an incomplete code snippet. In the notification dialog box, click Proceed to continue.
  3. If the selected code has a copy statement and that copybook is not downloaded then 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 then click Skip to proceed or click Cancel to cancel the process.
  4. In the Code Insights Explain dialog box, you can perform the following tasks:

    • Explanation tab: Displays the summary of the code. Click Copy image-2024-9-3_11-35-25.pngto copy the summary to the clipboard. If you're not satisfied with the summary you received, click Regenate image-2024-9-16_11-53-1.pngto receive a new summary.

    • Comment tab: Displays the summary that is converted into a comment for COBOL.
      • Click image-2024-9-3_11-35-25.png to copy the comments to the clipboard.
      • Click image-2024-9-3_12-2-47.pngto paste the comment to the file. You must open the file in edit mode when you use this option.
      • Click image-2024-9-3_12-3-47.pngto convert the comments to uppercase.
    • Code tab: Displays the selected code to be explained. Click image-2024-9-3_11-35-25.png to copy the code to the clipboard.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*