SuperBOL VSCode Extension

TODO: Update this Section if still relevant; remove it otherwise.

This VSCode extension is used to interface VSCode with the SuperBOL LSP Server and provides building tasks for your COBOL projects.

The extension can be used as a standalone, but is required for the SuperBOL VSCode Extension to work.

Tasks

We provide a task definition to build your COBOL files. The task is defined as follow:

{
    "type": "superbol",
    "copybooks": [],
    "sourceFormat": "",
    "dialect": "",
    "extensions": [],
    "forDebugging": false,
    "problemMatcher": [],
    "label": "superbol: Build file",
    "group": {
        "kind": "build",
        "isDefault": true
    }
}

You can fill the fields with the following values:

  • copybooks: an array of string, each string must point a to a directory with copybooks inside

  • sourceFormat: a string for the COBOL source format to be used by the compiler

  • dialect: the dialect to be used by the compiler

  • extensions: file extensions to resolve COPY (without the leading .)

  • forDebugging: if true then the compiler is cobcd, otherwise cobc.

To trigger the building task just push Ctrl + Shift + B.

Settings

The settings for the extension are to be modified by going to File > Preferences > Settings.

Then select the Extension submenu and select SuperBOL COBOL.

Path

This is the path to the superbol executable.

SuperBOL extension features

Go to definition

You can navigate to the defintion of any variable in your code. Push F12 on a variable name to go to it’s defintion. This works on: * every variable in the PROCEDURE DIVISION, * every variable that is on a RENAME clause, * every variable that is used by a REDEFINES clause

Go to references

You can have a list of references of every variables in your code. Push Shift + F12 on a variable name to find all the places it is referenced.

Semantic highlighting

The extension understands your code on a semantic level, giving you better highlighting to make reading your code easier and focus on the important information of the source code.

Peek copy

Place your cursor on COPY statement and a pop up with the content of the copied file will appear, giving you all the information you need to understand the code at a glance.

Indentation

You can indent your code for a better understanding of the control flow at a glance. Simply push Ctrl + Shift + I and all the file is indented.

You can also just select a part of your code and push the same shortcut just to indent the selection.

Keyboard shortcuts

Shortcut

Action

F12

Go to the defintion of the item under cursor

Shift + F12

List all references of the item under cursor. If there is only one other reference then navigate directly to it

Ctrl + Shift + I (no selection)

Format the whole file

Ctrl + Shift + I (with selection)

Format the selection

Mouse hover

If on a COPY statement peek the content of the copied file.