Migrating 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 highlights a few of them.
Server-side Editing
VS Code can be configured 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 feature) and for granularly filtering the files shown for each server-namespace. See the Server-side Editing
documentation page 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 active, its hooks will be fired automatically for document lifecycle events like creation, first edit, save and deletion. The server source contol menu can also be accessed in these locations:
- The source control icon in the top-right portion of the window when a document is open.
- An open document’s context menu.
- A node of the ObjectScript Explorer’s context menu.
- A node of the VS Code Explorer’s context menu.
Server-side Projects
VS Code supports using existing Studio projects, as well as the creation, modification and deletion of them. See the Working with Projects
documentation page for more information about this feature and how to use it.
Accurate Syntax Coloring
The InterSystems Language Server extension leverages VS Code’s semantic tokens API 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 README. A command is provided for Windows users to migrate their existing color customizations from Studio.
Import Server Definitions Command
The InterSystems Server Manager extension 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 palette, find the InterSystems Server Manager: Import Servers from Windows Registry
menu option and run it.
Load Studio Snippets Command
The InterSystems ObjectScript extension 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 others will be ignored. To invoke the command, open the command palette and run the ObjectScript: Load Studio Snippets
option.
After loading the snippets it is recommended that you consider opening the generated file and enhancing the snippets so that they take advantage of features available in VS Code that Studio does not support, like tabstops and variable substitution. To open the file, click on the Open File
button in the success notification box, or click on the Settings gear in the bottom-left corner of the window, select the Configure User Snippets
menu option, and then select the isc-studio.code-snippets
file in the dropdown that appears.
Load Studio Syntax Colors Command
The InterSystems ObjectScript extension 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 Settings 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 extension is installed and active. To invoke the command, open the command palette and click the ObjectScript: Load Studio Syntax Colors
option.
New File Commands
The InterSystems ObjectScript extension 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. The commands are shown in the New File...
menu, which can be opened from the File
menu (File
→ New File...
) or the Get Started
welcome page.
Keyboard Shortcuts
In general, VS Code keyboard shortcuts are infinitely customizable as described in the docs. However, the IDE comes configured with a number of shortcuts that match Studio. Download a cheat sheet here.
This section provides a mapping table for Studio users to more quickly adapt your shortcut muscle memory from Studio to VS Code with the ObjectScript extension.
General
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
F8 | F11 | Toggles Full Screen Display of Studio menus and editor window. | |
Ctrl+N | Ctrl+N | New Document | |
Ctrl+O | Ctrl+O | Open Document | |
Ctrl+Shift+O | Ctrl+K Ctrl+O | Open Project | Opens a folder on-disk (if you're not using client-side source control, opens a Studio project from 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 on save by default. You can also use the Import and Compile command in the file explorer content menu. For server-side editing, right-click on an isfs workspace folder and select the Import Local Files... command. |
Display
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
Ctrl++ | Ctrl+K Ctrl+J, Ctrl+K Ctrl+0 | Expand, Collapse All | |
Ctrl+Left Select plus icon | Ctrl+K Ctrl+], Ctrl+K Ctrl+[ | Expand, Collapse All Block Sections | |
Ctrl+Shift+V | Ctrl+Shift+V | View Others. Opens documents related to the current document, such as MAC or INT routines. | |
Alt+2 | Ctrl+Shift+U | Toggle Output window display | |
Alt+5 | Toggles Code Snippets window display | Code Snippets exist in VS Code but there's no UI. | |
Alt+6 | Ctrl+Shift+F | Toggles Find in Files window display | |
Ctrl+Alt++, Ctrl+Alt+- | Ctrl++, Ctrl+- | Increase, Decrease Font | |
Ctrl+Alt+Space | Ctrl+Shift+P (start typing render) | Toggles display of Whitespace Symbols, spaces, newlines, and tabs | |
Ctrl+B | always on | Toggle Bracket Matching | |
Ctrl+Tab | Ctrl+Shift+] | Next Window | |
Ctrl+Shift+Tab | Ctrl+Shift+[ | Previous Window |
Navigation
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 ⇦, Alt ⇨ | Go Back, Forward | |
PgUp, PgDn | PgUp, PgDn | Page Up, Down | |
Ctrl+PgUp, Ctrl+PgDn | Alt+PgUp, Alt+PgDn | Go to top, bottom of visible page | |
Ctrl+↓, Ctrl+↑ | Ctrl+↓, Ctrl+↑ | Scroll Down, Up | |
Ctrl+G | Ctrl+Shift+O | Goto | You can use Ctrl+T to find a symbol across files. More information can be found in the VS Code docs. |
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 |
Editing
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
Ctrl+Delete | Delete Next Word or to End of Word | Try an extension such as Emacs Friendly Keymap | |
Ctrl+Backspace or Ctrl+Shift+Delete | Delete Previous Word or to Start of Word | Try an extension such as Emacs Friendly Keymap | |
Ctrl+Shift+L | Ctrl+Shift+K | Delete Line | |
Ctrl+C or Ctrl+Insert | Ctrl+C | Copy | |
Shift+Delete or Ctrl+X | 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/Trigger Code Completion | In VS Code, code completion will pop up as you type so using this keybinding is often not necessary. |
Ctrl+~ | Toggle Tab Expansion | Use indent menu in bottom bar. | |
Ctrl+U, Ctrl+Shift+U | Uppercase, Lowercase Selection | Try an extension such as change-case | |
Ctrl+Alt+U | Titlecase (Initial Caps) Selection | Try an extension such as change-case | |
Ctrl+( | ( | Insert Open and Close Parentheses. (Does not work on German and Swiss keyboards.*) | |
Ctrl+{ | { | Insert Open and Close Braces. | |
Ctrl+= | Ctrl+Shift+P (type format...) | Indentation Cleanup. Cleans up indentation on a selected block of whole lines of text. | |
Ctrl+/, Ctrl+Shift+/ | Ctrl+/ | Comment, Uncomment Line or block of text | |
Ctrl+Alt+/, Ctrl+Shift+Alt+/ | Ctrl+/ | Comment Markers Added to, Removed 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 document. | |
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 document. |
Find and Replace
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+⇨, Alt+⇦ | Go To, Go Back |
Bookmarks
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
Ctrl+F2 | Toggle Bookmark on Current Line | Try a 3rd party extension | |
F2, Shift+F2 | Go to Next, Previous Bookmark | Try a 3rd party extension | |
Ctrl+Shift+F2 | Clear All Bookmarks | Try a 3rd party extension |
Build and Compile
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. |
Debugging
Studio | VS Code | Action | VS Code Notes |
---|---|---|---|
Ctrl+Shift+A | Debug Attach | See the debugging documentation page 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 |