Skip to content

Commit 53dceac

Browse files
committed
Merge remote-tracking branch 'upstream/master' into pre-sync-1.8.0
2 parents 3b05e7b + 7387d0a commit 53dceac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2866
-378
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
## [1.9.2022042001] 20-Apr-2022 pre-release
4+
Add 1.8.0 changes.
5+
36
## [1.7.2022040601] 06-Apr-2022 pre-release
47
Add 1.6.0 changes.
58

@@ -23,6 +26,13 @@ Add 1.4.1 changes.
2326

2427
## [1.5.2022011401] 14-Jan-2022 pre-release
2528
Add 1.4.0 changes.
29+
30+
## [1.8.0] 20-Apr-2022
31+
- Enhancements
32+
- Add support for server-side projects (#851)
33+
- Implement isfs folder rename and deletion (#923, #922)
34+
- Support "mapped" flag for isfs and export filters, to exclude packages mapped from other databases (#931)
35+
2636
## [1.6.0] 06-Apr-2022
2737
Minimum VS Code version is now 1.66.0
2838
- Enhancements

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
# InterSystems ObjectScript extension for VS Code
1010

11+
> **Note:** The best way to install and use this extension is by installing the [InterSystems ObjectScript Extension Pack](https://marketplace.visualstudio.com/items?itemName=intersystems-community.objectscript-pack) and following the [documentation here](https://intersystems-community.github.io/vscode-objectscript/).
12+
1113
[InterSystems®](http://www.intersystems.com) ObjectScript language support for Visual Studio Code, from the [InterSystems Developer Community](https://community.intersystems.com/).
1214

1315
- Documentation on [GitHub Pages](https://intersystems-community.github.io/vscode-objectscript/).
@@ -62,8 +64,8 @@ To unlock these features (optional):
6264

6365
1. Download and install a beta version from GitHub. This is necessary because Marketplace does not allow publication of extensions that use proposed APIs.
6466
- Go to https://github.com/intersystems-community/vscode-objectscript/releases
65-
- Locate the beta immediately above the release you installed from Marketplace. For instance, if you installed `1.6.0`, look for `1.6.1-beta.1`. This will be functionally identical to the Marketplace version apart from being able to use proposed APIs.
66-
- Download the VSIX file (for example `vscode-objectscript-1.6.1-beta.1.vsix`) and install it. One way to install a VSIX is to drag it from your download folder and drop it onto the list of extensions in the Extensions view of VS Code.
67+
- Locate the beta immediately above the release you installed from Marketplace. For instance, if you installed `1.8.0`, look for `1.8.1-beta.1`. This will be functionally identical to the Marketplace version apart from being able to use proposed APIs.
68+
- Download the VSIX file (for example `vscode-objectscript-1.8.1-beta.1.vsix`) and install it. One way to install a VSIX is to drag it from your download folder and drop it onto the list of extensions in the Extensions view of VS Code.
6769

6870
2. From [Command Palette](https://code.visualstudio.com/docs/getstarted/tips-and-tricks#_command-palette) choose `Preferences: Configure Runtime Arguments`.
6971
3. In the argv.json file that opens, add this line (required for both Stable and Insiders versions of VS Code):

docs/ExtensionUI.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,21 @@ Save the change. This change is not thought to have any adverse effects on the u
5858

5959
### Viewing and Editing Source Code on the Server
6060

61-
Expand the target server, then expand its **Namespaces** folder. Hover over the target namespace to reveal its command buttons:
61+
Expand the target server, then expand its **Namespaces** folder. Hover over the target namespace to reveal its command buttons:
6262

6363
![Namespace edit buttons.](../assets/images/namespace-buttons.png "namespace edit buttons")
6464

6565
- Click the **edit pencil** button to add an *isfs://server:namespace/* folder to your VS Code workspace.
6666
- Click the **viewing eye** button to add an *isfs-readonly://server:namespace/* folder to your VS Code workspace.
6767
- Hold the **alt** or **option** key while clicking the edit or view button to add a folder that gives you access to server-side web application files (for example, CSP files).
6868

69+
If you want to add a folder that shows only a single project's contents, expand the target namespace and the **Projects** folder to reveal the projects in the target namespace. Hover over the target project to reveal its command buttons:
70+
71+
![Project edit buttons.](../assets/images/project-buttons.png "project edit buttons")
72+
73+
- Click the **edit pencil** button to add an *isfs://server:namespace/?project=prjname* folder to your VS Code workspace.
74+
- Click the **viewing eye** button to add an *isfs-readonly://server:namespace/?project=prjname* folder to your VS Code workspace.
75+
6976
Once you have added a server-side namespace to the workspace, VS Code opens the Explorer view showing the added namespace. The following screen shot shows the **Sample** and **User** packages in the **src** folder on the client, and the **Sample** and **User** packages in the **USER** namespace on the server, with read-only access.
7077

7178
![Client-side and server-side namespaces.](../assets/images/client-server.png "client-side and server-side namespaces")
@@ -97,32 +104,31 @@ On Windows, the Server Manager can create connection entries for all connections
97104

98105
## ObjectScript View
99106

100-
The InterSystems ObjectScript extension supplies an ObjectScript view container. The button to select this appears in the Activity Bar only when a folder or a workspace that includes a client-side folder is open:
107+
The InterSystems ObjectScript extension supplies an ObjectScript view container. The button to select this appears in the Activity Bar:
101108

102109
![ObjectScript button.](../assets/images/objectscript.png "objectscript button")
103110

104-
When a VS Code workspace is not connected to an InterSystems IRIS server, the ObjectScript view provides a button that lets you select a server and namespace. Once the workspace is connected to an InterSystems IRIS server, the ObjectScript view shows files on the server, grouped by type of file.
111+
This view container contains two views: the ObjectScript Explorer and the Projects Explorer. For more information about the Projects Explorer, see the [Working with Projects](../projects/#explorer) page.
105112

106-
If the workspace is configured for server-side editing, the ObjectScript view is not available. In this configuration, the Explorer view lists files on the server, not on the local machine, making the ObjectScript view irrelevant.
113+
When a VS Code workspace is not connected to an InterSystems IRIS server, the ObjectScript Explorer provides a button that lets you select a server and namespace. Once the workspace is connected to an InterSystems IRIS server, the ObjectScript Explorer shows files on the server, grouped by type of file.
107114

108-
The ObjectScript view provides the following items:
115+
If the workspace is configured for server-side editing, the ObjectScript Explorer is not available. In this configuration, the Explorer view lists files on the server, not on the local machine, making the ObjectScript view irrelevant.
116+
117+
The ObjectScript Explorer provides the following items:
109118

110119
- **Compile** - Compiles files on the server.
111120
- **Delete** - Deletes files from the server.
112121
- **Export** - Exports files to the workspace on the client.
113122
- **Server Command Menu...** - Pick a command from menus configured on the server.
114123
- **Server Source Control...** - Pick a command from menus configured on the server.
115124

116-
The InterSystems IRIS documentation section [Extending Studio](https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=ASC#ASC_Hooks_extending_studio ) describes how to configure menus for source code control and other purposes. Entries from menus named **%SourceMenu** and **%SourceContext** appear in the **Server Source Control...** quickpick provided the source control class doesn't disable the entry, for example, disabling checkout if it knows that the file is already checked out.
125+
The InterSystems IRIS documentation section [Extending Studio](https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=ASC#ASC_Hooks_extending_studio) describes how to configure menus for source code control and other purposes. Entries from menus named **%SourceMenu** and **%SourceContext** appear in the **Server Source Control...** quickpick provided the source control class doesn't disable the entry, for example, disabling checkout if it knows that the file is already checked out.
117126

118127
Entries from menus with any other name appear in the **Server Command Menu...**.
119128

120129
## Views and View Containers
121130

122-
Technically the **InterSystems Tools** and **ObjectScript** entities described above are what VS Code calls [view containers](https://code.visualstudio.com/api/extension-capabilities/extending-workbench#view-container). Each contains a single view:
123-
124-
- In container **InterSystems Tools** is view **Servers**
125-
- In container **ObjectScript** is view **Explorer**
131+
Technically the **InterSystems Tools** and **ObjectScript** entities described above are what VS Code calls [view containers](https://code.visualstudio.com/api/extension-capabilities/extending-workbench#view-container). The **InterSystems Tools** view container has a single view called **Servers**. The **ObjectScript** view container has two views: **Explorer** and **Projects**.
126132

127133
When a VS Code container has only a single view in it the view header merges with the container header, with the two names separated by a colon.
128134

docs/Gemfile.lock

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,11 @@ GEM
234234
jekyll-seo-tag (~> 2.1)
235235
minitest (5.15.0)
236236
multipart-post (2.1.1)
237-
nokogiri (1.13.3)
237+
nokogiri (1.13.4)
238238
mini_portile2 (~> 2.8.0)
239239
racc (~> 1.4)
240+
nokogiri (1.13.4-x64-mingw32)
241+
racc (~> 1.4)
240242
octokit (4.22.0)
241243
faraday (>= 0.9)
242244
sawyer (~> 0.8.0, >= 0.5.3)
@@ -274,6 +276,7 @@ GEM
274276
unf (0.1.4)
275277
unf_ext
276278
unf_ext (0.0.8)
279+
unf_ext (0.0.8-x64-mingw32)
277280
unicode-display_width (1.8.0)
278281
wdm (0.1.1)
279282
webrick (1.7.0)

docs/Projects.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
layout: default
3+
title: Working with Projects
4+
permalink: /projects/
5+
nav_order: 9
6+
---
7+
8+
# Working with Projects
9+
10+
A project is a named set of class definitions, routines, include files, web application files or custom documents. All files in a project must be in the same namespace on the same InterSystems server. Each document can be associated with any number of projects. Each namespace can contain any number of projects.
11+
12+
## Why Projects?
13+
14+
You are not required to use projects in VS Code, but you should consider using them if:
15+
16+
* You work [server-side](../serverside) and the `type` and `filter` [query parameters](../serverside/#filters-and-display-options) are not granular enough.
17+
* You work server-side and want to edit CSP and non-CSP files in the same workspace folder.
18+
* You work client-side and want to group together many files to export with a single click.
19+
* You are migrating from InterSystems Studio and want to keep using an existing project.
20+
21+
{: #explorer}
22+
## Projects Explorer
23+
24+
The easiest way to manage projects is using the Projects Explorer, which is in the [ObjectScript view](../extensionui/#objectscript-view):
25+
26+
![Projects Explorer](../assets/images/projects-explorer.png "projects explorer")
27+
28+
Initally, the Projects explorer contains a root node for each server and namespace connection that exists for the current workspace. It can be expanded to show all projects in that namespace on the server, and expanding the project node will show its contents:
29+
30+
![Projects Explorer Expanded](../assets/images/projects-explorer-expanded.png "projects explorer expanded")
31+
32+
You can also add root nodes for namespaces on any server configured using the InterSystems Server Manager extension. To do so, click on the plus (`+`) button at the top of the view.
33+
34+
The following sections will describe how to use the Projects Explorer and other tools to work with projects.
35+
36+
{: #creating}
37+
## Creating Projects
38+
39+
There are two ways to create projects in VS Code:
40+
41+
* Right-click on a server-namespace node in the Projects Explorer and select the `Create Project` menu option.
42+
* Open the command palette and run the `ObjectScript: Create Project` command.
43+
44+
Project names are required to be unique per server-namespace and may optionally have a description. The description is shown when hovering over the project's node in the Projects Explorer or below its name when selecting one in a dropdown menu.
45+
46+
{: #modifying}
47+
## Modifying Projects
48+
49+
There are three ways to add or remove items from a project:
50+
51+
* Using the Projects Explorer:
52+
* To add items, right-click on the project node or one of the document type nodes (i.e. `Classes` or `Routines`) and select the `Add Items to Project...` menu option. If you clicked on a document type node, you will only be shown documents of that type to add.
53+
* To remove an item, right-click on its node and select the `Remove from Project` menu option. If you remove a package or directory node, all of its children will also be removed from the project. You may also right-click on the project node and select the `Remove Items from Project...` menu option to be presented with a multi-select dropdown that allows you to remove multiple items at once.
54+
* Within a workspace folder configured to view or edit documents in a project directly on the server:
55+
* To add items, right-click a root `isfs(-readonly)` folder that has the `project` query parameter in its URI and select the `Add Items to Project...` menu option.
56+
* To remove an item, right-click on its node and select the `Remove from Project` menu option. If you remove a package or directory node, all of its children will also be removed from the project. You may also right-click on a root `isfs(-readonly)` folder that has the `project` query parameter in its URI and select the `Remove Items from Project...` menu option to be presented with a multi-select dropdown that allows you to remove multiple items at once.
57+
* Using commands:
58+
59+
Open the command palette and select the `ObjectScript: Add Items to Project...` or `ObjectScript: Remove Items from Project...` command.
60+
61+
### Add to Project UI
62+
63+
The `Add to Project` command implements a custom multi-select dropdown that is shown regardless of how it is invoked. Items that are in the namespace and not already in the project are shown. The elements of this UI are described in more detail below:
64+
65+
![Add to Project UI](../assets/images/add-to-project.png "add to project UI")
66+
67+
* Title bar row:
68+
* Click the icons to show or hide system and generated items, respectively.
69+
* Input box row:
70+
* Click the check box to select all items that are currently shown.
71+
* Type in the input box to filter the items that are shown.
72+
* Click the **OK** button to add the selected items to the project.
73+
* Item rows:
74+
* Click the check box to select the item. If the item is a package or CSP directory, all of its contents will be selected as well, even though the check boxes for those items don't appear selected.
75+
* The icon preceding the name represents its type. It corresponds to the icons in the Projects Explorer and [ObjectScript Explorer](../extensionui/#objectscript-view).
76+
* The more prominent text is the short name of the item, as it would appear in a file system.
77+
* The less prominent text is the full name of the item, including its package or CSP directory.
78+
* Click the arrow icon at the far right of the row to show or hide its contents.
79+
80+
{: #deleting}
81+
## Deleting Projects
82+
83+
There are two ways to delete projects in VS Code:
84+
85+
* Right-click on a project node in the Projects Explorer and select the `Delete Project` menu option.
86+
* Open the command palette and run the `ObjectScript: Delete Project` command.
87+
88+
{: #server-side}
89+
## Editing Project Contents Server-Side
90+
91+
There are a few methods to create a workspace folder to view or edit documents in a project directly on the server:
92+
93+
* Follow the steps [here](../serverside/#config-server-side) and select the project.
94+
* Right-click in the [Explorer view](../extensionui/#explorer-view) and select the `Add Server Namespace to Workspace` menu option.
95+
* Use the InterSystems Tools view, as described [here](../extensionui/#viewing-and-editing-source-code-on-the-server).
96+
* Right-click on a project node in the [Projects Explorer](../projects/#explorer) and select the `Add Workspace Folder For Project` menu option.
97+
* Add a folder to your `.code-workspace` file directly:
98+
```json
99+
{
100+
"uri": "isfs://myserver:user/?project=prjname",
101+
"name": "prjname"
102+
}
103+
```
104+
105+
{: #client-side}
106+
## Editing Project Contents Client-Side
107+
108+
The entire contents of the project can be easily exported to your local file system for client-side editing. To do so, simply right-click on the project you'd like to export and select the `Export Project Contents` menu option.
109+
110+
## Notes
111+
112+
If you are getting `ERROR #5540: SQLCODE: -99 Message: User abc is not privileged for the operation` when you try to expand the Projects Explorer or view a project's contents in a virtual folder, then grant user abc (or a SQL role they hold) the following SQL permissions:
113+
114+
```SQL
115+
GRANT SELECT, INSERT, UPDATE, DELETE ON %Studio.Project, %Studio.ProjectItem TO abc
116+
GRANT EXECUTE ON %Studio.Project_ProjectItemsList TO abc
117+
```

0 commit comments

Comments
 (0)