@@ -20,13 +20,17 @@ import type {
2020 VariantAnalysisScannedRepositoryResult ,
2121 VariantAnalysisScannedRepositoryState ,
2222} from "../../variant-analysis/shared/variant-analysis" ;
23+ import type { AppEvent , AppEventEmitter } from "../../common/events" ;
2324
2425export class ModelAlertsView extends AbstractWebview <
2526 ToModelAlertsMessage ,
2627 FromModelAlertsMessage
2728> {
2829 public static readonly viewType = "codeQL.modelAlerts" ;
2930
31+ public readonly onEvaluationRunStopClicked : AppEvent < void > ;
32+ private readonly onEvaluationRunStopClickedEventEmitter : AppEventEmitter < void > ;
33+
3034 public constructor (
3135 app : App ,
3236 private readonly modelingEvents : ModelingEvents ,
@@ -37,6 +41,12 @@ export class ModelAlertsView extends AbstractWebview<
3741 super ( app ) ;
3842
3943 this . registerToModelingEvents ( ) ;
44+
45+ this . onEvaluationRunStopClickedEventEmitter = this . push (
46+ app . createEventEmitter < void > ( ) ,
47+ ) ;
48+ this . onEvaluationRunStopClicked =
49+ this . onEvaluationRunStopClickedEventEmitter . event ;
4050 }
4151
4252 public async showView ( ) {
@@ -81,6 +91,9 @@ export class ModelAlertsView extends AbstractWebview<
8191 case "openModelPack" :
8292 await this . app . commands . execute ( "revealInExplorer" , Uri . file ( msg . path ) ) ;
8393 break ;
94+ case "stopEvaluationRun" :
95+ await this . stopEvaluationRun ( ) ;
96+ break ;
8497 default :
8598 assertNever ( msg ) ;
8699 }
@@ -155,4 +168,8 @@ export class ModelAlertsView extends AbstractWebview<
155168 } ) ,
156169 ) ;
157170 }
171+
172+ private async stopEvaluationRun ( ) {
173+ this . onEvaluationRunStopClickedEventEmitter . fire ( ) ;
174+ }
158175}
0 commit comments