Skip to content

Commit 469528c

Browse files
authored
Add features to ease migration from Studio (intersystems-community#1003)
1 parent 225df76 commit 469528c

File tree

7 files changed

+496
-23
lines changed

7 files changed

+496
-23
lines changed

docs/Studio.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
layout: default
3+
title: Migrating from Studio
4+
permalink: /studio/
5+
nav_order: 10
6+
---
7+
8+
# Migrating from Studio
9+
10+
The extensions that make up the [InterSystems ObjectScript Extension Pack](../installation/#install-the-intersystems-objectscript-extensions) contain many useful features that make migrating from InterSystems Studio easy. This page highlights a few of them.
11+
12+
## Server-side Editing
13+
14+
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](https://code.visualstudio.com/docs/editor/multi-root-workspaces)) and for granularly [filtering the files](../serverside/#filters-and-display-options) shown for each server-namespace. See the [`Server-side Editing` documentation page](../serverside/) for more information on how to configure this feature.
15+
16+
## Server-side Source Control
17+
18+
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](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=ASC#ASC_Hooks_creating_and_activating_sc_class), 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:
19+
20+
- The source control icon in the top-right portion of the window when a document is open.
21+
- An open document's context menu.
22+
- A node of the [ObjectScript Explorer's](../extensionui/#objectscript-view) context menu.
23+
- A node of the VS Code [Explorer's](https://code.visualstudio.com/docs/getstarted/userinterface#_explorer) context menu.
24+
25+
## Server-side Projects
26+
27+
VS Code supports using existing Studio projects, as well as the creation, modification and deletion of them. See the [`Working with Projects` documentation page](../projects/) for more information about this feature and how to use it.
28+
29+
## Accurate Syntax Coloring
30+
31+
The [InterSystems Language Server extension](https://marketplace.visualstudio.com/items?itemName=intersystems.language-server) leverages VS Code's [semantic tokens API](https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide) 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](https://github.com/intersystems/language-server#syntax-color-customization). [A command](../studio/#load-studio-syntax-colors-command) is provided for Windows users to migrate their existing color customizations from Studio.
32+
33+
## Import Server Definitions Command
34+
35+
The [InterSystems Server Manager extension](https://marketplace.visualstudio.com/items?itemName=intersystems-community.servermanager) 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](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette), find the `InterSystems Server Manager: Import Servers from Windows Registry` menu option and run it.
36+
37+
## Load Studio Snippets Command
38+
39+
The [InterSystems ObjectScript extension](https://marketplace.visualstudio.com/items?itemName=intersystems-community.vscode-objectscript) 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](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and run the `ObjectScript: Load Studio Snippets` option.
40+
41+
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](https://code.visualstudio.com/docs/editor/userdefinedsnippets) 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.
42+
43+
## Load Studio Syntax Colors Command
44+
45+
The [InterSystems ObjectScript extension](https://marketplace.visualstudio.com/items?itemName=intersystems-community.vscode-objectscript) 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](https://code.visualstudio.com/docs/getstarted/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](https://marketplace.visualstudio.com/items?itemName=intersystems.language-server) is installed and active. To invoke the command, [open the command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and click the `ObjectScript: Load Studio Syntax Colors` option.

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ nav_exclude: true
1414
* [Settings Reference](./settings)
1515
* [Reporting Issues](./feedback)
1616
* [Working with Projects](./projects)
17+
* [Migrating from Studio](./studio)

package-lock.json

Lines changed: 57 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
"onCommand:vscode-objectscript.deleteProject",
8080
"onCommand:vscode-objectscript.addItemsToProject",
8181
"onCommand:vscode-objectscript.removeItemsFromProject",
82+
"onCommand:vscode-objectscript.loadStudioSnippets",
83+
"onCommand:vscode-objectscript.loadStudioColors",
8284
"onLanguage:objectscript",
8385
"onLanguage:objectscript-int",
8486
"onLanguage:objectscript-class",
@@ -284,6 +286,14 @@
284286
{
285287
"command": "vscode-objectscript.removeFromProject",
286288
"when": "false"
289+
},
290+
{
291+
"command": "vscode-objectscript.loadStudioSnippets",
292+
"when": "isWindows"
293+
},
294+
{
295+
"command": "vscode-objectscript.loadStudioColors",
296+
"when": "isWindows"
287297
}
288298
],
289299
"view/title": [
@@ -951,6 +961,16 @@
951961
"category": "ObjectScript",
952962
"command": "vscode-objectscript.explorer.project.addWorkspaceFolderForProject",
953963
"title": "Add Workspace Folder for Project"
964+
},
965+
{
966+
"category": "ObjectScript",
967+
"command": "vscode-objectscript.loadStudioSnippets",
968+
"title": "Load Studio Snippets"
969+
},
970+
{
971+
"category": "ObjectScript",
972+
"command": "vscode-objectscript.loadStudioColors",
973+
"title": "Load Studio Syntax Colors"
954974
}
955975
],
956976
"keybindings": [
@@ -1479,6 +1499,7 @@
14791499
"glob": "^7.1.6",
14801500
"iconv-lite": "^0.6.0",
14811501
"mkdirp": "^1.0.4",
1502+
"node-cmd": "^5.0.0",
14821503
"node-fetch-cjs": "3.1.1",
14831504
"vscode-cache": "^0.3.0",
14841505
"vscode-debugadapter": "^1.41.0",

0 commit comments

Comments
 (0)