File tree 4 files changed +19
-3
lines changed
4 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 27
27
"dependencies" : {
28
28
"node-ipc" : " 8.10.3" ,
29
29
"source-map" : " 0.6.1" ,
30
- "tree-kill" : " ^1.2.0" ,
31
30
"universal-analytics" : " 0.4.13" ,
32
31
"vscode-chrome-debug-core" : " ~3.9.0" ,
33
32
"vscode-debugadapter" : " 1.26.0" ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import * as fs from 'fs';
10
10
import * as url from 'url' ;
11
11
import * as path from 'path' ;
12
12
import { Version } from './version' ;
13
+ import { ChildProcess , exec } from 'child_process' ;
13
14
14
15
export const enum Platform {
15
16
Windows , OSX , Linux
@@ -380,4 +381,16 @@ export function getInstalledExtensionVersion(): Version {
380
381
381
382
export function getMinSupportedCliVersion ( ) : Version {
382
383
return Version . parse ( require ( '../../package.json' ) . minNativescriptCliVersion ) ;
384
+ }
385
+
386
+ export function killProcess ( childProcess : ChildProcess ) : void {
387
+ switch ( process . platform ) {
388
+ case "win32" :
389
+ exec ( `taskkill /pid ${ childProcess . pid } /T /F` ) ;
390
+ break ;
391
+
392
+ default :
393
+ childProcess . kill ( "SIGINT" ) ;
394
+ break ;
395
+ }
383
396
}
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import {formatConsoleMessage} from './consoleHelper';
16
16
import { Services } from '../services/debugAdapterServices' ;
17
17
import { LoggerHandler , Handlers , Tags } from '../common/logger' ;
18
18
import { DebugRequest } from './debugRequest' ;
19
- import * as kill from 'tree-kill' ;
20
19
21
20
interface IScopeVarHandle {
22
21
objectId : string ;
@@ -361,7 +360,7 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
361
360
public disconnect ( ) : Promise < void > {
362
361
this . clearEverything ( ) ;
363
362
if ( this . _tnsProcess ) {
364
- kill ( this . _tnsProcess . pid , 'SIGQUIT' )
363
+ utils . killProcess ( this . _tnsProcess ) ;
365
364
this . _tnsProcess = null ;
366
365
}
367
366
if ( this . _webKitConnection ) {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import {Services} from './services/extensionHostServices';
4
4
import { Project } from './project/project' ;
5
5
import { IosProject } from './project/iosProject' ;
6
6
import { AndroidProject } from './project/androidProject' ;
7
+ import * as utils from './common/utilities' ;
7
8
8
9
// this method is called when the extension is activated
9
10
export function activate ( context : vscode . ExtensionContext ) {
@@ -56,6 +57,10 @@ export function activate(context: vscode.ExtensionContext) {
56
57
tnsProcess . on ( 'close' , exitCode => {
57
58
runChannel . hide ( ) ;
58
59
} ) ;
60
+
61
+ context . subscriptions . push ( {
62
+ dispose : ( ) => utils . killProcess ( tnsProcess )
63
+ } ) ;
59
64
} ;
60
65
61
66
let runIosCommand = vscode . commands . registerCommand ( 'nativescript.runIos' , ( ) => {
You can’t perform that action at this time.
0 commit comments