@@ -14,6 +14,7 @@ interface InternalDbModelingState {
1414 modeledMethods : Record < string , ModeledMethod [ ] > ;
1515 modifiedMethodSignatures : Set < string > ;
1616 inProgressMethods : Set < string > ;
17+ processedByAutoModelMethods : Set < string > ;
1718 selectedMethod : Method | undefined ;
1819 selectedUsage : Usage | undefined ;
1920}
@@ -26,6 +27,7 @@ interface DbModelingState {
2627 readonly modeledMethods : Readonly < Record < string , readonly ModeledMethod [ ] > > ;
2728 readonly modifiedMethodSignatures : ReadonlySet < string > ;
2829 readonly inProgressMethods : ReadonlySet < string > ;
30+ readonly processedByAutoModelMethods : ReadonlySet < string > ;
2931 readonly selectedMethod : Method | undefined ;
3032 readonly selectedUsage : Usage | undefined ;
3133}
@@ -37,6 +39,7 @@ interface SelectedMethodDetails {
3739 readonly modeledMethods : readonly ModeledMethod [ ] ;
3840 readonly isModified : boolean ;
3941 readonly isInProgress : boolean ;
42+ readonly processedByAutoModel : boolean ;
4043}
4144
4245export class ModelingStore extends DisposableObject {
@@ -59,6 +62,7 @@ export class ModelingStore extends DisposableObject {
5962 mode,
6063 modeledMethods : { } ,
6164 modifiedMethodSignatures : new Set ( ) ,
65+ processedByAutoModelMethods : new Set ( ) ,
6266 selectedMethod : undefined ,
6367 selectedUsage : undefined ,
6468 inProgressMethods : new Set ( ) ,
@@ -301,13 +305,17 @@ export class ModelingStore extends DisposableObject {
301305 const modeledMethods = dbState . modeledMethods [ method . signature ] ?? [ ] ;
302306 const isModified = dbState . modifiedMethodSignatures . has ( method . signature ) ;
303307 const isInProgress = dbState . inProgressMethods . has ( method . signature ) ;
308+ const processedByAutoModel = dbState . processedByAutoModelMethods . has (
309+ method . signature ,
310+ ) ;
304311 this . modelingEvents . fireSelectedMethodChangedEvent (
305312 dbItem ,
306313 method ,
307314 usage ,
308315 modeledMethods ,
309316 isModified ,
310317 isInProgress ,
318+ processedByAutoModel ,
311319 ) ;
312320 }
313321
@@ -336,6 +344,18 @@ export class ModelingStore extends DisposableObject {
336344 } ) ;
337345 }
338346
347+ public addProcessedByAutoModelMethods (
348+ dbItem : DatabaseItem ,
349+ processedByAutoModelMethods : string [ ] ,
350+ ) {
351+ this . changeProcessedByAutoModelMethods ( dbItem , ( state ) => {
352+ state . processedByAutoModelMethods = new Set ( [
353+ ...state . processedByAutoModelMethods ,
354+ ...processedByAutoModelMethods ,
355+ ] ) ;
356+ } ) ;
357+ }
358+
339359 public getSelectedMethodDetails ( ) : SelectedMethodDetails | undefined {
340360 const dbState = this . getInternalStateForActiveDb ( ) ;
341361 if ( ! dbState ) {
@@ -356,6 +376,9 @@ export class ModelingStore extends DisposableObject {
356376 selectedMethod . signature ,
357377 ) ,
358378 isInProgress : dbState . inProgressMethods . has ( selectedMethod . signature ) ,
379+ processedByAutoModel : dbState . processedByAutoModelMethods . has (
380+ selectedMethod . signature ,
381+ ) ,
359382 } ;
360383 }
361384
@@ -412,4 +435,18 @@ export class ModelingStore extends DisposableObject {
412435 state . inProgressMethods ,
413436 ) ;
414437 }
438+
439+ private changeProcessedByAutoModelMethods (
440+ dbItem : DatabaseItem ,
441+ updateState : ( state : InternalDbModelingState ) => void ,
442+ ) {
443+ const state = this . getState ( dbItem ) ;
444+
445+ updateState ( state ) ;
446+
447+ this . modelingEvents . fireProcessedByAutoModelMethodsChangedEvent (
448+ dbItem . databaseUri . toString ( ) ,
449+ state . processedByAutoModelMethods ,
450+ ) ;
451+ }
415452}
0 commit comments