File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/model-editor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,9 +136,12 @@ export class ModelEditorModule extends DisposableObject {
136136 } ) ;
137137
138138 // Create new temporary directory for query files and pack dependencies
139- const queryDir = ( await dir ( { unsafeCleanup : true } ) ) . path ;
139+ const { path : queryDir , cleanup : cleanupQueryDir } = await dir ( {
140+ unsafeCleanup : true ,
141+ } ) ;
140142 const success = await setUpPack ( this . cliServer , queryDir , language ) ;
141143 if ( ! success ) {
144+ await cleanupQueryDir ( ) ;
142145 return ;
143146 }
144147
@@ -161,9 +164,20 @@ export class ModelEditorModule extends DisposableObject {
161164 this . methodsUsagePanel . setState . bind ( this . methodsUsagePanel ) ,
162165 this . showMethod . bind ( this ) ,
163166 this . handleViewBecameActive . bind ( this ) ,
164- this . handleViewWasDisposed . bind ( this ) ,
167+ ( view ) => {
168+ this . handleViewWasDisposed ( view ) ;
169+ void cleanupQueryDir ( ) ;
170+ } ,
165171 this . isMostRecentlyActiveView . bind ( this ) ,
166172 ) ;
173+
174+ this . push ( view ) ;
175+ this . push ( {
176+ dispose ( ) : void {
177+ void cleanupQueryDir ( ) ;
178+ } ,
179+ } ) ;
180+
167181 await view . openView ( ) ;
168182 } ,
169183 {
You can’t perform that action at this time.
0 commit comments