File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -122,25 +122,26 @@ export class VscodeProvider {
122
122
proc : cp . ChildProcess ,
123
123
fn : ( message : ipc . VscodeMessage ) => message is T ,
124
124
) : Promise < T > {
125
- return new Promise ( ( resolve , _reject ) => {
125
+ return new Promise ( ( resolve , reject ) => {
126
126
const cleanup = ( ) => {
127
- proc . off ( "error" , reject )
127
+ proc . off ( "error" , onError )
128
128
proc . off ( "exit" , onExit )
129
129
proc . off ( "message" , onMessage )
130
130
clearTimeout ( timeout )
131
131
}
132
132
133
133
const timeout = setTimeout ( ( ) => {
134
134
cleanup ( )
135
- _reject ( new Error ( "timed out" ) )
135
+ reject ( new Error ( "timed out" ) )
136
136
} , this . timeoutInterval )
137
137
138
- const reject = ( error : Error ) => {
138
+ const onError = ( error : Error ) => {
139
139
cleanup ( )
140
- _reject ( error )
140
+ reject ( error )
141
141
}
142
142
143
143
const onExit = ( code : number | null ) => {
144
+ cleanup ( )
144
145
reject ( new Error ( `VS Code exited unexpectedly with code ${ code } ` ) )
145
146
}
146
147
@@ -153,7 +154,7 @@ export class VscodeProvider {
153
154
}
154
155
155
156
proc . on ( "message" , onMessage )
156
- proc . on ( "error" , reject )
157
+ proc . on ( "error" , onError )
157
158
proc . on ( "exit" , onExit )
158
159
} )
159
160
}
You can’t perform that action at this time.
0 commit comments