How can we set the properties of a package in VSCode?
In the wew versions of IRIS the Studio is going to be deprecated. In the Studio when editing classes there is an option to add information at package level, with the option "Package Information" that shows this dialog:
In VSCode there is the option to add/edit this package information? If no, how can one add/edit this information without the Studio?
Thanks.
$ZV: IRIS for UNIX (Ubuntu Server 22.04 LTS for x86-64) 2023.3 (Build 254U) Wed Nov 8 2023 12:59:54 EST [Health:7.0.3]
Very interesting question! In case anyone is wondering, in Studio you can access this info in the Workspace View on the Namespace tab or the Project tab. Right-click on the package name, and click Package Information. The information entered here is stored in the ^oddPKG global, subscripted by package name.
There doesn't appear to be a way to access this information in VS Code. I think it's worth creating an issue for this here (VS Code ObjectScript issues) and see what happens.
The issue is, that those settings are not presented in UDL formats. Without supporting it as files, and being able to use source control with this, it won't be easy to use.
@Dmitry Maslennikov is right. Package information is not present in the UDL format so it doesn't make sense to support it in VS Code. Therefore, Studio's deprecation also deprecates this feature.
Deprecation of this feature, quite a big deal, actually.
One of the use cases, I would think is mostly used here, is to shorten package names in SQL. So instead of using a multi-level package long name, use shortened form, which is quite handy.
Maybe is not a very used feature but in our team we think also that is a quite handy feature.
As @Dmitry Maslennikov wrote, we are using it mostly to shorten long multi-level package names, but it is also useful for grouping classes that do different tasks (e.g. classes with tables and others with stored procedures) from different packages into a single SQL package.
Package definition can already be exported to a file using $system.OBJ.Export("Foo.Bar.pkg",filename)
Yes, it's XML format rather than prettier UDL, but it can still be used to manage the definition in file-based source control.
You can set it programmatically:
set package = ##class(%PackageDefinition).%OpenId("User",,.sc) zw package package=2@%Library.PackageDefinition ; <OREF> +----------------- general information --------------- | oref value: 2 | class name: %Library.PackageDefinition | %%OID: $lb("User","%Library.PackageDefinition") | reference count: 2 +----------------- attribute values ------------------ | %Concurrency = 1 <Set> | ClientName = "" | Description = "" | GlobalPrefix = "" | Name = "User" | OwnerName = "" | RtnPrefix = "" | SQLName = "" +----------------- swizzled references --------------- | i%list = "" <Set> | r%list = "" <Set> +-----------------------------------------------------
Good option. It works.
Thank you!