Configuring the Editor

To customize the editor on a global level from the extension settings inside Visual Studio Code:

  1. In Visual Studio Code, click File > Preferences > Settings.
  2. Expand Extensions, and click Micro Focus COBOL.
  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 COBOL or 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 - Enabled by default. Control wether to use the COBOL Language Server, if available through a licensed COBOL or Enterprise Developer product.
    • 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.
      • 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.

You can specify more editor settings in the global Visual Studio Code settings.json file:

  1. On the Visual Studio Code Settings page, click Open Settings (JSON), ().

    This opens the global settings.json in the editor. The location of the file is %userprofile%\AppData\Roaming\Code\User (Windows) or ~/.config/Code/User (Linux) for default installations.

  2. Type settings and their values as described in Microsoft: Visual Studio Code - User and Workspace Settings.

    For example, you can configure:

    COBOL rulers
    The Micro Focus COBOL extension applies default rulers when you open a COBOL file in the editor. The rules enable you to identify easily the COBOL areas and columns. You can configure these by changing the language defaults in the settings.json. For example, you can change the location of the rulers in the following section:
        "[cobol]": {
            "editor.rulers": [
                6,
                7,
                72
            ]
        }
    COBOL Source format and dialect
    Use the following settings:
    {
        "microFocusCOBOL.dialect": "Enterprise COBOL for z/OS",   
        "microFocusCOBOL.sourceFormat": "fixed"
    }
    Custom colors for the COBOL words
    You can customize the colors of the COBOL words in the editor. This can be useful if your Visual Studio Code theme makes it difficult to see certain colors.

    Use the editor.semanticTokenColorCustomizations property with the rules option, and modify the settings prefixed with cobol. For example:

    {
        "editor.semanticTokenColorCustomizations": {
            "enabled": true,
            "rules": {
                "cobol-identifier": "#3b8dda",
                "cobol-keyword": "#ff0000",
    }

To customize the editor for the COBOL file open in it: