3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
+ import { v4 as uuidv4 } from "uuid" ;
6
7
import * as vscode from 'vscode' ;
7
8
import * as hTypes from '../../../hostapi' ;
8
9
import * as types from '../../../index' ;
@@ -23,6 +24,7 @@ export class ExecuteActivity<TContext extends types.ExecuteActivityContext = typ
23
24
}
24
25
}
25
26
27
+ private _successItemId : string = uuidv4 ( ) ;
26
28
public successState ( ) : hTypes . ActivityTreeItemOptions {
27
29
const activityResult = this . context . activityResult ;
28
30
const resourceId : string | undefined = typeof activityResult === 'string' ? activityResult : activityResult ?. id ;
@@ -36,6 +38,7 @@ export class ExecuteActivity<TContext extends types.ExecuteActivityContext = typ
36
38
37
39
return [
38
40
new ActivityChildItem ( {
41
+ id : this . _successItemId ,
39
42
contextValue : 'executeResult' ,
40
43
label : vscode . l10n . t ( "Click to view resource" ) ,
41
44
activityType : ActivityChildType . Command ,
@@ -51,11 +54,13 @@ export class ExecuteActivity<TContext extends types.ExecuteActivityContext = typ
51
54
}
52
55
}
53
56
57
+ private _errorItemId : string = uuidv4 ( ) ;
54
58
public errorState ( error : types . IParsedError ) : hTypes . ActivityTreeItemOptions {
55
59
return {
56
60
label : this . label ,
57
61
getChildren : ( _parent : ResourceGroupsItem ) => {
58
62
const errorItemOptions : types . ActivityChildItemOptions = {
63
+ id : this . _errorItemId ,
59
64
label : error . message ,
60
65
contextValue : activityErrorContext ,
61
66
activityType : ActivityChildType . Error ,
0 commit comments