Dmitry,

An amazing piece of work.

I tested this with a local install of IRIS:
IRIS for Windows (x86-64) 2019.1 (Build 510U) Thu Mar 14 2019 14:13:37 EDT

In Studio I created a test class in the USER namespace

I then opened VSCode, changed to the USER namespace and was able to open the test class

However when I tried to edit the code I saw: 

Not sure what's wrong here - any suggestions ?

Thanks,

David

$ListNext is generally faster, however for production code the following pattern should be used:

set pointer = 0
while ($listnext(list,pointer,listpart)) {
    continue:($data(listpart)=0)
    #; listpart is valid
    
}

This correctly deals with a trailing comma in the list, e.g.

set list = $listbuild(1,2,3,)

If this is fed to $listnext then listpiece will be undefined for the last iteration

Be careful when using the target parameter to $order. See the documentation for target.

If there is no data present at the node being iterated over then the target value will retain its last set value - to ensure you always use the correct value when set, kill the target variable before the $order statement and check it's validity before use with $data, e.g.

kill Data
Set Sub3 = $Order(^Trans(Sub1,Sub2,Sub3),1,Data)
quit:(Sub3="")
if ($data(Data)) {
    Write ?6,Sub3," = ",Data
    Write Data,!
}