@@ -820,6 +820,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
820
820
821
821
openedClasses = workspaceState . get ( "openedClasses" ) ?? [ ] ;
822
822
823
+ /** The stringified URIs of all `isfs` documents that are currently open in a UI tab */
824
+ const isfsTabs : string [ ] = [ ] ;
825
+
823
826
// Create this here so we can fire its event
824
827
const fileDecorationProvider = new FileDecorationProvider ( ) ;
825
828
@@ -1140,6 +1143,11 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
1140
1143
if ( idx > - 1 ) {
1141
1144
openedClasses . splice ( idx , 1 ) ;
1142
1145
}
1146
+ const isfsIdx = isfsTabs . indexOf ( uri ) ;
1147
+ if ( isfsIdx > - 1 ) {
1148
+ isfsTabs . splice ( isfsIdx , 1 ) ;
1149
+ fireOtherStudioAction ( OtherStudioAction . ClosedDocument , doc . uri ) ;
1150
+ }
1143
1151
} ) ,
1144
1152
vscode . commands . registerCommand ( "vscode-objectscript.addItemsToProject" , ( item ) => {
1145
1153
return modifyProject ( item instanceof NodeBase || item instanceof vscode . Uri ? item : undefined , "add" ) ;
@@ -1431,6 +1439,22 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
1431
1439
DocumentContentProvider . getUri ( doc , undefined , undefined , undefined , wsFolder . uri )
1432
1440
) ;
1433
1441
} ) ,
1442
+ vscode . window . tabGroups . onDidChangeTabs ( ( e ) => {
1443
+ const processUri = ( uri : vscode . Uri ) : void => {
1444
+ if ( uri . scheme == FILESYSTEM_SCHEMA ) {
1445
+ isfsTabs . push ( uri . toString ( ) ) ;
1446
+ fireOtherStudioAction ( OtherStudioAction . OpenedDocument , uri ) ;
1447
+ }
1448
+ } ;
1449
+ for ( const t of e . opened ) {
1450
+ if ( t . input instanceof vscode . TabInputText || t . input instanceof vscode . TabInputCustom ) {
1451
+ processUri ( t . input . uri ) ;
1452
+ } else if ( t . input instanceof vscode . TabInputTextDiff ) {
1453
+ processUri ( t . input . original ) ;
1454
+ processUri ( t . input . modified ) ;
1455
+ }
1456
+ }
1457
+ } ) ,
1434
1458
...setUpTestController ( ) ,
1435
1459
1436
1460
/* Anything we use from the VS Code proposed API */
0 commit comments