Skip to content

Commit eeea4e8

Browse files
committed
Documentation Improvements
1 parent d40a4f4 commit eeea4e8

File tree

3 files changed

+73
-17
lines changed

3 files changed

+73
-17
lines changed

docs/Configuration.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ Open the folder where you want client-side files to be located. Select the **Obj
110110

111111
You cannot create a connection to a server that is not running.
112112

113-
Click on the server and namespace in the status bar to open a list of actions you can take for this server:
114-
115-
![Select action for server.](../assets/images/action-for-server.png "select action for server")
116-
117113
## Editing a Server Connection
118114

119115
If you need to modify a server connection select **File > Preferences > Settings** (**Code > Preferences > Settings** on Mac) from the menu. Select the **Workspace** settings level. Search for **objectscript: conn**, and click on *Edit in settings.json*.
@@ -133,3 +129,34 @@ The components of this configuration are:
133129
- **ns** - namespace to use on the server
134130
- **server** - server name as specified in the server configuration
135131
- **active** - specifies whether the connection is active.
132+
133+
## Add Custom Entries to the Server Actions Menu
134+
135+
Click on the server and namespace in the status bar to open a list of actions you can take for this server:
136+
137+
![Select action for server.](../assets/images/action-for-server.png "select action for server")
138+
139+
You can add custom entries to this list using the `objectscript.conn.links` configuration object, which contains key-value pairs where the key is the label displayed in the menu and the value is the uri to open. The following variables are available for substitution in the uri:
140+
141+
- **${host}** - The hostname of the connected server. For example, `localhost`
142+
- **${port}** - The port of the connected server. For example, `52773`
143+
- **${serverUrl}** - The full connection string for the server. For example, `http://localhost:52773/pathPrefix`
144+
- **${ns}** - The namespace that we are connected to, URL encoded. For example, `%25SYS` or `USER`
145+
- **${namespace}** - The raw `ns` parameter of the connection. For example, `sys` or `user`
146+
- **${classname}** - The name of the currently opened class, or the empty string if the currently opened document is not a class.
147+
- **${classnameEncoded}** - `${classname}` URL encoded.
148+
149+
An example links configuration looks like this:
150+
151+
```json
152+
"objectscript.conn": {
153+
"links": {
154+
"Portal Explorer": "${serverUrl}/csp/sys/exp/%25CSP.UI.Portal.ClassList.zen?$NAMESPACE=${ns}",
155+
"SOAP Wizard": "${serverUrl}/isc/studio/templates/%25ZEN.Template.AddInWizard.SOAPWizard.cls?$NAMESPACE=${ns}"
156+
},
157+
}
158+
```
159+
160+
And the resulting Server Actions Menu looks like this:
161+
162+
![Server actions with custom links.](../assets/images/server-actions-with-links.png "server actions menu with custom links")

docs/RunDebug.md

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ nav_order: 5
88

99
The InterSystems ObjectScript Extension provides support for ObjectScript debugging. It takes advantage of the debugging capabilities built into VS Code, so you may find these VS Code documentation resources useful:
1010

11-
- [Node.js debugging in VS Code](https://code.visualstudio.com/docs/editor/debugging)
12-
- [Debugging](https://code.visualstudio.com/docs/editor/debugging)
11+
- [Debugging Intro Video](https://code.visualstudio.com/docs/introvideos/debugging)
12+
- [Debugging User Guide](https://code.visualstudio.com/docs/editor/debugging)
1313

14-
## Launch Configurations
14+
## Debug Configurations
1515

16-
In order to run or debug an ObjectScript class or routine, you must create a launch configuration. Some other languages default to running the currently active file, but to run ObjectScript, you must specify the routine or ClassMethod to use.
16+
In order to run or debug an ObjectScript class or routine or attach to a running process, you must create a debug configuration. Some other languages default to running the currently active file, but to run ObjectScript, you must specify the routine or ClassMethod to use or the running process to attach to.
1717

1818
Click the run button in the Activity Bar:
1919

2020
![Run button.](../assets/images/run.png "run button")
2121

22-
If no launch configurations are available, you are prompted to create one:
22+
If no debug configurations are available, you are prompted to create one:
2323

24-
![Create launch configuration.](../assets/images/CreateLaunchConfig.png "create launch configuration")
24+
![Create debug configuration.](../assets/images/CreateLaunchConfig.png "create debug configuration")
2525

2626
Clicking the link opens a dialog containing a list of debug environments. Select **ObjectScript Debug**.
2727

@@ -42,13 +42,13 @@ Once you have chosen a debug environment, VS Code creates and opens a `launch.js
4242
}
4343
```
4444

45-
These attributes are mandatory for any launch configuration:
45+
These attributes are mandatory for any debug configuration:
4646

4747
- **type** - Identifies the type of debugger to use. In this case, `objectscript`, supplied by the InterSystems ObjectScript extension.
4848
- **request** - Identifies the type of action for this launch configuration. Possible values are `launch` and `attach`.
4949
- **name** - An arbitrary name to identify the configuration. This name appears in the Start Debugging drop down list.
5050

51-
In addition, for an **objectscript** configuration, you need to supply the attribute **program**, which specifies the routine or ClassMethod to run when launching the debugger, as shown in the following example:
51+
In addition, for an **objectscript launch** configuration, you need to supply the attribute **program**, which specifies the routine or ClassMethod to run when launching the debugger, as shown in the following example:
5252

5353
```json
5454
"launch": {
@@ -68,15 +68,44 @@ In addition, for an **objectscript** configuration, you need to supply the attri
6868
"program": "##class(Test.MyOtherClass).GoodbyeWorld()",
6969
},
7070
]
71-
}
71+
}
7272
```
7373

74-
## Launching a ClassMethod or Routine
74+
For an **objectscript attach** configuration, you may supply the following attributes:
75+
76+
- **processId** - Specifies the ID of process to attach to as a `string` or `number`. Defaults to `"${command:PickProcess}"`, which provides a dropdown list of process ID's to attach to at runtime.
77+
- **system** - Specifies whether to allow attaching to system process. Defaults to `false`.
78+
79+
The following example shows multiple valid **objectscript attach** configurations:
80+
81+
```json
82+
"launch": {
83+
"version": "0.2.0",
84+
"configurations": [
85+
{
86+
"type": "objectscript",
87+
"request": "attach",
88+
"name": "Attach 1",
89+
"processId": 5678
90+
},
91+
{
92+
"type": "objectscript",
93+
"request": "attach",
94+
"name": "Attach 2",
95+
"system": true
96+
},
97+
]
98+
}
99+
```
100+
101+
## Starting a Debugging Session
102+
103+
You can select a debug configuration from the list VS Code provides in the Run and Debug field at the top of the debug side bar:
75104

76-
You can select a launch configuration from the list VS Code provides in the Run and Debug field at the top of the debug side bar:
105+
![Select debug configuration.](../assets/images/select-config.png "select debug configuration")
77106

78-
![Select launch configuration.](../assets/images/select-config.png "select launch configuration")
107+
Clicking on the green arrow runs the currently selected debug configuration.
79108

80-
Clicking on the green arrow runs the currently selected launch configuration.
109+
When starting **objectscript launch** debug session, make sure that the file containing the **program** that you are debugging is open in your editor and is the active tab. VS Code will start a debug session with the server of the file in the active editor (the tab that the user is focused on).
81110

82111
Debugging commands and items on the **Run** menu function much as they do for other languages supported by VS Code. For information on VS Code debugging, see the documentation resources listed at the start of this section.
57.6 KB
Loading

0 commit comments

Comments
 (0)