Skip to content

Commit 775ecd7

Browse files
committed
examples and reorg beginning
1 parent d353b98 commit 775ecd7

File tree

1 file changed

+84
-5
lines changed

1 file changed

+84
-5
lines changed

docs/Configuration.md

Lines changed: 84 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,97 @@ title: Configuration
44
permalink: /configuration/
55
nav_order: 4
66
---
7-
# Configuration
7+
8+
# Configuration
89

910
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.
1011

12+
{: #code-configuration-basic}
13+
14+
## Basic Configuration
15+
16+
VS Code has a concept of a workspace, 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 your 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 contents:
19+
20+
{: #code-workspace-simple}
21+
22+
```json
23+
{
24+
"objectscript.conn": {
25+
"server": "iris",
26+
"ns": "USER",
27+
"active": true,
28+
"host": "localhost",
29+
"port": 52773,
30+
"username": "_SYSTEM"
31+
}
32+
}
33+
```
34+
35+
If you need ObjectScript compilation flags other than the default, add an `"objectscript.compileFlags"` property to `settings.json` (more compileFlags options are [covered here](/vscode-objectscript/settings/):
36+
37+
{: #code-workspace-compileFlags}
38+
39+
```json
40+
{
41+
"objectscript.conn": {
42+
"server": "iris",
43+
"ns": "USER",
44+
"active": true,
45+
"host": "localhost",
46+
"port": 52773,
47+
"username": "_SYSTEM"
48+
},
49+
"objectscript.compileFlags": "cuk/compileembedded=1"
50+
}
51+
```
52+
53+
Here is the simplest `launch.json` file contents, which debugs the method `Test` in the class `Example.Service`, passing 2 parameters as input:
54+
55+
{: #code-workspace-simple-debug}
56+
57+
```json
58+
{
59+
"version": "0.2.0",
60+
"configurations": [
61+
{
62+
"type": "objectscript",
63+
"request": "launch",
64+
"name": "Example.Service.Test",
65+
"program": "##class(Example.Service).Test(<methodparam1>,<methodparam2>)"
66+
}
67+
]
68+
}
69+
```
70+
71+
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:
72+
73+
{: #code-workspace-simple-debug-process}
74+
75+
```json
76+
{
77+
"version": "0.2.0",
78+
"configurations": [
79+
{
80+
"type": "objectscript",
81+
"request": "attach",
82+
"name": "Example-attach-to-process",
83+
"processId": "${command:PickProcess}"
84+
}
85+
]
86+
}
87+
```
88+
89+
Note that `"configurations"` is an array, so you can have multiple configurations and choose the one to use from a dropdown menu in the Debug pane.
90+
1191
{: #code-workspaces}
12-
## VS Code Workspaces
1392

14-
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`.
93+
## VS Code Workspaces
1594

16-
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.
95+
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.
1796

18-
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.
97+
Since you have more than one root folder, settings are stored in a file with a `*.code-workspace` suffix. The file can have any name followed by *.code-workspace*, for example `test.code-workspace`. This file can be located anywhere. 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 `settings.json` or `launch.json`. 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.
1998

2099
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.
21100

0 commit comments

Comments
 (0)