File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export class NativeScriptDebugLauncher extends EventEmitter {
19
19
public async processRequest ( args : any ) : Promise < any > {
20
20
args = this . translateArgs ( args ) ;
21
21
Services . appRoot = args . appRoot ;
22
+ Services . extensionClient ( ) . cleanBeforeDebug ( ) ;
22
23
const settings = await Services . extensionClient ( ) . getInitSettings ( ) ;
23
24
24
25
Services . cliPath = settings . tnsPath || Services . cliPath ;
Original file line number Diff line number Diff line change @@ -55,6 +55,10 @@ export class ExtensionClient {
55
55
return < Promise < extProtocol . InitSettingsResult > > ( this . callRemoteMethod ( 'getInitSettings' ) ) ;
56
56
}
57
57
58
+ public cleanBeforeDebug ( ) : Promise < any > {
59
+ return this . callRemoteMethod ( 'cleanBeforeDebug' ) ;
60
+ }
61
+
58
62
public analyticsLaunchDebugger ( args : extProtocol . AnalyticsLaunchDebuggerArgs ) : Promise < any > {
59
63
return this . callRemoteMethod ( 'analyticsLaunchDebugger' , args ) ;
60
64
}
Original file line number Diff line number Diff line change @@ -5,11 +5,13 @@ import {QuickPickItem} from 'vscode';
5
5
import * as extProtocol from './extensionProtocol' ;
6
6
import { Services } from '../services/extensionHostServices' ;
7
7
import { getSocketId } from "./sockedId" ;
8
+ import { Disposable } from "vscode" ;
8
9
9
10
let ipc = require ( 'node-ipc' ) ;
10
11
11
12
export class ExtensionServer {
12
13
private _isRunning : boolean ;
14
+ private disposablesBeforeDebug : Disposable [ ] = new Array < Disposable > ( ) ;
13
15
14
16
constructor ( ) {
15
17
this . _isRunning = false ;
@@ -40,6 +42,14 @@ export class ExtensionServer {
40
42
}
41
43
}
42
44
45
+ public registerForCleanBeforeDebug ( ...disposables : Disposable [ ] ) {
46
+ this . disposablesBeforeDebug . push ( ...disposables )
47
+ }
48
+
49
+ public cleanBeforeDebug ( ) {
50
+ this . disposablesBeforeDebug . forEach ( disposable => disposable . dispose ( ) ) ;
51
+ }
52
+
43
53
public isRunning ( ) {
44
54
return this . _isRunning ;
45
55
}
Original file line number Diff line number Diff line change @@ -55,9 +55,13 @@ export function activate(context: vscode.ExtensionContext) {
55
55
runChannel . hide ( ) ;
56
56
} ) ;
57
57
58
- context . subscriptions . push ( {
58
+ const disposable = {
59
59
dispose : ( ) => utils . killProcess ( tnsProcess )
60
- } ) ;
60
+ } ;
61
+
62
+ context . subscriptions . push ( disposable ) ;
63
+
64
+ Services . extensionServer ( ) . registerForCleanBeforeDebug ( disposable ) ;
61
65
} ;
62
66
63
67
let runIosCommand = vscode . commands . registerCommand ( 'nativescript.runIos' , ( ) => {
You can’t perform that action at this time.
0 commit comments