Article
· Dec 16 2m read

Edit your Globals with VSCode and YAML

The best way to list, edit, save and delete globals is using an IDE. Now, it is possible if you use VSCode. It is also possible to save globals using yaml files. Perform the following steps:

1. Get an InterSystems IRIS instance and install the application iris-global-yaml: 

zpm:USER>install iris-global-yaml

2. If you just to want an InterSystems IRIS trial for tests git clone and run on docker:

git clone https://github.com/yurimarx/iris-global-yaml.git
docker-compose up -d --build

3. Go to https://openexchange.intersystems.com/package/IRIS-Global-VSCode-Editor, click GitHub button, look for iris-global-editor-0.0.1.vsix file, and save it in your local disk.

4. Now, open your VSCode IDE and click extensions:

 

5. Click the button ... and select Install from VSIX...:

 

6. Select the vsix file from your local disk to install (if installation fails, update your VSCode for the most recent VSCode binary and try again):

7. Go to View > Explorer:

8. Create or edit the file .vscode/settings.json with connections settings (edit with your host, port, namespace and credentials):

"conf.irisGlobalEditor.serverconfig": { 
      "host": "http://localhost:52773", 
      "namespace": "USER", 
      "username": "_SYSTEM", 
      "password": "SYS"
}

9. Go to the tab INTERSYSTEMS IRIS GLOBALS and click the button refresh:

10. The VSCode list all globals in the configured namespace:

11. On top of the tab, click the plus button to create a new global:

12. Write the global name and your value and press enter:

13. Click refresh button again and see your new global on bottom:

14. Now click the editor button (last button) to create a yaml file to edit your global:

15. A new yaml file is created with the global content:

16. Edit the yaml to insert subscripts into your global (it is very important use indentation with 4 spaces):

# IRIS-Global-YAML
USER:
 ^test:
     value: InterSystems IRIS
     subscripts:
        - ^test(1): 1
        - ^test(1,1): 1.1
        - ^test(1,2): 1.2
        - ^test(2,1): 2.1
        - ^test(2,2): 2.2
        - ^test(2,3): 2.3
        - ^test(2,4): 2.4

17. Save the file on any project folder and the global content will be saved on IRIS Server:

18. Try the delete buttom also and enjoy!

Discussion (5)1
Log in or sign up to continue