Hi Michael, I am convinced that a change should be made here. I'm going to always enable the code that fills in the ROUTINE and Class headers when a new file is created, because that scaffolding is valuable even if the user has to edit the generated name. However, I will leave the code that modifies existing files when they are moved guarded by the objectscript.autoAdjustName setting, which will remain false by default.

Of the three options presented already, concatenating with $LISTBUILD() is by far the most performant. Running the following method

ClassMethod ListTest(l = 100000)
{
    #; Concatenate with $LISTBUILD
    Set li="",zh=$ZHOROLOG
    For i=1:1:l Set li=li_$LISTBUILD(i)
    Write "Creating a list with length of ",$LISTLENGTH(li)," using $LISTBUILD() took ",$ZHOROLOG-zh," seconds",!
    #; Set $LIST
    Set li="",zh=$ZHOROLOG
    For i=1:1:l Set $LIST(li,i)=i
    Write "Creating a list with length of ",$LISTLENGTH(li)," using $LIST() took ",$ZHOROLOG-zh," seconds",!
    #; $LISTUPDATE
    Set li="",zh=$ZHOROLOG
    For i=1:1:l Set li=$LISTUPDATE(li,i,i)
    Write "Creating a list with length of ",$LISTLENGTH(li)," using $LISTUPDATE took ",$ZHOROLOG-zh," seconds"
}

on a recent version of IRIS produces these results:

USER>d ##class(User.Test).ListTest()
Creating a list with length of 100000 using $LISTBUILD() took .007244 seconds
Creating a list with length of 100000 using $LIST() took 10.156168 seconds
Creating a list with length of 100000 using $LISTUPDATE took 10.954107 seconds

@Anna Golitsyna If you goal is to find all globals referenced in a document, you can use a modified version of the code I included in this comment. The code uses the %SyntaxColor class to get a JSON array of semantic tokens for a document, and then loops through them looking for global references. Note that this will only find literal references, not naked references or indirection.

ClassMethod WriteAllGrefs()
{
    Set syn = ##class(%SyntaxColor).%New(), in = ##class(%Stream.TmpCharacter).%New(), out = ##class(%Stream.TmpCharacter).%New()
    #; TODO Put your document's contents into "in"
    Do syn.Color(in,out,"COS" /* or "INT" or "CLS" */,"KE" /* K means JSON output, E means keep empty lines */)
    #; Format of the JSON output:
    #; [
    #;     #; One array for each source line
    #;     [
    #;         {
    #;             #; Language of the token. See Languages() in %Library.SyntaxColor.
    #;             "l": %Integer,
    #;             #; Attribute of the token. See Attributes() in %Library.SyntaxColor.
    #;             "s": %Integer,
    #;             #; Zero-indexed start position of the token on the line
    #;             "p": %Integer,
    #;             #; Length of the token in characters
    #;             "c": %Integer
    #;         }
    #;     ]
    #; ]
    Set json = ##class(%DynamicArray).%FromJSON(out), lineIter = json.%GetIterator()
    While lineIter.%GetNext(.lineNum,.lineTokens) {
        Set tokensIter = lineTokens.%GetIterator()
        While tokensIter.%GetNext(,.token) {
            If (
                #; COS
                (token.l = 1) &&
                #; Global reference
                (token.s = 18)
            ) {
                Write "Gref starting in column ",token.p + 1," of line ",lineNum + 1,!
            }
        }
    }
}

You can combine this with the %Library.RoutineMgr_StudioOpenDialog query to make an index of all globals referenced in a subset of documents.

Thank you for testing the beta! I will attempt to reproduce your issues and will report back.

EDIT: Before I start testing, do you see any errors in the ObjectScript Output channel (besides EMFILE)? Also, the "auto-generating name" on creation of a new class/routine has been intentionally removed. This change divorces file importing from the export settings' folder structure, so it didn't make sense to keep using those settings to generate a file name.

EDIT 2: The "auto-generating name" feature is still in the extension, it's just off by default. To turn it back on, use the objectscript.autoAdjustName setting.

Hi @Andre Ribera , AFAIK there isn't a way to check on a server if a Studio client connected to it has unsaved changes to a project. You can edit projects programmatically using the %Studio.Project class. You may also want to consider making your app IDE-agnostic because Studio is deprecated and has been removed from IRIS kits starting with 2024.2.

Hi @Luc Morningstar, if VS Code is not meeting your needs then I would be happy to hear about how we can improve it. We take bug reports and feature requests via GitHub issues. Please see these docs on how to report issues from VS Code and which types of issues go to which extension. I would also like to note that VS Code will fail to save a class if its name differs from another class name only in case.