Migrate from Studio
The extensions that make up the InterSystems ObjectScript Extension Pack contain many useful features that make migrating from InterSystems Studio easy. This page describes some of these features.
Server-Side Editing
You can configure VS Code to edit code directly on a server, which is analogous to Studio’s architecture. However, VS Code enhances this workflow with support for having multiple server-namespaces open at the same time (using VS Code’s multi-root workspace featureOpens in a new tab) and for filtering the files shown for each server-namespace. See the Server-side Editing for more information on how to configure this feature.
Server-Side Source Control
VS Code supports server-side source control without requiring any additional configuration. Server-side source control is supported for both server-side and client-side editing. If a source control class is activeOpens in a new tab, its hooks fire automatically for document lifecycle events like creation, first edit, save and deletion. You can access the server source contol menu in these locations:
-
The source control icon (when a document is open)
-
An open document’s context menu
-
A node in the context menu for the ObjectScript Explorer
-
A node in the context menu for the VS Code ExplorerOpens in a new tab.
Server-Side Projects
VS Code supports using existing Studio projects, as well as the creation, modification and deletion of them. See Work with Projects for more information about this feature and how to use it.
Accurate Syntax Coloring
The InterSystems Language Server extensionOpens in a new tab leverages VS Code’s semantic tokens APIOpens in a new tab to provide the same accurate syntax coloring for InterSystems ObjectScript and other embedded languages that Studio users are familiar with. For more information on how to customize the syntax colors for InterSystems tokens, see the Language Server’s READMEOpens in a new tab. InterSystems provides a command for Windows users to migrate their existing color customizations from Studio.
Import Server Definitions Command
The InterSystems Server Manager extensionOpens in a new tab provides the Import Servers from Windows Registry command, which will import any Studio server defintions from your Windows registry into VS Code so you can continue using them without having to do the migration youself.
To invoke the command, open the command paletteOpens in a new tab, find the InterSystems Server Manager: Import Servers from Windows Registry menu option, and run it.
Load Studio Snippets Command
The InterSystems ObjectScript extensionOpens in a new tab provides the Load Studio Snippets command, which will load any user defined snippets from Studio into VS Code. It works by reading the locations of Studio user defined snippets files from the Windows registry, converting the snippets contained in those files to VS Code’s JSON format and lastly writing the snippets to a new global snippets file called isc-studio.code-snippets. This command will only convert snippets for ObjectScript, Class Definition Language (UDL) or HTML; all other snippets are ignored.
To invoke the command, open the command paletteOpens in a new tab, find the ObjectScript: Load Studio Snippets menu option, and run it.
After you load your snippets, InterSystems recommends opening the generated file and enhancing the snippets so that they can fully leverage features available in VS CodeOpens in a new tab which Studio does not support, like tabstops and variable substitution.
You can open the snippets file in two ways:
-
Upon loading your snippets, select the Open File button in the success notification box.
-
Select the Settings button. Select the Configure User Snippets from the settings menu, and then select the isc-studio.code-snippets file from the drop-down menu.
Load Studio Syntax Colors Command
The InterSystems ObjectScript extensionOpens in a new tab provides the Load Studio Syntax Colors command, which will load the editor background and syntax foreground colors from Studio into VS Code. It works by reading the color configurations from the Windows registry and storing them in VS Code’s User SettingsOpens in a new tab as customizations of one of the InterSystems default themes provided by the Language Server extension. The command uses the background color loaded from Studio to determine which default theme it should modify, and will activate the modified theme automatically. This command will not load foreground colors for any syntax tokens that have a custom background color because per-token background colors are not supported in VS Code. This command requires that the InterSystems Language Server extensionOpens in a new tab is installed and active.
To invoke the command, open the command paletteOpens in a new tab, find the ObjectScript: Load Studio Syntax Colors option, and run it.
New File Commands
The InterSystems ObjectScript extensionOpens in a new tab provides commands for creating new Interoperability classes. Commands are provided for Business Operation, Business Process, Business Rule, Business Service and Data Transformation classes. These commands are modeled after the wizards in Studio’s File > New... > Production menu.
In VS Code, these commands are available by navigating to File > New File..., or by selecting the link on the Get Started welcome page.
Keyboard Shortcuts
In general, VS Code keyboard shortcuts are entirely customizable, as described in the VS Code documentationOpens in a new tab. However, VS Code is pre-configured with a number of shortcuts that match Studio. Download a cheat sheet hereOpens in a new tab.
This section provides mapping tables for Studio users to compare Studio shortcuts with the shortcuts which VS Code provides by default.
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
F8 | F11 | Toggles full screen display of IDE window | |
Ctrl+N | Ctrl+N | New document | |
Ctrl+O | Ctrl+O, Ctrl+P | Open document | To search for files which begin with the percent character (%) using Quick Open (Ctrl+P), you must precede the file name with a space. To search for files by name using VS Code’s Quick Open menu when you are editing code on the server-side, you must enable the Proposed APIsOpens in a new tab. |
Ctrl+Shift+O | Ctrl+K, Ctrl+O | Open project | Opens a folder on-disk. If you are not using client-side source control, opens a project from the ObjectScript pane. |
Ctrl+P | Ctrl+P | ||
Ctrl+S | Ctrl+S | Save | |
Ctrl+Shift+I | Export | For client-side editing, use the Export Code from Server command from the command palette or export from the ObjectScript Explorer | |
Ctrl+I | Import local | For client-side editing, files are imported when saved by default. You can also use the Import and Compile command in the Explorer context menu. For server-side editing, right-click on an isfs workspace folder and select the Import Local Files... command |
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
Ctrl++ | Ctrl+K then Ctrl+J, Ctrl+K then Ctrl+0 | Expand, collapse all | |
Ctrl+Left Arrow select plus icon | Ctrl+K then Ctrl+], Ctrl+K then Ctrl+[ | Expand, collapse all block sections | |
Ctrl+Shift+V | Ctrl+Shift+V | View other documents related to the current document (such as MAC or INT routines) | |
Alt+2 | Ctrl+Shift+U | Toggle output window display | |
Alt+5 | Toggle display of Code Snippets window | VS Code includes no UI for code snippets | |
Alt+6 | Ctrl+Shift+F | Toggle display of Find in Files window | |
Ctrl+Alt+, +Ctrl+Alt+ - | Ctrl+ +, Ctrl+ - | Increase, decrease font | |
Ctrl+Alt+Space | Ctrl+Shift+P and begin typing render | Toggle display of whitespace symbols, spaces, new lines, and tabs | |
Ctrl+B | Always on | Toggle bracket matching | |
Ctrl+Tab | Ctrl+Shift+] | Next window | |
Ctrl+Shift+Tab | Ctrl+Shift+[ | Previous window |
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
Home, End | Home, End | Go to beginning, end of line | |
Ctrl+Home, Ctrl+End | Ctrl+Home, Ctrl+End | Go to beginning, end of document | |
Ctrl+ -, Ctrl+Shift+ - | Alt+Left Arrow, Alt+Right Arrow | Go back, forward | |
PgUp, PgDn | PgUp, PgDn | Page Up, Down | |
Ctrl+PgUp, Ctrl+PgDn | Alt+PgUp, Alt+PgDn | Go to top, bottom of page | |
Ctrl+Down Arrow, Ctrl+Up Arrow | Ctrl+Down Arrow, Ctrl+Up Arrow | Scroll down, up | |
Ctrl+G | Ctrl+Shift+O | Go to | You can use Ctrl+T to find a symbol across files. More information can be found in the VS Code documentationOpens in a new tab |
Ctrl+F3, Ctrl+Shift+F3 | F8, Shift+F8 | Go to next, previous error | |
Alt+F3, Alt+Shift+F3 | F8, Shift+F8 | Go to next, previous warning | |
Ctrl+] | Ctrl+Shift+\ | Go to bracket |
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
Ctrl+Delete | Delete next word or delete to end of current word | To reproduce this capability, try an extension such as Emacs Friendly KeymapOpens in a new tab | |
Ctrl+Backspace or Ctrl+Shift+Delete | Delete previous word or delete to start of current word | To reproduce this capability, try an extension such as Emacs Friendly KeymapOpens in a new tab | |
Ctrl+Shift+L | Ctrl+Shift+K | Delete line | |
Ctrl+C or Ctrl+Insert | Ctrl+C | Copy | |
Ctrl+X or Shift+Delete | Ctrl+X | Cut | |
Ctrl+L | Ctrl+X | Cut line | |
Ctrl+V or Shift+Insert | Ctrl+V | Paste | |
Ctrl+A | Ctrl+A | Select all | |
Ctrl+Z, Ctrl+Y or Ctrl+Shift+Z | Ctrl+Z, Ctrl+Shift+Z | Undo, redo | |
Ctrl+Space | Ctrl+Space | Show Studio Assist popup or trigger code completion | In VS Code, code completion suggestions appear automatically as you type |
Ctrl+~ | Toggle tab expansion | Select Spaces in status bar | |
Ctrl+U, Ctrl+Shift+U | Uppercase, lowercase selection | To reproduce this capability, try an extension such as change-caseOpens in a new tab | |
Ctrl+Alt+U | Titlecase (initial caps) selection | To reproduce this capability, try an extension such as change-caseOpens in a new tab | |
Ctrl+( | ( | Insert open and close parentheses. (Does not work on German and Swiss keyboard layouts) | To reproduce this capability, try an extension such as change-caseOpens in a new tab |
Ctrl+{ | { | Insert open and close braces | |
Ctrl+= | Ctrl+Shift+P and begin typing format | Indentation cleanup — cleans up indentation on a selected block of text | |
Ctrl+/, Ctrl+Shift+/ | Ctrl+/ | Comment, uncomment line or block of text | |
Ctrl+Alt+/, Ctrl+Shift+Alt+/ | Ctrl+/ | Add, remove comment markers from block of text | |
Ctrl+E | In an ObjectScript document, commands in a selection are replaced with their full names | With the InterSystems Language Server installed, you can configure its formatter to expand command names and then format some or all of your documentOpens in a new tab | |
Ctrl+Shift+E | Compress commands | With the InterSystems Language Server installed, you can configure its formatter to contract command names and then format some or all of your documentOpens in a new tab |
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
Ctrl+F, Ctrl+H | Ctrl+F, Ctrl+H | Find, replace | |
F3, Shift+F3 | F3, Shift+F3 | Find next, previous | |
Ctrl+Shift+F | Ctrl+Shift+F, Ctrl+Shift+H | Find, replace in files | |
Ctrl+, (comma) | Ctrl+P | Search for class | |
Ctrl+Shift+G, Ctrl+Alt+G | Alt+Right Arrow, Alt+Left Arrow | Go to, go back |
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
Ctrl+F2 | Toggle bookmark on current line | To reproduce this capability, try a third-party extensionOpens in a new tab | |
F2, Shift+F2 | Go to next, previous bookmark | To reproduce this capability, try a third-party extensionOpens in a new tab | |
Ctrl+Shift+F2 | Clear all bookmarks | To reproduce this capability, try a third-party extensionOpens in a new tab |
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
F7 | Ctrl+Shift+F7 | Rebuilds all documents in project | |
Ctrl+F7 | Ctrl+F7 | Compile active document | |
Ctrl+Shift+F7 | Compile with options | Execute the Import and Compile Current File with Specified Flags... from the command palette |
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
Ctrl+Shift+A | Debug: attach | See Running and Debugging for how to debug a running process | |
F9 | F9 | Debug: toggle breakpoint on current line | |
Ctrl+F5, Shift+F5 | F5, Shift+F5 | Debug: start, stop | |
Ctrl+Shift+F5 | Ctrl+Shift+F5 | Debug: restart | |
F11, Shift+F11 | F11, Shift+F11 | Debug: step into, out | |
F10 | F10 | Debug: step over |