Skip to content

Commit 66a5fa8

Browse files
committed
Update web application and abstract document caches when connection changes
1 parent 25e884d commit 66a5fa8

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/extension.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -769,22 +769,18 @@ async function updateWebAndAbstractDocsCaches(wsFolders: readonly vscode.Workspa
769769
return Promise.allSettled(
770770
connections.map(async (connection) => {
771771
if (!cspApps.has(connection.key)) {
772-
cspApps.set(
773-
connection.key,
774-
await connection.api
775-
.getCSPApps()
776-
.then((data) => data.result.content ?? [])
777-
.catch(() => [])
778-
);
772+
const apps = await connection.api
773+
.getCSPApps()
774+
.then((data) => data?.result?.content)
775+
.catch(() => undefined);
776+
if (apps) cspApps.set(connection.key, apps);
779777
}
780778
if (!otherDocExts.has(connection.key)) {
781-
otherDocExts.set(
782-
connection.key,
783-
await connection.api
784-
.actionQuery("SELECT Extention FROM %Library.RoutineMgr_DocumentTypes()", [])
785-
.then((data) => data.result?.content?.map((e) => e.Extention) ?? [])
786-
.catch(() => [])
787-
);
779+
const exts = await connection.api
780+
.actionQuery("SELECT Extention FROM %Library.RoutineMgr_DocumentTypes()", [])
781+
.then((data) => data.result?.content?.map((e) => e.Extention))
782+
.catch(() => undefined);
783+
if (exts) otherDocExts.set(connection.key, exts);
788784
}
789785
})
790786
);
@@ -1598,6 +1594,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
15981594
// This unavoidably switches to the File Explorer view, so only do it if isfs folders were found
15991595
vscode.commands.executeCommand("workbench.files.action.refreshFilesExplorer");
16001596
}
1597+
updateWebAndAbstractDocsCaches(vscode.workspace.workspaceFolders);
16011598
}
16021599
if (affectsConfiguration("objectscript.commentToken")) {
16031600
// Update the language configuration for "objectscript" and "objectscript-macros"

0 commit comments

Comments
 (0)