Skip to content

Commit fffdb1f

Browse files
committed
add wiki pages
1 parent 5812bab commit fffdb1f

8 files changed

+262
-46
lines changed

docs/Code-formatting.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
layout: default
3+
title: Code Formatting
4+
permalink: /code-formatting/
5+
nav_order: 3
6+
---
7+
# Code formatting
8+
9+
In previous versions of the objectscript plugin, VSCode code completion suggested commands and functions only in UPPERCASE. Now you can select the capitalization style you prefer. There are three options:
10+
* upper - all uppercase
11+
* lower - all lower case
12+
* word - capitalize initial letter of each word
13+
14+
```json
15+
"objectscript.format": {
16+
"commandCase": "word",
17+
"functionCase": "word"
18+
},
19+
```
20+
21+
You can see how it works below.
22+
23+
![](https://community.intersystems.com/sites/default/files/inline/images/images/ezgif_com-optimize.gif)
24+
25+
VSCode itself has formatting support using Meta/Alt+Shift+F, and it can format code using configured rules. Currently, it can replace abbreviated commands and functions with the complete name, control capitalization as above, and fix indentation by substituting tabs for spaces.
26+
27+
![](https://community.intersystems.com/sites/default/files/inline/images/images/ezgif_com-optimize%20(1).gif)

docs/Connect-to-InterSystems-IRIS.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
layout: default
3+
title: Connect to InterSystems IRIS
4+
permalink: /connect/
5+
nav_order: 2
6+
---
7+
# Connect to InterSystems IRIS
8+
9+
To be able to use many of the plugin features, you first need to configure the connection to an InterSystems IRIS or Caché server.
10+
11+
* Find an 'objectscript.conn' section in workspace settings by following the menu sequence File > Preferences > Settings. Do not forget to set active to true. Set port to the web port of the instance you want to connect to. By default, this is 57772 for Caché/Ensemble and 52773 for InterSystems IRIS.
12+
13+
```JSON
14+
{
15+
"objectscript.conn": {
16+
"active": true,
17+
"label": "LOCAL",
18+
"host": "127.0.0.1",
19+
"port": 52773,
20+
"username": "user",
21+
"password": "password",
22+
"ns": "USER",
23+
"https": false
24+
},
25+
"objectscript.export.folder": "src",
26+
"objectscript.serverSideEditing": false
27+
}
28+
```
29+
30+
* Change settings to those appropriate to your Caché or InterSystems IRIS instance.
31+
* You will see related output in "Output" while switched to "ObjectScript" channel (right drop-down menu on top of the output window).

docs/Debugging.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
layout: default
3+
title: Debugging
4+
permalink: /debugging/
5+
nav_order: 5
6+
---
7+
# Debugging
8+
9+
Example of `.vscode/launch.json` file:
10+
11+
```JSONC
12+
{
13+
// Use IntelliSense to learn about possible attributes.
14+
// Hover to view descriptions of existing attributes.
15+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
16+
"version": "0.2.0",
17+
"configurations": [
18+
{
19+
"type": "objectscript",
20+
"request": "launch",
21+
"name": "ObjectScript Debug Class",
22+
"program": "##class(User.Test).Test()",
23+
},
24+
{
25+
"type": "objectscript",
26+
"request": "launch",
27+
"name": "ObjectScript Debug Routine",
28+
"program": "^test",
29+
},
30+
{
31+
"type": "objectscript",
32+
"request": "attach",
33+
"name": "ObjectScript Attach",
34+
"processId": "${command:PickProcess}",
35+
"system": true
36+
}
37+
]
38+
}
39+
```
40+
41+
See how it works for routines:
42+
![](https://community.intersystems.com/sites/default/files/inline/images/images/debug_routine.gif)
43+
44+
For classes:
45+
![](https://community.intersystems.com/sites/default/files/inline/images/images/debug_class.gif)
46+
47+
And when attached to a process:
48+
![](https://community.intersystems.com/sites/default/files/inline/images/images/debug_attach.gif)

docs/Export-settings.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
layout: default
3+
title: Export settings
4+
permalink: /export-settings/
5+
nav_order: 4
6+
---
7+
# Export settings
8+
9+
There are a few settings that control how the code is exported to the local machine from the server. `VSCode-ObjectScript` expects that these settings follow the folders' structure taken for your project.
10+
11+
- `objectscript.export.folder` -- Root for ObjectScript sources in the project. Default value is `src`. The empty value is accepted and considered as a root of the project.
12+
13+
- `objectscript.export.addCategory` -- If `true` adds folders for particular file types under the folder defined in the `objectscript.export.folder` setting. Files of type `cls`, `int`, `mac` and `inc` are placed in a folder with same type. Any other file types are placed in the `oth` folder.
14+
You can define the structure as an object, where the property name is supplied as pattern (mask or RegExp) and the value as a folder. For example:
15+
16+
```JSON
17+
{
18+
"%*.cls": "_cls",
19+
"*.cls": "cls"
20+
}
21+
```
22+
23+
This saves percent classes to the `_cls` folder, and any other classes to the `cls` folder.
24+
25+
- `objectscript.export.atelier` -- Store classes and routines in format same as in Atelier, with packages as subfolders.
26+
27+
- `objectscript.export.generated` -- Specifies that generated source code files should be exported.
28+
29+
- `objectscript.export.filter` -- SQL filter that can be used to match the names.
30+
31+
- `objectscript.export.category` -- Specifies a category to export: CLS = classes; RTN = routines; CSP = csp files; OTH = other. Default is `*` to export all categories. Used by command `Export all`.
32+
33+
- `objectscript.export.noStorage` - Strip the storage xml on export. (Useful for multiple systems).
34+
35+
- `objectscript.export.dontExportIfNoChanges` - Don't update the local file on export if the content is identical to the server code.
36+
37+
Export settings are also used to determine how to translate the class name to the file name and back. So, it's important to have correct settings, not just for export.

docs/Installation.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
layout: default
3+
title: Installation
4+
permalink: /installation/
5+
nav_order: 1
6+
---
7+
# Installation
8+
9+
Before using VSCode-ObjectScript, you need to install VSCode, which you can get [here](https://code.visualstudio.com/).
10+
11+
Once VSCode is installed, you should open it, go to Extensions View by by selecting menu items View > Extensions and search for "ObjectScript", as shown in the attached screenshot, and install it.
12+
13+
![installation](https://raw.githubusercontent.com/daimor/vscode-objectscript/master/images/installation.gif)
14+
15+
The next step is to [Connect to InterSystems IRIS](Connect-to-InterSystems-IRIS).

docs/Server-side-editing.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
layout: default
3+
title: Server-side editing
4+
permalink: /server-side-editing/
5+
nav_order: 6
6+
---
7+
# Server-side editing
8+
9+
It is possible to configure `VSCode-ObjectScript` to edit code directly on the server, which is useful in cases where source code is stored in SCM as XML and managed using Studio Source Control hooks.
10+
11+
You can configure this mode of operation using the [multi-root workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces) feature from VSCode.
12+
13+
First, you should configure the connection to InterSystems as described [here](https://github.com/daimor/vscode-objectscript/wiki/Connect-to-InterSystems-IRIS).
14+
15+
Add a file with extension `.code-workspace`, with content similar to this.
16+
17+
```JSON
18+
{
19+
"folders": [
20+
{
21+
"uri": "isfs://my-local-place",
22+
}
23+
],
24+
"settings": {
25+
"objectscript.conn": {
26+
"active": true,
27+
"host": "127.0.0.1",
28+
"port": 57332,
29+
"username": "_SYSTEM",
30+
"ns": "USER",
31+
"https": false
32+
},
33+
"objectscript.serverSideEditing": true
34+
}
35+
}
36+
```
37+
38+
When you save this file, VSCode shows you a button with an offer to open this as a workspace. Do it.
39+
40+
With the next start of VSCode, you see two folders in the root with the names described in the `.code-workspace` file. The `server` folder, if expanded, shows any code on configured server and namespace, routines and classes in one place. You can now edit this code. If you have SourceControl class, it should be configured to export files in the same location which is used in the VSCode workspace.
41+
42+
Example with connection to different namespaces on the same server:
43+
44+
```JSON
45+
{
46+
"folders": [
47+
{
48+
"name": "myapp",
49+
"path": ".",
50+
},
51+
{
52+
"uri": "isfs://myapp",
53+
"name": "server",
54+
},
55+
{
56+
"uri": "isfs://myapp?ns=USER",
57+
"name": "user",
58+
},
59+
{
60+
"uri": "isfs://myapp?ns=%SYS",
61+
"name": "system",
62+
},
63+
{
64+
"uri": "isfs://user@directserver:port?ns=%SYS",
65+
"name": "system",
66+
}
67+
],
68+
"settings": {
69+
"files.exclude": {},
70+
"objectscript.conn": {
71+
"active": true,
72+
"username": "_system",
73+
"password": "SYS",
74+
"ns": "MYAPP",
75+
"port": 52773,
76+
},
77+
"objectscript.serverSideEditing": true
78+
}
79+
}
80+
```
81+
82+
## CSP support
83+
84+
To get access to edit CSP files on a server, you can configure uri in the format `isfs://myapp{csp_application}?csp`
85+
For example:
86+
87+
```
88+
"uri": "isfs://myapp/csp/user?csp"
89+
```
90+
91+
This gives you access to the content of the `/csp/user` CSP application, where the flag `csp` is mandatory. Any changes in this virtual folder are saved on the server.
92+
93+
## Filters
94+
95+
There are some more filtering options.
96+
97+
- `isfs://myapp?type=cls`, shows only classes
98+
- `isfs://myapp?type=rtn`, shows only routines, mac, int and inc files
99+
- `isfs://myapp?generated=1`, shows generated files as well as not generated
100+
- `isfs://myapp?filter=%Z*.cls,%z*.cls,%Z*.mac`, is a comma-delimited list of search options, ignores `type`
101+
- `isfs://myapp?flat=1`, is a flat list of files that does not split packages as folders.
102+
- `isfs://myapp?ns=<namespace>&flat=1&generated=1&filter=%sqlcq.<namespace>*.cls, %sqlcq.<namespace>*.int`, view cached query class code and modify the .int code. Replace `<namespace>` as appropriate.
103+
104+
`flat` and `generated` can be combined with each other, and with `type` or `filter`. When `filter` is specified `type` is ignored.

docs/clientsource.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/serversource.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)