You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ServerSide.md
+33-25Lines changed: 33 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,55 +4,63 @@ title: Server-side Editing
4
4
permalink: /serverside/
5
5
nav_order: 5
6
6
---
7
-
# VS Code Workspaces
7
+
{: #code-workspaces}
8
+
# VS Code Workspaces
8
9
9
-
To work with VS Code, you need to open a workspace. A VS Code workspace is usually just the root folder of your project. Workspace settings as well as debugging and task configurations are stored in the root folder in a folder called .vscode.
10
+
To work with VS Code, you need to open a workspace. A VS Code workspace can be just the root folder of your project. Workspace settings as well as debugging and task configurations are stored in the root folder in a folder called .vscode.
10
11
11
12
If you need to have more than one root folder in a VS Code workspace, use a feature called multi-root workspaces. See [Multi-root Workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces) in the VS Code documentation.
12
13
13
-
A multi root workspace contains a \*.code-workspace file. The file can have any name followed by *.code-workspace*, for example `test.code-workspace`. The .code-workspace file stores information about what folders are in the workspace. Other settings that would otherwise be stored in the settings.json or launch.json file can be stored in the .code-workspace file. You can optionally have a workspace file even if you are not using the multi-root feature.
14
+
A multi root workspace contains a \*.code-workspace file. The file can have any name followed by *.code-workspace*, for example `test.code-workspace`. The .code-workspace file stores information about what folders are in the workspace. Other settings that would otherwise be stored in the settings.json or launch.json files can be stored in the .code-workspace file. You can optionally have a workspace file even if you are not using the multi-root feature.
14
15
15
-
To edit a *.code-workspace* file in VS Code using the **InterSystems ObjectScript** extension, select **File > Preferences > Settings** (**Code > Preferences > Settings** on Mac) and select the Workspace option. When you click **Edit in settings.json**, VS Code opens the *.code-workspace* file for that workspace.
16
+
To edit a *.code-workspace* file in VS Code using the **InterSystems ObjectScript** extension, select **File > Preferences > Settings** (**Code > Preferences > Settings** on Mac) and select the Workspace level. Search for **objectscript: conn**, and click on *Edit in settings.json*. VS Code opens the *.code-workspace* file for that workspace.
16
17
17
18
The **InterSystems ObjectScript** extension uses the multi-root workspaces feature to support ObjectScript development on the InterSystems server.
18
19
19
-
# Server-side Source Control
20
+
# Configuration for Server-side Editing
20
21
21
-
You can configure the InterSystems ObjectScript extension to edit code directly on the server, using the [multi-root workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces) VS Code feature. This type of configuration is useful in cases where source code is stored in a Source Code Management (SCM) product interfaced to the server. For example you might already be using the Source Control menu in InterSystems Studio or Portal, implemented by a source control class that extends `%Studio.SourceControl.Base`.
22
+
You can configure the InterSystems ObjectScript extension to edit code directly on the server, using the [multi-root workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces) VS Code feature. This type of configuration is useful in cases where source code is stored in a Source Code Management (SCM) product interfaced to the server. For example you might already be using the Source Control menu in InterSystems Studio or Portal, implemented by a source control class that extends `%Studio.SourceControl.Base`.
22
23
23
24
First configure the `intersystems.servers` entry for your server, as described in [Configuration](../configuration).
24
25
25
-
Next create a workspace for editing code direct on the server:
26
+
Next create a workspace for editing code directly on the server:
26
27
27
-
1. Open VS Code. If a folder or workspace is already open, close it, for example by pressing <kbd>Ctrl/Cmd</kbd>+<kbd>K</kbd>, releasing that keypair, then pressing <kbd>F</kbd>.
28
+
1. Open VS Code. You must perform the following steps starting with no folder or workspace open, so if a folder or workspace is already open, close it.
29
+
1. Open the Explorer view if it is not already visible.
30
+
1. Click the button labeled **Choose Server and Namespace** in the Explorer view, as shown in the following screen shot:
28
31
29
-
2. Open the Explorer view (<kbd>Ctrl/Cmd</kbd>+<kbd>Shift</kbd>+<kbd>E</kbd>) if it is not already visible.
1. Pick a server from the list, or click the **+** sign to create a new server configuration:
30
34
31
-
3. When the button labeled "Choose Server and Namespace" appears, click it.
35
+

36
+
1. Enter credentials if prompted.
37
+
1. Pick a namespace from the list retrieved from the target server:
32
38
33
-
4. Pick a server from your `intersystems.servers` settings object, or create a new server configuration.
39
+

40
+
1. Pick an access mode from the list:
34
41
35
-
5. Enter credentials if prompted.
42
+

43
+
1. If you want to reopen this workspace in the future, use the command **File > Save Workspace As...** to save it as a `.code-workspace` file.
36
44
37
-
6. Pick a namespace from the list retrieved from the target server.
45
+
Note that the ObjectScript button is not vivible in the Activity Bar, because the files listed in the Explorer view are all on the server, so it is not needed for this configuration.
38
46
39
-
7. Pick an access mode (Editable or Read-only).
40
-
41
-
8. If you want to reopen this workspace in future, save it as a `.code-workspace` file.
42
-
43
-
> Pro tip: The .code-workspace file you just created is a JSON file which can be edited directly. The Command Palette command `Preferences: Open Workspace Settings (JSON)` gets you there quickly. A simple example looks like this:
47
+
The `.code-workspace` file is a JSON file which you can edit directly, as described in the section [VS Code Workspaces](#code-workspaces). A simple example looks like this:
44
48
```json
45
49
{
46
50
"folders": [
47
51
{
48
-
"name": "test:USER",
49
-
"uri": "isfs://test/?ns=USER"
52
+
"name": "iris184:USER",
53
+
"uri": "isfs://iris184/user"
50
54
}
51
55
],
52
56
"settings": {}
53
57
}
54
58
```
55
-
> The `name` property sets how the root folder is labeled and can be edited to suit your needs.
59
+
- The `name` property provides a name for this server-side workspace.
60
+
- The `uri` property indicates the location of resources on the server. The supplied value has three components:
61
+
- The first component can be either `isfs` or `isfs-readonly`. These values specify that this folder is on an InterSystems IRIS server. `isfs-readonly` specifies read-only access.
62
+
- The value following `://` specifies the name of the server.
63
+
- The value follosing `/` specifies the namespace.
56
64
57
65
To add more root folders to your workspace, giving you access to code in a different namespace, or on a different server, use the context menu on your existing root folder to invoke the `Add Server Namespace to Workspace...` command. This command is also available on the Command Palette.
58
66
@@ -61,12 +69,12 @@ An example of a two-folder workspace in which the second folder gives read-only
0 commit comments