A number of advanced editing and navigation features of the Rocket COBOL extension are provided by COBOL Language Server - a feature available when you also have a licensed Visual COBOL or Enterprise Developer product. The COBOL Language Server features make editing and navigation in your COBOL code more similar to that of Visual Studio or Eclipse.
The COBOL Language Server enables the following functionality in your extension and must be running in order for them to work:
See Scope of the Support in This Version for details about the limitations of the COBOL Language Server.
To enable the Language Server, ensure that the Micro Focus COBOL: Install Location is set to the install location of a licensed Visual COBOL or Enterprise Developer product. Micro Focus COBOL: Language Server must also be enabled. See Additional Software Requirements.
The
Micro Focus COBOL Language Server status icon,
, in the language toolbar status item
{} in the bottom right corner of
Visual Studio Code shows whether the COBOL Language Server is running:
This shows the Task Picker with the available commands:
When running, COBOL Language Server determines automatically the Compiler directives for your code. As a result, the Dialect or Source format options in the status bar command are disabled and it is not possible to change them manually.
COBOL Language Server determines directives as follows:
In some circumstances, updating any external files does not automatically trigger a background parse of the files. To manually trigger background parse, right-click in the editor, and click Update syntax reporting.
If the workspace includes any .cblproj files, the COBOL Language Server scans the project files and any COBOL files that are listed in a project get associated with the project.
When COBOL Language Server is running, the Visual Studio Code status indicates the project the file you edit is associated with in the Project: projname.cblproj field.
This project association means that the background parse uses the Compiler directives and any dependency path information which is available in the project file.
If more than one COBOL programs in the workspace reference the same copybook, you can choose which main COBOL program will provide the context for the copybook. You can do this as follows:
This shows the Task Picker at the top of Visual Studio Code with the list of COBOL programs available to choose as a context.
This will be displayed next time you check the context of the copybook with the {} selector.