Micro Focus® is a trademark of OpenText; Rocket Software is not affiliated with OpenText.
The Rocket COBOL extension provides support for compiling, editing, and debugging COBOL source code in Visual Studio Code on Windows and Linux.
Read the full documentation for Rocket COBOL here
Features include:
- Editing support for COBOL code - smart indenting, syntax colorization, source format and dialect recognition are available.
- Compilation of COBOL code - supports the compiling of source files when either an Eclipse COBOL project or a Visual Studio COBOL solution file is present, or using custom build scripts.
- Debugging of COBOL code - supports debugging of native and .NET COBOL code
- Debugging of native COBOL code - offers debug configurations, breakpoints, watchpoints and program breakpoints, inline values of variables, debugging of applications running on a remote machine or in an Enterprise Server instance, and just-in-time debugging (JIT).
- .NET Core COBOL code - offers breakpoints, variables, stepping through code.
Note:
- Visual Studio Code version 1.73 or later is required.
- Compile and debug features are available when a compatible version of Rocket Visual COBOL or Enterprise Developer is installed on the same machine. See Scope of Support and also the full documentation of this extension for details.
- The
libicu
package is required by the language server and native code debugger on Linux.
Help with the extension
Visit the Community Forum for help with the extension and to discuss this product with other users and Rocket Software product specialists. For help with functionality in the extension that relies on your licensed Rocket COBOL product, you can also contact Rocket Software Customer Care.
Verifying the Digital Signature
The .vsix
package for this extension can be verified using a hosted digital signature. For more details, see Verifying the Digital Signature of a Rocket Extension for Visual Studio Code.
New Features
For features that were added in earlier versions, check the Changelog of this extension.
Editing Support
The editor supports the following features to help you write COBOL code:
- Setting the COBOL dialect - using the COBOL Language Server functionality
- Code snippets
- Command Palette commands for commenting out lines of code
- Indenting code to COBOL rulers while preserving the left hand margin
- Commands for exploring your COBOL code - i.e. Peek, Go to Definition, Go to References
- Configuring the file encoding
- Format Document for formatting COBOL files
- Navigate to
- Outline view and breadcrumb navigation
- Renaming data items
COBOL Language Server
The following productivity and navigation features in the editor are provided by the COBOL Language Server.
Important: The COBOL Language Server is provided when you have a licensed version of a Rocket Visual COBOL or Enterprise Developer product on the same machine.
- Context-aware code completion as you type
- Hover pop-ups for data items - hovering data items in the source provides a basic description of the data item
- Go to/Find/Peek definition and references - provide quick navigation from a data item to its definition or to other locations where the code references it
- Go to/Peek definition for copy statements - hover COPY statements to view their full path
- Collapsible regions in the editor - you can collapse sections of code in the editor
- OUTLINE view - a tree-view outline of a COBOL program that shows the divisions, sections, and data items defined in the program
- Error highlighting and reporting - compilation errors are highlighted in the editor and shown in the PROBLEMS view
- Rename command available across multiple files
For full details about the editor functionality and configuration settings see the full documentaton for more details.
The Outline view shows the overall structure of any COBOL file including divisions, sections, methods, and data items. Click an item in the Outline window to navigate to its definition in the file.
IntelliSense is supported for the COBOL language. Receive code suggestions and inline code completion as you type.
Peek Definition opens a pop-up window to show where an item is defined. The item can be defined in a different file, for example a copybook. Peek definition supports copy-replaced values.
Renaming a variable in one instance changes the name across all files that reference it. Right-click the item, select Rename Symbol to change its name throughout your program(s), and preview the changes before applying them.
Compiling Support
Rocket COBOL supports the compiling of COBOL source files. You need to have the Eclipse COBOL project and .cobolBuild files or either the Visual Studio COBOL solution or project files. Rocket COBOL also supports custom build scripts.
Visual Studio Code offers a number of build tasks that use the Rocket Visual COBOL or the Enterprise Developer Compiler to build your COBOL files. The build tasks are available from the Terminal menu.
For information on configuring Visual Studio Code for compiling, compiling using either project files, or with custom build tasks, see the full documentation.
Debugging Support
Rocket COBOL supports debugging of native COBOL, .NET COBOL, and JVM COBOL code. You can specify debug configurations for various debug scenarios - such as launching the application with various settings, attach to process, just-in-time debugging (JIT), debugging of applications running on a remote machine or in an Enterprise Server instance. Visual Studio Code provides a number of productivity views during debugging, and supports debug functionality such as breakpoints, watchpoints and program breakpoints, inline values of variables.
The following image shows some of the features available to you while debugging native COBOL code:
- Stepping into the code
- Viewing the values of variables inside the editor
- VARIABLES, WATCH, CALL STACK, BREAKPOINTS, WATCHPOINTS views
- Monitoring local variables and changing their value in the VARIABLES view
- Adding breakpoints in the editor, and from the BREAKPOINTS view
- Adding and monitoring watchpoints in native COBOL
- Viewing the binary values of items in a Memory view
- Navigating the code from the CALL STACK view
Refer to the full documentation of the extension for full details on the available functionality and for examples of debugging scenarios.
Rocket Unit Testing Framework support
The Rocket COBOL extension provides TEST EXPLORER integration for the unit-testing framework, MFUnit, provided by Visual COBOL or Enterprise Developer.
See The Rocket Unit Testing Framework
in the full documentation for details.
Scope of the Support in this Version
This version of the Rocket COBOL extension has the following limitations:
- Compiling and debugging are supported only if you have a licensed version of a Rocket COBOL product on the same machine. See Installing in the full documentation for details.
- Compiling of .NET COBOL and JVM COBOL code is supported if the Visual Studio project and/or solution, or the Eclipse project, respectively, are available
- Syntax checking is only available if version 8.0 or later of a Rocket COBOL product is used and some syntax colorization is not supported at the same level as in Rocket Visual COBOL or Enterprise Developer for Visual Studio. For example:
- Uncompiled code and unused variables are not greyed out
- Visual Studio Code provides suggestions as you type in the editor. When used with a version of a Rocket COBOL product earlier than 8.0 this functionality is not as advanced as IntelliSense in the Visual Studio editor or as Content Assist in Eclipse.
- Reading the COBOL Compiler directives set inside Eclipse COBOL project files (.cobolProj) is not supported
- A problem matcher is not available for the errformat(1) directive
- COBOL Notebooks:
COPY
statements do not resolve copybooks in a workspace
- Output is displayed in the debugger output window when debugging rather than in the notebook itself
- COBOL Notebooks are encoded as UTF-8 and the output when executing code cells is UTF-8. If a cell displays data items defined using
USAGE PICU
the directive DISPLAY-PICU(UTF8)
should be added to the directives for the cell.
- The Debug Cell or Step into Cell commands may not work if the cell has not been been run. Manually selecting the COBOL Notebook kernel will enable debugging.
Rocket Visual COBOL or Enterprise Developer provide fully-featured edit, compile and debug support. Click here for further details.