Editing with Visual Studio Code

Caliper Corporation recommends the free Visual Studio Code editor to edit GISDK scripts. Caliper developed an extension to Visual Studio Code for its macro language. This extension can be obtained from the Microsoft Visual Studio Marketplace. The name of the extension is GISDK.

  • Can be used with Visual Studio or the free Visual Studio Code Editor

  • Parses and colorizes GISDK-related files (such as .RSC files)

  • Provides code snippets for GISDK macros and functions

  • Provides a Peek Definition macro (Alt-F12)

  • Provides a Goto Definition for GISDK macro functions (F12)

  • Provides Code Completion suggestions for GISDK keywords

This GISDK extension works better in conjunction with the following extensions:

  • All Autocomplete

  • Bracket Pair Colorizer

  • Bookmarks

  • Scope Bar

To Start Editing a Resource File in Visual Studio Code

  1. In Visual Studio Code, choose File>Open Folder and choose the folder where your resource files are.
  2. Visual Studio Code will open the folder in the Explorer and list all the files in that folder.
  3. Click the *.rsc file you want to edit.

To Configure a Task for Compiling Resource Files

  1. In VSC choose View > Command Palette (CTRL-SHIFT-P).

  2. Choose (or type) Tasks: Configure Task.

  3. Choose Create tasks.json file from template.

  4. Choose Others: Example to run an arbitrary external command.

  5. VSC will create a tasks.json file.

  6. Replace the content of the tasks.json file with the code below:

{

// See https://go.microsoft.com/fwlink/?LinkId=733558

// for the documentation about the tasks.json format

"version": "2.0.0",

"tasks": [

{

"label": "Compile_rsc",

"type": "shell",

"command": [

"c:\\program Files\\Maptitude 2021\\rscc.exe"

],

"args": [

"-u",

"${fileDirname}\\${fileBasenameNoExtension}.dbd",

"${file}"

],

"problemMatcher": [

{ "pattern":

{

"regexp": "([^(]*)\\((\\d+)\\).*\\: (.+)",

"file" : 1,

"line": 2,

"message": 3,

},

"fileLocation": ["absolute"]

}

],

"group": {

"kind": "build",

"isDefault": true

}

}

]

}

  1. Save the tasks.json file (Ctrl-S).

  2. Configure the Main Build Task by opening the Command Palette (CTRL-SHIFT-P) and choose Tasks: Configure Default Build Task.

  3. Choose Compile_rsc.

To Compile a Resource File

  1. The compiling task works on the file that is currently being edited. Choose the file you want to compile by clicking on the *.rsc file either on the Explorer Side Bar or on the Editors Group file tab.

  2. Open the Command Palette (CTRL-SHIFT-P).

  3. Choose Tasks: Run Build Task (CTRL-SHIFT-B).

  4. When using the Task settings above, the *.rsc file will be compiled to a *.dbd file (a UI) with the same file name of the resource file.

  5. Compilation errors will be displayed in the Problems tab (CTRL-SHIFT-M). Double click on a problem line to go to the corresponding code line in the editor.