intersystems-community / intersystems-servermanager

VS Code helper extension defining connections to InterSystems servers

Home Page:https://marketplace.visualstudio.com/items?itemName=intersystems-community.servermanager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow action contributions to depend on server's API version

gjsjohnmurray opened this issue · comments

When the ObjectScript extension contributes the Launch WebSocket Terminal button to namespaces in the Server Manager tree it is unable to discriminate between namespaces on servers that support the necessary version of the Atelier API (v7, which landed with 2023.2) and namespaces on older servers. This results in a poor UX, as the user may click a promising-looking button only to be told that their server doesn't support the feature.

I propose adding the API version number as a prefix on the viewItem context keys of all tree folders / leaves below the "Namespaces" folder of a server. It is only when "Namespaces" gets expanded that Server Manager attempts the connection. One of the properties of the response object it gets if successful is the API version number.

Existing when-clauses that check viewItem to spot a namespace item already use the /namespace$/ regex in order to match both namespace and sysnamespace (the latter being what SM marks the %SYS namespace with). This means the proposed numeric prefix shouldn't break these.

For consistency and future-proofing I propose also propagating the version prefix down into the the Projects and Web Apps subtrees, in case SM or other extensions want to contribute commands there but only conditional upon the server supporting a new enough Atelier API.

@isc-bsaviano any comments on this proposal?

@gjsjohnmurray I think this sounds reasonable