Configuring the Editor

You can 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 Autostart - enabled by default. If COBOL Language Server is available through a licensed COBOL or 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": [
      • 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:
    For example, .ss.
    For example, cobol.

To customize the editor for the current COBOL file: