
InterSystems® ObjectScript language support for Visual Studio Code, from the InterSystems Developer Community.
Documentation on GitHub Pages.
Guidance on reporting issues.
InterSystems ObjectScript code highlighting support.
Debugging ObjectScript code.
Intellisense support for commands, system functions, and class members.
Export of existing server sources into a working folder:
ObjectScript: Export Sources
Save and compile a class:
ObjectScript: Import and Compile Current File
from Command PaletteDirect access to edit or view server code in the VS Code Explorer via isfs
and isfs-readonly
FileSystemProviders (e.g. using a multi-root workspace). Server-side source control is respected.
Server Explorer view (ObjectScript: Explorer) with ability to export items to your working folder.
Install Visual Studio Code first.
Open VS Code. Go to Extensions view (⌘/Ctrl+Shift+X), search for "vscode-objectscript" and install it. Or install direct from the ObjectScript extension page on Visual Studio Marketplace.
This extension is able to to take advantage of some VS Code APIs that have not yet been finalized.
The additional features (and the APIs used) are:
To unlock these features (optional):
Download and install a beta version from GitHub. This is necessary because Marketplace does not allow publication of extensions that use proposed APIs.
1.0.6
, look for 1.0.7-beta.1
. This will be functionally identical to the Marketplace version apart from being able to use proposed APIs.vscode-objectscript-1.0.7-beta.1.vsix
) and install it. One way to install a VSIX is to drag it from your download folder and drop it onto the list of extensions in the Extensions view of VS Code.From Command Palette choose Preferences: Configure Runtime Arguments
.
In the argv.json file that opens, add this line:
"enable-proposed-api": ["intersystems-community.vscode-objectscript"]
intersystems-community.vscode-objectscript version X.Y.Z-beta.1 activating with proposed APIs available.
After a subsequent update of the extension from Marketplace you will only have to download and install the new vscode-objectscript-X.Y.Z-beta.1
VSIX. None of the other steps above are needed again.
To be able to use many features you first need to configure the connection to your IRIS/Caché/Ensemble server(s) in your VS Code settings. If you are unfamiliar with how settings work and how they are edited, use that link.
We recommend you define server connections in the intersystems.servers
object whose structure is defined by the InterSystems Server Manager helper extension.
Install that extension and consult its documentation about commands for easy setup of connections, plus assistance when editing the JSON definition directly.
For more tips about the intersystems.servers
object, see the Notes section below.
A simple workspace -- a local working folder in which you edit InterSystems source files and manage them using client-side source control (e.g. Git) -- will use the objectscript.conn
settings object to import locally-edited code into a namespace on a server, compile it there and run/debug it, and also for initial export of an existing codebase (optional). This settings object is usually defined in Workspace Settings, for example in the .vscode/settings.json
file of your working folder.
A quick way to add objectscript.conn
to a new working folder is:
For more about objectscript.conn
see the Notes section below.
To edit code directly in one or more namespaces on one or more servers (local or remote) we recommend creating a workspace definition file (for example XYZ.code-workspace) where you specify one or more root folders that directly access namespaces via the isfs
or isfs-readonly
URI schemes. The only difference between these two schemes is that any file opened from a folder using the isfs-readonly
scheme will be set as read-only in VS Code and thus protected against being changed.
.code-workspace
extension.For more about isfs
and isfs-readonly
folder specifications see the Notes section below.
Connection-related output appears in the "Output" view while switched to the "ObjectScript" channel using the drop-down menu on the view titlebar.
For Caché/IRIS instance with maximum security level, add %Development
role for /api/atelier/
web-application (read more).
If you are getting ERROR # 5540: SQLCODE: -99 Message: User xxx is not privileged for the operation
when you try to get or refresh class/routine/include- lists, grant your username (or a SQL role you hold) execute permission for the following SQL Procedure in the target namespace.
GRANT EXECUTE ON %Library.RoutineMgr_StudioOpenDialog TO xxx
intersystems.servers
This settings object is useful for both client-side and server-side development.
"intersystems.servers": {
"local": {
"webServer": {
"scheme": "http",
"host": "127.0.0.1",
"port": 52773
},
"description": "My local IRIS",
"username": "me"
}
}
By defining connections in your User Settings they become available for use by any workspace you open in VS Code. Alternatively, define them in workspace-specific settings.
Setting the username
property is optional. If omitted it will be prompted for when connecting, then cached for the session.
Setting a plaintext value for the password
property is not recommended. Instead, run the InterSystems Server Manager: Store Password in Keychain
command from Command Palette.
If no password has been set or stored it will be prompted for when connecting, then cached for the session.
objectscript.conn
This settings object is primarily relevant when doing client-side development.
objectscript.conn
uses its server
property to point to an entry in intersystems.servers
. For example: "objectscript.conn": {
"active": true,
"server": "local",
"ns": "USER"
}
The mandatory ns
property defines which server namespace you will work with.
When the server
property is set, any username
or password
properties of objectscript.conn
are ignored. Instead these values come from the intersystems.servers
entry.
isfs
and isfs-readonly
workspace foldersServer-side development is best done using isfs
folders. The read-only variant isfs-readonly
is also useful when doing client-side development, since it enables server-side searching of your codebase.
To modify how your folder behaves, edit the JSON of your workspace definition (XYZ.code-workspace file). Get there by running the 'Preferences: Open Workspace Settings (JSON)' command. Edit your uri
property.
csp
query parameter indicates web application files are to be shown. The uri path optionally specifies which application. The namespace suffix on the server name (preferred syntax) or the ns
query parameter (deprecated) must specify the same namespace the application is configured to use. In the following example the first folder is for the /csp/user
web application in the USER namespace of the server named 'local' and the second gives read-only access to all web applications that reside in the %SYS namespace. The second folder also uses the optional name
property: {
"uri": "isfs://local:user/csp/user?csp"
},
{
"name": "local:%SYS web files (read-only)",
"uri": "isfs-readonly://local/?ns=%SYS&csp"
}
{
"uri": "isfs://local:user/Xxx/Yyy?type=cls"
}
type=cls
to show only classes, or type=rtn
to show only routines.flat=1
to flatten the hierarchy.generated=1
to show generated items.filter=filterspec
to use a filter specification formatted in the same way as used in InterSystems Studio's File Open dialog (e.g. filter=Ensem*.inc
).CaretDev provides commercial support services. Request a quote.
On-line course from CaretDev - Developing with VS Code ObjectScript – Easy Start.