Skip to content

Commit 5657b3d

Browse files
Merge pull request #994 from gjsjohnmurray/pre-sync-post-1.8.3
Sync prerelease branch with everything added to master since 1.8.2 released
2 parents 2018d24 + ad8097a commit 5657b3d

15 files changed

+311
-235
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v1
42+
uses: github/codeql-action/init@v2
4343
with:
4444
languages: ${{ matrix.language }}
4545
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +50,7 @@ jobs:
5050
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5151
# If this step fails, then you should remove it and run the build manually (see below)
5252
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v1
53+
uses: github/codeql-action/autobuild@v2
5454

5555
# ℹ️ Command-line programs to run using the OS shell.
5656
# 📚 https://git.io/JvXDl
@@ -64,4 +64,4 @@ jobs:
6464
# make release
6565

6666
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v1
67+
uses: github/codeql-action/analyze@v2

.github/workflows/main.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
release:
1717
types:
1818
- released
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.base_ref || github.run_id }}
22+
cancel-in-progress: false
23+
1924
jobs:
2025
build:
2126
timeout-minutes: 10
@@ -182,7 +187,7 @@ jobs:
182187
[ -n "${{ secrets.VSCE_TOKEN }}" ] && \
183188
npx vsce publish --packagePath ${{ steps.set-version.outputs.name }}.vsix -p ${{ secrets.VSCE_TOKEN }} || true
184189
- name: Publish to Open VSX Registry
185-
timeout-minutes: 15
190+
timeout-minutes: 5
186191
run: |
187192
[ -n "${{ secrets.OVSX_TOKEN }}" ] && \
188193
npx ovsx publish ${{ steps.set-version.outputs.name }}.vsix --pat ${{ secrets.OVSX_TOKEN }} || true

.vscodeignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
# Run 'vsce ls' to verify that the following lines exclude everything not needed in the VSIX.
2+
13
**
2-
!dist/
4+
!dist/*.js
5+
!dist/*.txt
36
!snippets/
47
!images/
58
!syntaxes/
69
!webview/
710
!CHANGELOG.md
811
!LICENSE
912
!README.md
10-
!*.json
13+
!package.json
14+
!package.nls.json
15+
!language-configuration.json
1116
!*.jsonc

docs/Configuration.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,21 @@ First, configure one or more servers. You can use the plus sign (`+`) at the top
137137

138138
Provide the following values when prompted:
139139

140-
- **Name of new server definition** - an arbitrary name to identify this server.
141-
- **Description (optional)** - a brief description of the server.
142-
- **Hostname or IP address of web server** - the host for this server.
143-
- **Port of web server** - the WebServer port number for this server.
144-
- **Username** - the username to use in logging in to this server.
145-
- **Confirm connection type** - the protocol used for connections, possible values are **http** and **https**.
140+
- **Name of new server definition** - An arbitrary name to identify this server.
141+
- **Description (optional)** - A brief description of the server.
142+
- **Hostname or IP address of web server** - The host of the InterSystems server, or a standalone web server that publishes the web services of your target InterSystems server via the InterSystems Web Gateway.
143+
- **Port of web server** - The WebServer port number for this server's private web server, or the port number of the standalone web server.
144+
- **Username** - The username to use when logging in to this server.
145+
- **Confirm connection type** - The protocol used for connections. Possible values are **http** and **https**.
146146

147-
Once you have entered these values, the server definition is stored in your user-level `settings.json` file, and the server appears at the top of the **Recent** folder in the InterSystems Tools view.
147+
Once you have entered these values the server definition is stored in your user-level `settings.json` file, and the server appears at the top of the **Recent** folder in the InterSystems Tools view.
148148

149149
If you want to store a password for this server definition, select **Store Password in Keychain** from the context menu for the server in the InterSystems Tools view. If you do not store a password, users are prompted for a password each time they connect to the server. To remove a password from the keychain, Select **Clear Password from Keychain** from the server context menu. For more information, see [Server Context Menu](../extensionui#server-context-menu).
150150

151151
You can create a configuration for a server that is not currently running.
152152

153+
If you are connecting via a standalone web server which bublishes services for more than one InterSystems server you will need to edit the server configuration in your `settings.json` file to add a `pathPrefix` property. See the next section.
154+
153155
## Editing a Server Configuration
154156

155157
If you need to modify a server configuration select **File > Preferences > Settings** (**Code > Preferences > Settings** on Mac) from the menu. Select the **User** settings level. Find **Extensions** in the list in the left pane of the editor window, click to open, then select **InterSystems Server Manager** from the list to find the **InterSystems Server Manager** area of the edit pane, as illustrated in the following screen shot:
@@ -180,23 +182,24 @@ The server configuration in *settings.json* looks similar to the following, with
180182
```
181183
The components of the server definition are as follows:
182184

183-
- **iris-1** - An arbitrary name to identify this server
184-
- **webServer** - The collection of properties that define the web server
185-
- **scheme** - The protocol used for connections
186-
- **host** - the host for this server
187-
- **port** - the WebServer port number for this server
188-
- **username** - the username to use in logging in to this server
189-
- **password** - password for the specified username. Entering the password in this file is acceptable only in limited situations with very low need for security.
185+
- **iris-1** - An arbitrary name to identify this server.
186+
- **webServer** - The collection of properties that define the web server through which you will connect. This can either be the InterSystems server's private web server or a standalone web server configured as an InterSystems Web Gateway.
187+
- **scheme** - The protocol used for connections (http or https).
188+
- **host** - The host of the web server.
189+
- **port** - The port number for this web server.
190+
- **pathPrefix** - Only required when connecting through a standalone web server that publishes the target server's web services under a subfolder.
191+
- **username** - The username to use in logging in to this server.
192+
- **password** - Password for the specified username. Entering the password as plaintext in this file is acceptable only in limited situations with very low need for security.
190193

191-
If you do not store the password securely in the system Keychain or add it to the server definition, anyone using the server needs to supply the password. The InterSystems Server Manager provides the following commands for managing stored passwords in the Command Palette:
194+
If you do not store the password securely in your workstation keychain or add it to the server definition, anyone using the server needs to supply the password. The InterSystems Server Manager provides the following commands for managing stored passwords in the Command Palette:
192195

193-
- **InterSystems Server Manager: Clear Password from Keychain** - remove the password for a selected server
194-
- **InterSystems Server Manager: Store Password in Keychain** - select a server or create a new one and enter a password
196+
- **InterSystems Server Manager: Clear Password from Keychain** - Remove the password for a selected server.
197+
- **InterSystems Server Manager: Store Password in Keychain** - Select a server or create a new one, then enter a password.
195198

196199
{: #config-server-conn}
197200
## Configuring a Server Connection
198201

199-
Open the folder where you want client-side files to be located. Select the **ObjectScript Explorer** button on the Activity Bar. Select the **Choose Server and Namespace** button. This action opens a dialog that lets you select a server, or create a new one. Once you have selected a server and namespace, connection configuration is complete. VS Code adds the server and namespace to the status bar, as shown in the following screen shot.
202+
Open the folder where you want client-side files to be located. Select the **ObjectScript Explorer** button on the Activity Bar. Select the **Choose Server and Namespace** button. This action opens a dialog that lets you select a server or create a new one. Once you have selected a server and namespace, connection configuration is complete. VS Code adds the server and namespace to the status bar, as shown in the following screen shot.
200203

201204
![Connection information in the status bar.](../assets/images/action-for-server-start.png "connection information in the status bar")
202205

@@ -218,9 +221,9 @@ The connection configuration looks like this:
218221

219222
The components of this configuration are:
220223

221-
- **ns** - namespace to use on the server
222-
- **server** - server name as specified in the server configuration
223-
- **active** - specifies whether the connection is active.
224+
- **ns** - Namespace to use on the server
225+
- **server** - Server name as specified in the server configuration
226+
- **active** - Specifies whether the connection is active.
224227

225228
{: #server-actions-menu}
226229
## Add Custom Entries to the Server Actions Menu

docs/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GEM
1414
execjs
1515
coffee-script-source (1.11.1)
1616
colorator (1.1.0)
17-
commonmarker (0.23.4)
17+
commonmarker (0.23.6)
1818
concurrent-ruby (1.1.10)
1919
dnsruby (1.61.9)
2020
simpleidn (~> 0.1)

docs/RunDebug.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,13 @@ When starting **objectscript launch** debug session, make sure that the file con
113113
This extension uses WebSockets to communicate with the InterSystems server during debugging. If you are experiencing issues when trying to start a debugging session, check that the InterSystems server's web server allows WebSocket connections.
114114

115115
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.
116+
117+
## Troubleshooting Debugger Issues
118+
119+
If you are experiencing issues using the debugger, please follow these steps before opening an issue on GitHub:
120+
121+
1. Open a terminal on your server and `zn` to the namespace containing the class or routine you are debugging.
122+
2. Run the command `Kill ^IRIS.Temp.Atelier("debug")`, then `Set ^IRIS.Temp.Atelier("debug") = 1` to turn on the Atelier API debug logging feature. If you are on Caché or Ensemble, the global is `^CacheTemp.ISC.Atelier("debug")`.
123+
3. In VS Code, start a debugging session using the configuration that produces the error.
124+
4. Once the error appears, copy the contents of the `^IRIS.Temp.Atelier("debug")` global and add it to your GitHub issue.
125+
5. After you capture the log, run the command `Kill ^IRIS.Temp.Atelier("debug")`, then `Set ^IRIS.Temp.Atelier("debug") = 0` to turn logging back off again.

docs/SettingsReference.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The extensions in the InterSystems ObjectScript Extension Pack provide many sett
5757
| `"objectscript.export.dontExportIfNoChanges"` | Do not rewrite the local file if the content is identical to what came from the server. | `boolean` | `false` | |
5858
| `"objectscript.export.exactFilter"` | SQL filter to limit what to export. | `string` | `""` | The filter is applied to document names using the [LIKE predicate](https://irisdocs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_like) (i.e. `Name LIKE 'exactFilter'`). If provided, `objectscript.export.filter` is ignored. |
5959
| `"objectscript.export.filter"` | SQL filter to limit what to export. | `string` | `""` | The filter is applied to document names using the [LIKE predicate](https://irisdocs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_like) (i.e. `Name LIKE '%filter%'`). |
60-
| `"objectscript.export.folder"` | Folder for exported source code within workspace. | `string` | `"src"` | |
60+
| `"objectscript.export.folder"` | Folder for exported source code within workspace. | `string` | `"src"` | This setting is relative to the workspace folder root. |
6161
| `"objectscript.export.generated"` | Export generated source code files, such as INTs generated from classes. | `boolean` | `false` | |
6262
| `"objectscript.export.map"` | Map file names before export, with regexp pattern as a key and replacement as a value. | `object` | `{}` | For example, `{ \"%(.*)\": \"_$1\" }` to make % classes or routines use underscore prefix instead. |
6363
| `"objectscript.export.mapped"` | Export source code files mapped from a non-default database. | `boolean` | `true` | |
@@ -66,6 +66,7 @@ The extensions in the InterSystems ObjectScript Extension Pack provide many sett
6666
| `"objectscript.format.commandCase"` | Case for commands. | `"upper"`, `"lower"` or `"word"` | `"word"` | Has no effect if the `InterSystems Language Server` extension is installed and enabled. |
6767
| `"objectscript.format.functionCase"` | Case for system functions and system variables. | `"upper"`, `"lower"` or `"word"` | `"word"` | Has no effect if the `InterSystems Language Server` extension is installed and enabled. |
6868
| `"objectscript.ignoreInstallServerManager"` | Do not offer to install the [intersystems-community.servermanager](https://marketplace.visualstudio.com/items?itemName=intersystems-community.servermanager) extension. | `boolean` | `false` | |
69+
| `"objectscript.importOnSave"` | Automatically save a client-side InterSystems file on the server when saved in the editor. | `boolean` | `true` | |
6970
| `"objectscript.multilineMethodArgs"` | List method arguments on multiple lines, if the server supports it. | `boolean` | `false` | Only supported on IRIS 2019.1.2, 2020.1.1+, 2021.1.0+ and subsequent versions! On all other versions, this setting will have no effect. |
7071
| `"objectscript.openClassContracted"` | Automatically collapse all class member folding ranges when a class is opened for the first time. | `boolean` | `false` | |
7172
| `"objectscript.overwriteServerChanges"` | Overwrite a changed server version without confirmation when importing the local file. | `boolean` | `false` | |

images/installation.gif

-576 KB
Binary file not shown.

package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@
11041104
},
11051105
"properties": {
11061106
"folder": {
1107-
"description": "Folder for exported source code within workspace.",
1107+
"description": "Folder for exported source code within workspace. This setting is relative to the workspace folder root.",
11081108
"type": "string"
11091109
},
11101110
"addCategory": {
@@ -1247,7 +1247,12 @@
12471247
"objectscript.debug.debugThisMethod": {
12481248
"type": "boolean",
12491249
"default": true,
1250-
"markdownDescription": "Show inline `Debug this method` CodeLens action for ClassMethods."
1250+
"markdownDescription": "Show inline `Debug Method` CodeLens action for ClassMethods and Routine Labels."
1251+
},
1252+
"objectscript.debug.copyToClipboard": {
1253+
"type": "boolean",
1254+
"default": true,
1255+
"markdownDescription": "Show inline `Copy Invocation` CodeLens action for ClassMethods and Routine Labels."
12511256
},
12521257
"objectscript.studioActionDebugOutput": {
12531258
"type": "boolean",
@@ -1293,6 +1298,11 @@
12931298
"type": "string",
12941299
"pattern": "^[^.]+$"
12951300
}
1301+
},
1302+
"objectscript.importOnSave": {
1303+
"description": "Automatically save a client-side InterSystems file on the server when saved in the editor.",
1304+
"type": "boolean",
1305+
"default": true
12961306
}
12971307
}
12981308
},

src/commands/compile.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import fs = require("fs");
21
import glob = require("glob");
32
import path = require("path");
43
import vscode = require("vscode");
@@ -55,14 +54,14 @@ export async function checkChangedOnServer(file: CurrentFile, force = false): Pr
5554
(await api
5655
.getDoc(file.name)
5756
.then((data) => data.result)
58-
.then(({ ts, content }) => {
57+
.then(async ({ ts, content }) => {
5958
const fileContent = file.content.split(/\r?\n/);
6059
const serverTime = Number(new Date(ts + "Z"));
6160
const sameContent = force
6261
? false
6362
: content.every((line, index) => line.trim() == (fileContent[index] || "").trim());
6463
const mtime =
65-
force || sameContent ? serverTime : Math.max(Number(fs.statSync(file.fileName).mtime), serverTime);
64+
force || sameContent ? serverTime : Math.max((await vscode.workspace.fs.stat(file.uri)).mtime, serverTime);
6665
return mtime;
6766
})
6867
.catch(() => -1));
@@ -197,12 +196,12 @@ export async function loadChanges(files: CurrentFile[]): Promise<any> {
197196
files.map((file) =>
198197
api
199198
.getDoc(file.name)
200-
.then((data) => {
199+
.then(async (data) => {
201200
const content = (data.result.content || []).join(file.eol === vscode.EndOfLine.LF ? "\n" : "\r\n");
202201
const mtime = Number(new Date(data.result.ts + "Z"));
203202
workspaceState.update(`${file.uniqueId}:mtime`, mtime > 0 ? mtime : undefined);
204203
if (file.uri.scheme === "file") {
205-
fs.writeFileSync(file.fileName, content);
204+
await vscode.workspace.fs.writeFile(file.uri, new TextEncoder().encode(content));
206205
} else if (file.uri.scheme === FILESYSTEM_SCHEMA || file.uri.scheme === FILESYSTEM_READONLY_SCHEMA) {
207206
fileSystemProvider.fireFileChanged(file.uri);
208207
}
@@ -398,12 +397,13 @@ export async function namespaceCompile(askFlags = false): Promise<any> {
398397
);
399398
}
400399

401-
function importFiles(files, noCompile = false) {
400+
function importFiles(files: string[], noCompile = false) {
402401
return Promise.all<CurrentFile>(
403402
files.map(
404-
throttleRequests((file) =>
405-
fs.promises
406-
.readFile(file, { encoding: "utf8" })
403+
throttleRequests((file: string) =>
404+
vscode.workspace.fs
405+
.readFile(vscode.Uri.file(file))
406+
.then((contentBytes) => new TextDecoder().decode(contentBytes))
407407
.then((content) => currentFileFromContent(file, content))
408408
.then((curFile) =>
409409
importFile(curFile).then((data) => {
@@ -418,7 +418,7 @@ function importFiles(files, noCompile = false) {
418418

419419
export async function importFolder(uri: vscode.Uri, noCompile = false): Promise<any> {
420420
const uripath = uri.fsPath;
421-
if (fs.lstatSync(uripath).isFile()) {
421+
if ((await vscode.workspace.fs.stat(uri)).type != vscode.FileType.Directory) {
422422
return importFiles([uripath], noCompile);
423423
}
424424
let globpattern = "*.{cls,inc,int,mac}";

0 commit comments

Comments
 (0)