Configuring the Editor

You can customize the editor on a global level from the extension settings inside Visual Studio Code.

The editor settings for the Micro Focus Enterprise Extension are as follows:

  • Micro Focus PLI > Editor > Margin: Enable - disabled by default. Check this to enable colorization of the PL/I code.
  • Micro Focus PLI > Editor > Margin: Left - specify the width of the left margin.
  • Micro Focus PLI > Editor > Margin: Right - specify the start of the right margin.
  • Micro Focus PLI: Language Server Autostart - enabled by default. If the PL/I Language Server is available through a licensed Enterprise Developer product, it automatically starts when Visual Studio Code finds PL/I sources in the workspace.
  • Pli Language Server > Trace: Server - specify the level of verbosity between Visual Studio Code and the PL/I Language Server.

In order for most editor features to work, you need to specify the location of the prerequisite Micro Focus product in the Micro Focus COBOL extension settings - see Micro Focus COBOL: Install Location. The following lists all editor settings available for the Micro Focus COBOL extension. Consider changing these if your application uses COBOL programs.

  1. In Visual Studio Code, click File > Preferences > Settings.
  2. Expand Extensions, and click Micro Focus COBOL or click Micro Focus PL/I.
  3. Use the extension settings:
    • Micro Focus COBOL: Install Location - set this to specify the path to the install location of your licensed Micro Focus Enterprise Developer product. This is required for a number of features, including compiling and debugging, and the language server, to work.
    • Micro Focus COBOL: Language Server Autostart - enabled by default. If COBOL Language Server is available through a licensed Enterprise Developer product, it automatically starts when Visual Studio Code finds COBOL sources in the workspace.
    • COBOL Language Server > Trace: Server - specify the level of verbosity between Visual Studio Code and the COBOL Language Server.
    • You can specify the following editor settings:
      • Micro Focus COBOL > Editor: Custom Tab Stops - Enables you to specify custom tab stops for your programs instead of Visual Studio Code automatically determining the tab stops based on the indent size and the source format. You specify the custom tab stops in the Visual Studio Code settings.json file in the following format:
        {
            "microfocusCOBOL.editor.customTabStops": [
                ArrayNumbers
            ]
        }
      • Micro Focus COBOL > Editor: Dialect - the default COBOL dialect for the editor. The default is Micro Focus.
      • Micro Focus COBOL > Editor: Improved Tab Stops - Enabled by default. Depending on the source format of the code, COBOL can have irregular tab stops. This option improves the behavior of the TAB key and the SHIFT+TAB key combination so that it adjusts the indentation of the code based on COBOL tab stops.
      • Micro Focus COBOL > Editor: Source Format - this is used for the COBOL colorization in the editor. The default is fixed.

Add file associations

If your COBOL source files are not colorized, this might be because Visual Studio Code does not have the required file association. To add a file association:

  1. Click File > Preferences > Text Editor > Files.
  2. In the Association section, click Add Item.
  3. Add the file association in the following format:
    .extension
    For example, .ss.
    programming-language
    For example, cobol.

To customize the editor for the current COBOL file: