Skip to content

Commit c1092b3

Browse files
committed
Disable ObjectScript Explorer for new isfs workspace
1 parent 17a5c83 commit c1092b3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/extension.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const schemas = [
1414
FILESYSTEM_SCHEMA,
1515
FILESYSTEM_READONLY_SCHEMA,
1616
];
17+
export const filesystemSchemas = [FILESYSTEM_SCHEMA, FILESYSTEM_READONLY_SCHEMA];
1718

1819
import * as url from "url";
1920
import WebSocket = require("ws");
@@ -429,6 +430,21 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
429430
checkConnection(true, uri);
430431
});
431432

433+
vscode.workspace.onDidChangeWorkspaceFolders(({ added, removed }) => {
434+
const folders = vscode.workspace.workspaceFolders;
435+
if (
436+
folders?.length === 1 &&
437+
added?.length === 1 &&
438+
removed?.length === 0 &&
439+
filesystemSchemas.includes(added[0].uri.scheme)
440+
) {
441+
// First folder has been added and is one of the isfs types, so hide the ObjectScript Explorer for this workspace
442+
vscode.workspace
443+
.getConfiguration("objectscript")
444+
.update("showExplorer", false, vscode.ConfigurationTarget.Workspace);
445+
}
446+
});
447+
432448
vscode.workspace.onDidChangeConfiguration(({ affectsConfiguration }) => {
433449
if (affectsConfiguration("objectscript.conn")) {
434450
checkConnection(true);

0 commit comments

Comments
 (0)