@@ -40,40 +40,83 @@ export interface EnvironmentWillCreateEvent {
40
40
/**
41
41
* Options used to create a Python environment.
42
42
*/
43
- options : CreateEnvironmentOptions | undefined ;
43
+ readonly options : CreateEnvironmentOptions | undefined ;
44
44
}
45
45
46
+ export type CreateEnvironmentResult =
47
+ | {
48
+ /**
49
+ * Workspace folder associated with the environment.
50
+ */
51
+ readonly workspaceFolder ?: WorkspaceFolder ;
52
+
53
+ /**
54
+ * Path to the executable python in the environment
55
+ */
56
+ readonly path : string ;
57
+
58
+ /**
59
+ * User action that resulted in exit from the create environment flow.
60
+ */
61
+ readonly action ?: CreateEnvironmentUserActions ;
62
+
63
+ /**
64
+ * Error if any occurred during environment creation.
65
+ */
66
+ readonly error ?: Error ;
67
+ }
68
+ | {
69
+ /**
70
+ * Workspace folder associated with the environment.
71
+ */
72
+ readonly workspaceFolder ?: WorkspaceFolder ;
73
+
74
+ /**
75
+ * Path to the executable python in the environment
76
+ */
77
+ readonly path ?: string ;
78
+
79
+ /**
80
+ * User action that resulted in exit from the create environment flow.
81
+ */
82
+ readonly action : CreateEnvironmentUserActions ;
83
+
84
+ /**
85
+ * Error if any occurred during environment creation.
86
+ */
87
+ readonly error ?: Error ;
88
+ }
89
+ | {
90
+ /**
91
+ * Workspace folder associated with the environment.
92
+ */
93
+ readonly workspaceFolder ?: WorkspaceFolder ;
94
+
95
+ /**
96
+ * Path to the executable python in the environment
97
+ */
98
+ readonly path ?: string ;
99
+
100
+ /**
101
+ * User action that resulted in exit from the create environment flow.
102
+ */
103
+ readonly action ?: CreateEnvironmentUserActions ;
104
+
105
+ /**
106
+ * Error if any occurred during environment creation.
107
+ */
108
+ readonly error : Error ;
109
+ } ;
110
+
46
111
/**
47
112
* Params passed on `onDidCreateEnvironment` event handler.
48
113
*/
49
- export interface EnvironmentDidCreateEvent extends CreateEnvironmentResult {
114
+ export type EnvironmentDidCreateEvent = CreateEnvironmentResult & {
50
115
/**
51
116
* Options used to create the Python environment.
52
117
*/
53
- options : CreateEnvironmentOptions | undefined ;
54
- }
55
-
56
- export interface CreateEnvironmentResult {
57
- /**
58
- * Workspace folder associated with the environment.
59
- */
60
- workspaceFolder : WorkspaceFolder | undefined ;
61
-
62
- /**
63
- * Path to the executable python in the environment
64
- */
65
- path : string | undefined ;
66
-
67
- /**
68
- * User action that resulted in exit from the create environment flow.
69
- */
70
- action : CreateEnvironmentUserActions | undefined ;
71
-
72
- /**
73
- * Error if any occurred during environment creation.
74
- */
75
- error : Error | undefined ;
76
- }
118
+ readonly options : CreateEnvironmentOptions | undefined ;
119
+ } ;
77
120
78
121
/**
79
122
* Extensions that want to contribute their own environment creation can do that by registering an object
@@ -120,14 +163,14 @@ export interface ProposedCreateEnvironmentAPI {
120
163
* provider (including internal providers). This will also receive any options passed in
121
164
* or defaults used to create environment.
122
165
*/
123
- onWillCreateEnvironment : Event < EnvironmentWillCreateEvent > ;
166
+ readonly onWillCreateEnvironment : Event < EnvironmentWillCreateEvent > ;
124
167
125
168
/**
126
169
* This API can be used to detect when the environment provider exits for any registered
127
170
* provider (including internal providers). This will also receive created environment path,
128
171
* any errors, or user actions taken from the provider.
129
172
*/
130
- onDidCreateEnvironment : Event < EnvironmentDidCreateEvent > ;
173
+ readonly onDidCreateEnvironment : Event < EnvironmentDidCreateEvent > ;
131
174
132
175
/**
133
176
* This API will show a QuickPick to select an environment provider from available list of
0 commit comments