@@ -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
@@ -1180,6 +1183,11 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
1180
1183
if ( idx > - 1 ) {
1181
1184
openedClasses . splice ( idx , 1 ) ;
1182
1185
}
1186
+ const isfsIdx = isfsTabs . indexOf ( uri ) ;
1187
+ if ( isfsIdx > - 1 ) {
1188
+ isfsTabs . splice ( isfsIdx , 1 ) ;
1189
+ fireOtherStudioAction ( OtherStudioAction . ClosedDocument , doc . uri ) ;
1190
+ }
1183
1191
} ) ,
1184
1192
vscode . commands . registerCommand ( "vscode-objectscript.addItemsToProject" , ( item ) => {
1185
1193
return modifyProject ( item instanceof NodeBase || item instanceof vscode . Uri ? item : undefined , "add" ) ;
@@ -1476,6 +1484,22 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
1476
1484
DocumentContentProvider . getUri ( doc , undefined , undefined , undefined , wsFolder . uri )
1477
1485
) ;
1478
1486
} ) ,
1487
+ vscode . window . tabGroups . onDidChangeTabs ( ( e ) => {
1488
+ const processUri = ( uri : vscode . Uri ) : void => {
1489
+ if ( uri . scheme == FILESYSTEM_SCHEMA ) {
1490
+ isfsTabs . push ( uri . toString ( ) ) ;
1491
+ fireOtherStudioAction ( OtherStudioAction . OpenedDocument , uri ) ;
1492
+ }
1493
+ } ;
1494
+ for ( const t of e . opened ) {
1495
+ if ( t . input instanceof vscode . TabInputText || t . input instanceof vscode . TabInputCustom ) {
1496
+ processUri ( t . input . uri ) ;
1497
+ } else if ( t . input instanceof vscode . TabInputTextDiff ) {
1498
+ processUri ( t . input . original ) ;
1499
+ processUri ( t . input . modified ) ;
1500
+ }
1501
+ }
1502
+ } ) ,
1479
1503
...setUpTestController ( ) ,
1480
1504
1481
1505
/* Anything we use from the VS Code proposed API */
0 commit comments