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/Configuration.md
+95-9Lines changed: 95 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,109 @@ title: Configuration
4
4
permalink: /configuration/
5
5
nav_order: 4
6
6
---
7
-
# Configuration
8
7
9
-
VS Code settings enable you to customize various aspects of its function. The InterSystems extensions provide settings used to configure VS Code for ObjectScript development. You may find these videos from InterSystems Learning Services useful for creating a configuration that works best for you:
8
+
# Configuration
10
9
11
-
-[Working with ObjectScript Classes in VS Code for Client-Side Editing](https://learning.intersystems.com/course/view.php?id=1778&ssoPass=1)
12
-
-[Configuring VS Code Workspaces for Multiple ObjectScript Connections](https://learning.intersystems.com/course/view.php?id=1783&ssoPass=1)
10
+
VS Code settings enable you to customize various aspects of its behavior. The InterSystems extensions provide settings used to configure VS Code for ObjectScript development.
11
+
12
+
{: #code-configuration-basic}
13
+
14
+
## Basic Configuration
15
+
16
+
VS Code has a concept of a [workspace](https://code.visualstudio.com/docs/editor/workspaces), which is a set of directories you want to use when you're working on a particular project. In the simplest setup when you are working within a single directory, a VS Code workspace is just the root folder of your project. In this case you keep workspace-specific settings in two files inside a `.vscode` directory located at the root of your project. Those two files are `settings.json`, which contains most configuration settings, and `launch.json`, which contains debugging configurations.
17
+
18
+
Here is the simplest `settings.json` file content for an ObjectScript project:
19
+
20
+
{: #code-workspace-simple}
21
+
22
+
```json
23
+
{
24
+
"objectscript.conn": {
25
+
"ns": "USER",
26
+
"active": true,
27
+
"host": "localhost",
28
+
"port": 52773,
29
+
"username": "_SYSTEM"
30
+
}
31
+
}
32
+
```
33
+
34
+
However, a better strategy is to let the [InterSystems Server Manager](https://marketplace.visualstudio.com/items?itemName=intersystems-community.servermanager) handle the server connection information as described [later](#config-server). That extension also allows you to store your password securely, so please use it. Then in `settings.json` you only need to specify the server name, which you set up in Server Manager:
35
+
36
+
```json
37
+
{
38
+
"objectscript.conn": {
39
+
"server": "iris",
40
+
"ns": "USER",
41
+
"active": true
42
+
}
43
+
}
44
+
```
45
+
46
+
If you need ObjectScript compilation flags other than the default ones, add an `"objectscript.compileFlags"` property to `settings.json` (more compileFlags information is [available here](/vscode-objectscript/settings#vscode-objectscript)):
Here is the simplest `launch.json` file content, with which you can debug the method `Test` in the class `Example.Service`, passing 2 parameters as input (see ["Running and Debugging"](/vscode-objectscript/rundebug/) for more information):
If you want to debug a running process, `launch.json` should have a section like this, which will present a dropdown menu of running processes:
80
+
81
+
{: #code-workspace-simple-debug-process}
82
+
83
+
```json
84
+
{
85
+
"version": "0.2.0",
86
+
"configurations": [
87
+
{
88
+
"type": "objectscript",
89
+
"request": "attach",
90
+
"name": "Example-attach-to-process",
91
+
"processId": "${command:PickProcess}"
92
+
}
93
+
]
94
+
}
95
+
```
96
+
97
+
Note that `"configurations"` is an array, so you can define multiple configurations and choose the one to use from a dropdown menu in the Debug pane.
13
98
14
99
{: #code-workspaces}
15
-
## VS Code Workspaces
16
100
17
-
To work with VS Code, you need to open a workspace. In the simplest setup, a VS Code workspace is just the root folder of your project. Workspace settings and task configurations are stored in the root folder in the `settings.json` file in a folder called `.vscode`. Debugging launch configurations are stored in `launch.json`, also in `.vscode`.
101
+
## VS Code Workspaces
102
+
103
+
If your project requires more than a single root folder, you need to 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.
18
104
19
-
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.
105
+
In this case settings are stored in a file with a `*.code-workspace` suffix. The filename's extension must be *.code-workspace*, for example `test.code-workspace`. This workspace file can be located anywhere. It defines what root folders the workspace consists of, and may also store other settings that would otherwise be stored in `settings.json` or `launch.json`. Settings in a root folder's `.vscode/settings.json` or `.vscode/launch.json` will override those in the workspace file, so be careful to use one or the other unless you truly need to leverage this flexibility.
20
106
21
-
A multi-root workspace is defined by 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, and may also store other settings that would otherwise be stored in the settings.json or launch.json files. Settings in a folder's `.vscode/settings.json` or `.vscode/launch.json` will override those in the `*.code-workspace` file, so be careful to use one or the other unless you truly need to leverage this flexibility. You can have a workspace file even if you are only working with a single root folder. Indeed, if you are [working server-side](../serverside/) you will always be using a workspace file.
107
+
You can have a workspace file even if you are only working with a single root folder. Indeed, if you are [working server-side](../serverside/) you will always be using a workspace file.
22
108
23
-
To edit **InterSystems ObjectScript** extension settings in a `*.code-workspace` file in VS Code, open the workspace using **File > Open Workspace...**, select **File > Preferences > Settings** (**Code > Preferences > Settings** on Mac) and select the Workspace tab. Search for **objectscript: conn**, and click on *Edit in settings.json*. VS Code opens the `*.code-workspace` file for that workspace.
109
+
To edit **InterSystems ObjectScript** extension settings in a `*.code-workspace` file in VS Code, open the workspace using **File > Open Workspace from File...**, select **File > Preferences > Settings** (**Code > Preferences > Settings** on Mac) and select the Workspace tab. Search for **objectscript: conn**, and click on *Edit in settings.json*. VS Code opens the `*.code-workspace` file for that workspace.
24
110
25
111
The **InterSystems ObjectScript** extension uses the multi-root workspaces feature to support ObjectScript development directly in namespaces on InterSystems servers.
0 commit comments