Skip to content

Commit 7d09217

Browse files
committed
Merge remote-tracking branch 'upstream/master' into pre-sync-1.4.3
2 parents 4b65a44 + d17ab90 commit 7d09217

File tree

8 files changed

+62
-11
lines changed

8 files changed

+62
-11
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ jobs:
182182
[ -n "${{ secrets.VSCE_TOKEN }}" ] && \
183183
npx vsce publish --packagePath ${{ steps.set-version.outputs.name }}.vsix -p ${{ secrets.VSCE_TOKEN }} || true
184184
- name: Publish to Open VSX Registry
185+
timeout-minutes: 15
185186
run: |
186187
[ -n "${{ secrets.OVSX_TOKEN }}" ] && \
187188
npx ovsx publish ${{ steps.set-version.outputs.name }}.vsix --pat ${{ secrets.OVSX_TOKEN }} || true

CHANGELOG.md

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

3+
## [1.5.2022022801] 28-Feb-2022 pre-release
4+
Add 1.4.3 changes
5+
36
## [1.5.2022022301] 23-Feb-2022 pre-release
47
Add 1.4.2 changes
58

@@ -14,6 +17,11 @@ Add 1.4.1 changes
1417

1518
## [1.5.2022011401] 14-Jan-2022 pre-release
1619
Add 1.4.0 changes.
20+
## [1.4.3] 28-Feb-2022
21+
- Enhancements
22+
- Add `objectscript.openClassContracted` setting (#876)
23+
- Fixes
24+
- Fix 1.4.2 regression that broke server-side editing from ObjectScript Explorer and reloading of open documents when reopening isfs workspaces (#879)
1725

1826
## [1.4.2] 23-Feb-2022
1927
- Enhancements

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ To unlock these features (optional):
6262

6363
1. Download and install a beta version from GitHub. This is necessary because Marketplace does not allow publication of extensions that use proposed APIs.
6464
- 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.4.2`, look for `1.4.3-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.4.3-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.
65+
- Locate the beta immediately above the release you installed from Marketplace. For instance, if you installed `1.4.3`, look for `1.4.4-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.4.4-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.
6767

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

docs/Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,17 @@ GEM
221221
rb-fsevent (~> 0.10, >= 0.10.3)
222222
rb-inotify (~> 0.9, >= 0.9.10)
223223
mercenary (0.3.6)
224-
mini_portile2 (2.6.1)
224+
mini_portile2 (2.8.0)
225225
minima (2.5.1)
226226
jekyll (>= 3.5, < 5.0)
227227
jekyll-feed (~> 0.9)
228228
jekyll-seo-tag (~> 2.1)
229229
minitest (5.14.4)
230230
multipart-post (2.1.1)
231-
nokogiri (1.12.5)
232-
mini_portile2 (~> 2.6.1)
231+
nokogiri (1.13.3)
232+
mini_portile2 (~> 2.8.0)
233233
racc (~> 1.4)
234-
nokogiri (1.12.5-x64-mingw32)
234+
nokogiri (1.13.3-x64-mingw32)
235235
racc (~> 1.4)
236236
octokit (4.21.0)
237237
faraday (>= 0.9)

docs/SettingsReference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ The extensions in the InterSystems ObjectScript Extension Pack provide many sett
5555
| `"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. |
5656
| `"objectscript.ignoreInstallServerManager"` | Do not offer to install the [intersystems-community.servermanager](https://marketplace.visualstudio.com/items?itemName=intersystems-community.servermanager) extension. | `boolean` | `false` | |
5757
| `"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. |
58+
| `"objectscript.openClassContracted"` | Automatically collapse all folding ranges when a class is opened for the first time. | `boolean` | `false` | |
5859
| `"objectscript.overwriteServerChanges"` | Overwrite a changed server version without confirmation when importing the local file. | `boolean` | `false` | |
5960
| `"objectscript.serverSideEditing"` | Allow editing code directly on the server after opening it from ObjectScript Explorer. | `boolean` | `false` | |
6061
| `"objectscript.serverSourceControl.disableOtherActionTriggers"` | Prevent server-side source control 'other action' triggers from firing. | `boolean` | `false` | |

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,11 @@
10661066
"markdownDescription": "List method arguments on multiple lines, if the server supports it. **NOTE:** 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.",
10671067
"type": "boolean",
10681068
"default": false
1069+
},
1070+
"objectscript.openClassContracted": {
1071+
"description": "Automatically collapse all folding ranges when a class is opened for the first time.",
1072+
"type": "boolean",
1073+
"default": false
10691074
}
10701075
}
10711076
},

src/extension.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@ function languageServer(install = true): vscode.Extension<any> {
467467
return extension;
468468
}
469469

470+
// The URIs of all classes that have been opened. Used when objectscript.openClassContracted is true.
471+
let openedClasses: string[];
472+
470473
export async function activate(context: vscode.ExtensionContext): Promise<any> {
471474
if (!packageJson.version.includes("SNAPSHOT")) {
472475
try {
@@ -756,6 +759,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
756759
}
757760
}
758761

762+
openedClasses = workspaceState.get("openedClasses") ?? [];
763+
759764
context.subscriptions.push(
760765
reporter,
761766
panel,
@@ -986,6 +991,25 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
986991
})
987992
)
988993
),
994+
vscode.window.onDidChangeActiveTextEditor((editor: vscode.TextEditor) => {
995+
const uri: string = editor.document.uri.toString();
996+
if (
997+
config("openClassContracted") &&
998+
editor &&
999+
editor.document.languageId === "objectscript-class" &&
1000+
!openedClasses.includes(uri)
1001+
) {
1002+
vscode.commands.executeCommand("editor.foldAll");
1003+
openedClasses.push(uri);
1004+
}
1005+
}),
1006+
vscode.workspace.onDidCloseTextDocument((doc: vscode.TextDocument) => {
1007+
const uri: string = doc.uri.toString();
1008+
const idx: number = openedClasses.indexOf(uri);
1009+
if (idx > -1) {
1010+
openedClasses.splice(idx, 1);
1011+
}
1012+
}),
9891013

9901014
/* Anything we use from the VS Code proposed API */
9911015
...proposed
@@ -1059,6 +1083,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
10591083
}
10601084

10611085
export function deactivate(): void {
1086+
if (workspaceState) {
1087+
workspaceState.update("openedClasses", openedClasses);
1088+
}
10621089
// This will ensure all pending events get flushed
10631090
reporter && reporter.dispose();
10641091
if (terminals) {

src/providers/FileSystemProvider/FileSystemProvider.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
183183
public async readFile(uri: vscode.Uri): Promise<Uint8Array> {
184184
// Use _lookup() instead of _lookupAsFile() so we send
185185
// our cached mtime with the GET /doc request if we have it
186-
return this._lookup(uri).then((file: File) => {
186+
return this._lookup(uri, true).then((file: File) => {
187187
// Update cache entry
188188
const uniqueId = `${workspaceFolderOfUri(uri)}:${file.fileName}`;
189189
workspaceState.update(`${uniqueId}:mtime`, file.mtime);
@@ -336,7 +336,7 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
336336
}
337337

338338
// Fetch entry (a file or directory) from cache, else from server
339-
private async _lookup(uri: vscode.Uri): Promise<Entry> {
339+
private async _lookup(uri: vscode.Uri, fillInPath?: boolean): Promise<Entry> {
340340
const api = new AtelierAPI(uri);
341341
if (uri.path === "/") {
342342
await api
@@ -363,9 +363,18 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
363363
if (entry instanceof Directory) {
364364
child = entry.entries.get(part);
365365
// If the last element of path is dotted and is one we haven't already cached as a directory
366-
// then it is assumed to be a file.
366+
// then it is assumed to be a file. Treat all other cases as a directory we haven't yet explored.
367367
if (!child && (!part.includes(".") || i + 1 < parts.length)) {
368-
throw vscode.FileSystemError.FileNotFound(uri);
368+
if (!fillInPath) {
369+
throw vscode.FileSystemError.FileNotFound(uri);
370+
}
371+
// Caller granted us permission to create structures for intermediate directories not yet seen.
372+
// This arises when ObjectScript Explorer uses isfs to enable server-side editing, and when reloading a workspace
373+
// in which isfs documents were previously open.
374+
// See https://github.com/intersystems-community/vscode-objectscript/issues/879
375+
const fullName = entry.name === "" ? part : entry.fullName + "/" + part;
376+
child = new Directory(part, fullName);
377+
entry.entries.set(part, child);
369378
}
370379
}
371380
if (!child) {
@@ -389,7 +398,7 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
389398
if (uri.path.startsWith("/node_modules")) {
390399
throw vscode.FileSystemError.FileNotADirectory(uri);
391400
}
392-
const entry = await this._lookup(uri);
401+
const entry = await this._lookup(uri, true);
393402
if (entry instanceof Directory) {
394403
return entry;
395404
}

0 commit comments

Comments
 (0)