To customize the editor on a global level from the extension settings inside
Visual Studio Code:
- In
Visual Studio Code, click
File > Preferences > Settings.
- Expand
Extensions, and click
Micro Focus COBOL.
- 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:
You can specify more editor settings in the global
Visual Studio Code
settings.json file:
- 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.
- 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:
- Use the
Dialect and
Source Format buttons in the toolbar in the bottom right corner of the
Visual Studio Code main window to change the settings only for the currently active file: