COBQA0007 - Extract the selected code to a new section

Information message only. An IDE quick action is available if you want to move the selected code into a new section in the current file.

Description

Note: Applies to native COBOL only.

There is a Visual Studio quick action, Extract to Section, available for the selected code that you can optionally apply. This quick action creates a new section in the file opened in the editor and moves the selected code to it.

To apply the action:

  1. Select the lines of code you want to move.
  2. Click the light bulb icon (light bulb) to see the suggested fixes:

    GUID-7B2A6CAB-2609-4570-B0B6-081551AE7136-low.png

  3. Click Extract to Section in the drop-down list.

    Executing this command replaces the selection a perform new-section statement. It also adds a new section called new-section.

    The name of the new section is highlighted in the editor and the IDE displays the Rename: new-section widget enabling you to change the name of the section right away.

  4. Enter a new name for the section in the editor.

    The name is automatically updated in the two places where it is referenced.