Skip to main content

Key Concepts for New Users of VS Code

The InterSystems® ObjectScript Extension Pack for Visual Studio Code (VS Code) integrates with and extends VS Code to provide a feature-rich environment for connecting to InterSystems servers and developing ObjectScript applications.

To fully leverage the capabilities of these extensions, you must be familiar with the VS Code environment. Indeed, it is often necessary for instructions on subsequent pages to refer explicitly to certain elements of the VS Code interface. This page provides an initial orientation to those elements; for a more comprehensive understanding of how to use VS Code, consult the official Visual Studio Code DocumentationOpens in a new tab.

Settings

VS Code settings enable you to customize various aspects of its behavior by using the Settings editorOpens in a new tab or by modifying the appropriate settings file. VS Code stores settings at three levels, with more specific settings taking precedence over more general settings:

  • User — User settings are stored in a settings.json file in a location specific to your operating system user account. User settings apply globally to any VS Code session that you open while logged in as a particular operating system user.

  • Workspace — Workspace settings are stored in a file (or files) within the workspace directory structure. Workspace settings apply to any actions performed within a workspace. They do not apply to any other workspace context.

  • Folder — You can specify specific settings for an individual root folder within a multi-root workspace by using a folder-level settings directory or by selecting the folder from the Folder drop down list on the VS Code Settings page. These settings apply to actions performed within that folder. They do not apply to other root folders in the workspace.

The extensions in the ObjectScript extension pack supply additional settings which you can use to configure connections to InterSystems servers and customize VS Code for ObjectScript development. The instructions on the pages which follow describe the use of particular settings as they become relevant to the ObjectScript development workflow. For a complete list of the settings which these extensions make available, refer to the Settings Reference.

For general information about settings in VS Code, refer to the VS Code documentation’s User and Workspace SettingsOpens in a new tab page and the SettingsOpens in a new tab section of the VS Code documentation’s Multi-Root WorkspacesOpens in a new tab page.

Workspaces

A VS Code workspace consists of the folder (or set of folders) that are using to store and organize your work on a particular project. Workspace folders can be locations on your local filesystem, or they can represent a collection of documents on a remote server. See https://code.visualstudio.com/docs/editor/workspacesOpens in a new tab for a detailed introduction to VS Code workspaces.

You can configure your workspace by defining settings in one of two ways:

  • For a workspace which consists of a single root folder (or for a single root folder within a multi-root workspace), you can maintain configuration details as two files stored in a /.vscode/ folder within the root folder:

    • a settings.json file, which contains most of the configuration settings for the folder.

    • a launch.json file, which contains debugging configurations. (Run and Debug details how to use this file to debug ObjectScript code.)

    This is the default way that the ObjectScript extension pack stores workspace settings for single-root workspaces.

  • For a multi-root workspace, you must maintain configuration details in a file with the extension .code-workspace, which can be stored anywhere within the workspace. This file is required to define which root folders a multi-root workspace consists of; it can also contain those settings which would otherwise be stored in a /.vscode/settings.json or a /.vscode/launch.json file.

    For more information about VS Code’s multi-root workspace feature, see https://code.visualstudio.com/docs/editor/multi-root-workspacesOpens in a new tab.

How you configure your workspace to develop using the ObjectScript extension pack depends upon whether you will be editing your code client-side or server-side.

Note:

The aforementioned folder-level and workspace-level configuration methods are not mutually exclusive. You can define settings for one root folder within a multi-root workspace using a /.vscode/settings.json or /.vscode/launch.json file within that root folder. You can also store settings for a workspace in a .code-worspace file even when the workspace has only a single root folder. (In fact, VS Code uses files with this extension to save a workspace’s configuration regardless of the workspace’s structure.)

However: keep in mind that settings in a folder-level /.vscode/settings.json or /.vscode/launch.json file will override settings in a workspace-level .code-workspace file. Also keep in mind that if you choose to define folder-level settings for a server-side virtual folder, special server-side configuration is required.

The Command Palette

The VS Code user interface includes the Command Palette, a launcher which allows the user to perform all available functions within VS Code using the keyboard. You can open VS Code’s Command Palette by pressing the key combination Ctrl+Shift+P (on Microsoft Windows) or Cmd+Shift+P (on macOS).

The InterSystems ObjectScript extension and the InterSystems Server Manager also make their functionality available using the Command Palette. In the pages which follow, the instructions for performing a task will usually provide the name of the Command Palette command which you can invoke as an alternative to the procedure being described.

To make it easy to search among available commands, the ObjectScript extension pack commands are grouped under the following prefixes:

  • ObjectScript (for the InterSystems ObjectScript extension)

  • InterSystems Server Manager (for the InterSystems Server Manager)

For more information about the VS Code Command Palette, see https://code.visualstudio.com/docs/getstarted/userinterface#_command-paletteOpens in a new tab.

FeedbackOpens in a new tab