@@ -23,14 +23,14 @@ export const outputChannel = vscode.window.createOutputChannel("ObjectScript", o
2323
2424/**
2525 * A map of all CSP web apps in a server-namespace.
26- * The key is either `serverName:ns`, or ` host:port/pathPrefix:ns `, lowercase.
26+ * The key is ` host:port/pathPrefix[ns] `, lowercase.
2727 * The value is an array of CSP apps as returned by GET %25SYS/cspapps.
2828 */
2929export const cspApps : Map < string , string [ ] > = new Map ( ) ;
3030
3131/**
3232 * A map of all Studio Abstract Document extensions in a server-namespace.
33- * The key is either `serverName:ns`, or ` host:port/pathPrefix:ns `, lowercase.
33+ * The key is ` host:port/pathPrefix[ns] `, lowercase.
3434 * The value is lowercase array of file extensions, without the dot.
3535 */
3636export const otherDocExts : Map < string , string [ ] > = new Map ( ) ;
@@ -146,15 +146,17 @@ export function cspAppsForUri(uri: vscode.Uri): string[] {
146146
147147/** Get a list of all CSP web apps in the server-namespace that `api` is connected to. */
148148export function cspAppsForApi ( api : AtelierAPI ) : string [ ] {
149- return cspApps . get ( `${ api . serverId } :${ api . config . ns } ` . toLowerCase ( ) ) ?? [ ] ;
149+ const { host, port, pathPrefix, ns } = api . config ;
150+ return cspApps . get ( `${ host } :${ port } ${ pathPrefix } [${ ns } ]` . toLowerCase ( ) ) ?? [ ] ;
150151}
151152
152153/**
153154 * Get a list of Studio Abstract Document extensions in the server-namespace that `uri` is connected to.
154155 */
155156function otherDocExtsForUri ( uri : vscode . Uri ) : string [ ] {
156157 const api = new AtelierAPI ( uri ) ;
157- return otherDocExts . get ( `${ api . serverId } :${ api . config . ns } ` . toLowerCase ( ) ) ?? [ ] ;
158+ const { host, port, pathPrefix, ns } = api . config ;
159+ return otherDocExts . get ( `${ host } :${ port } ${ pathPrefix } [${ ns } ]` . toLowerCase ( ) ) ?? [ ] ;
158160}
159161
160162/** Determine the server name of a non-`isfs` non-ObjectScript file (any file that's not CLS,MAC,INT,INC). */
@@ -642,7 +644,8 @@ export async function addWsServerRootFolderData(wsFolders: readonly vscode.Works
642644 if ( value . redirectDotvscode ) {
643645 // We must redirect .vscode Uris for this folder, so see
644646 // if the web app to do so is configured on the server
645- const key = `${ api . serverId } :%SYS` . toLowerCase ( ) ;
647+ const { host, port, pathPrefix, ns } = api . config ;
648+ const key = `${ host } :${ port } ${ pathPrefix } [${ ns } ]` . toLowerCase ( ) ;
646649 let webApps = cspApps . get ( key ) ;
647650 if ( ! webApps ) {
648651 webApps = await api
0 commit comments