@@ -605,25 +605,39 @@ export async function addWsServerRootFolderData(wsFolders: readonly vscode.Works
605
605
if ( ! wsFolders ?. length ) return ;
606
606
return Promise . allSettled (
607
607
wsFolders . map ( async ( wsFolder ) => {
608
- if ( notIsfs ( wsFolder . uri ) ) return ;
609
608
const api = new AtelierAPI ( wsFolder . uri ) ;
610
609
if ( ! api . active ) return ;
611
610
const value : WSServerRootFolderData = {
612
611
redirectDotvscode : true ,
613
612
canRedirectDotvscode : true ,
614
613
} ;
615
- if ( isCSP ( wsFolder . uri ) && ! [ "" , "/" ] . includes ( wsFolder . uri . path ) ) {
616
- // A CSP-type root folder for a specific webapp that already has a
617
- // .vscode/settings.json file must not redirect .vscode/* references
618
- await api
619
- . headDoc ( `${ wsFolder . uri . path } ${ ! wsFolder . uri . path . endsWith ( "/" ) ? "/" : "" } .vscode/settings.json` )
620
- . then ( ( ) => {
621
- value . redirectDotvscode = false ;
622
- } )
623
- . catch ( ( ) => { } ) ;
614
+ let folderKey : string ;
615
+ if ( wsFolder . uri . scheme === "file" ) {
616
+ // Special case where folder is local and has an active server connection.
617
+ // Allow extensions such as InterSystems Testing Manager (intersystems-community.testingmanager)
618
+ // to access the corresponding server-side .vscode subtree using an ISFS uri.
619
+ folderKey = vscode . Uri . from ( {
620
+ scheme : "isfs" ,
621
+ authority : wsFolder . name ,
622
+ path : "/" ,
623
+ query : `ns=${ api . ns } ` ,
624
+ } ) . toString ( ) ;
625
+ } else {
626
+ if ( notIsfs ( wsFolder . uri ) ) return ;
627
+ folderKey = wsFolder . uri . toString ( ) ;
628
+ if ( isCSP ( wsFolder . uri ) && ! [ "" , "/" ] . includes ( wsFolder . uri . path ) ) {
629
+ // A CSP-type isfs root folder for a specific webapp that already has a
630
+ // .vscode/settings.json file must not redirect .vscode/* references
631
+ await api
632
+ . headDoc ( `${ wsFolder . uri . path } ${ ! wsFolder . uri . path . endsWith ( "/" ) ? "/" : "" } .vscode/settings.json` )
633
+ . then ( ( ) => {
634
+ value . redirectDotvscode = false ;
635
+ } )
636
+ . catch ( ( ) => { } ) ;
637
+ }
624
638
}
625
639
if ( value . redirectDotvscode ) {
626
- // We must redirect .vscode Uris for this folder, so see
640
+ // We must redirect .vscode isfs Uris for this folder, so see
627
641
// if the web app to do so is configured on the server
628
642
const key = `${ api . serverId } :%SYS` . toLowerCase ( ) ;
629
643
let webApps = cspApps . get ( key ) ;
@@ -636,7 +650,7 @@ export async function addWsServerRootFolderData(wsFolders: readonly vscode.Works
636
650
}
637
651
value . canRedirectDotvscode = webApps . includes ( "/_vscode" ) ;
638
652
}
639
- wsServerRootFolders . set ( wsFolder . uri . toString ( ) , value ) ;
653
+ wsServerRootFolders . set ( folderKey , value ) ;
640
654
} )
641
655
) ;
642
656
}
0 commit comments