Skip to main content

VS Code - ObjectScript

To use VS Code - ObjectScript, you start by connecting it to an InterSystems IRIS server. You'll associate a VS Code workspace (a folder containing the files you'll work with) with the USER namespace (the same namespace you used with the Terminal). Launch VS Code, and follow these steps:

  1. In the Activity Bar on the left, click the Explorer icon at the top, and then click Open Folder.

  2. Create a new folder named Tutorial within \Documents\InterSystems\, select it, and click Select Folder. A TUTORIAL folder now appears in the Explorer.

  3. Click the InterSystems IRIS icon at the bottom of the Activity Bar to display the ObjectScript Explorer, which allows you to connect VS Code to an InterSystems IRIS server and browse the code.

  4. Click Choose Server and Namespace.

  5. Choose the default~iris server. This built-in definition connects to InterSystems IRIS on your local machine (127.0.0.1 on port 52773). It's also possible to edit the default~iris definition, or add additional server definitions. Instructions for doing that are hereOpens in a new tab.

  6. Enter valid credentials for the server (try SuperUser/SYS for Username/Password).

  7. Choose the USER namespace from the list. The ObjectScript Explorer now shows all the classes and other code contained in the USER namespace on the server.

VS Code - ObjectScript allows you to debug your code following VS Code conventions:

  1. Click to the left of any line in your code to toggle a breakpoint on (red dot appears) or off.

  2. To quickly launch the debugger on any class method, click Debug this method that appears just above the class method name. If the class method takes any arguments, you'll be prompted for to supply them.

  3. You can also define a launch configuration by editing the launch.json file. Instructions for doing that are hereOpens in a new tab. In particular, you use the "program" attribute to specify the class method you want the debugger to launch ("##class(ObjectScript.RightTriangle).Main()", for example), along with any arguments.

FeedbackOpens in a new tab