File tree Expand file tree Collapse file tree 4 files changed +17
-2
lines changed Expand file tree Collapse file tree 4 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,9 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
169169
170170 if ( cliCommand . tnsProcess ) {
171171 this . _tnsProcess = cliCommand . tnsProcess ;
172+ cliCommand . tnsOutputEventEmitter . on ( "tsCompilationError" , ( ) => {
173+ this . fireEvent ( new TerminatedEvent ( ) ) ;
174+ } ) ;
172175 cliCommand . tnsProcess . stdout . on ( 'data' , data => { Services . logger ( ) . log ( data . toString ( ) , Tags . FrontendMessage ) ; } ) ;
173176 cliCommand . tnsProcess . stderr . on ( 'data' , data => { Services . logger ( ) . error ( data . toString ( ) , Tags . FrontendMessage ) ; } ) ;
174177 cliCommand . tnsProcess . on ( 'close' , ( code , signal ) => {
Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ export class AndroidProject extends Project {
4040 return { tnsProcess : debugProcess , tnsOutputEventEmitter : tnsOutputEventEmitter } ;
4141 }
4242
43- private configureReadyEvent ( readableStream : stream . Readable , eventEmitter : EventEmitter , attach : boolean ) : void {
43+ protected configureReadyEvent ( readableStream : stream . Readable , eventEmitter : EventEmitter , attach ?: boolean ) : void {
44+ super . configureReadyEvent ( readableStream , eventEmitter ) ;
45+
4446 let debugPort = null ;
4547 new scanner . StringMatchingScanner ( readableStream ) . onEveryMatch ( new RegExp ( "device: .* debug port: [0-9]+" ) , ( match : scanner . MatchFound ) => {
4648 //device: {device-name} debug port: {debug-port}
Original file line number Diff line number Diff line change @@ -44,7 +44,9 @@ export class IosProject extends Project {
4444 return { tnsProcess : debugProcess , tnsOutputEventEmitter : tnsOutputEventEmitter } ;
4545 }
4646
47- private configureReadyEvent ( readableStream : stream . Readable , eventEmitter : EventEmitter ) : void {
47+ protected configureReadyEvent ( readableStream : stream . Readable , eventEmitter : EventEmitter ) : void {
48+ super . configureReadyEvent ( readableStream , eventEmitter ) ;
49+
4850 let socketPathPrefix = 'socket-file-location: ' ;
4951 let streamScanner = new scanner . StringMatchingScanner ( readableStream ) ;
5052 streamScanner . onEveryMatch ( new RegExp ( socketPathPrefix + '.*\.sock' ) , ( match : scanner . MatchFound ) => {
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import {ChildProcess} from 'child_process';
22import { EventEmitter } from 'events' ;
33import { Version } from '../common/version' ;
44import { NativeScriptCli } from './nativeScriptCli' ;
5+ import * as stream from 'stream' ;
6+ import * as scanner from './streamScanner' ;
57
68export type DebugResult = { tnsProcess : ChildProcess , tnsOutputEventEmitter : EventEmitter } ;
79
@@ -28,6 +30,12 @@ export abstract class Project {
2830
2931 public abstract debug ( options : { stopOnEntry : boolean , watch : boolean } , tnsArgs ?: string [ ] ) : DebugResult ;
3032
33+ protected configureReadyEvent ( readableStream : stream . Readable , eventEmitter : EventEmitter ) : void {
34+ new scanner . StringMatchingScanner ( readableStream ) . onEveryMatch ( "TypeScript compiler failed" , ( ) => {
35+ eventEmitter . emit ( 'tsCompilationError' ) ;
36+ } ) ;
37+ }
38+
3139 protected executeRunCommand ( args : string [ ] ) : ChildProcess {
3240 return this . cli . execute ( [ "run" , this . platformName ( ) ] . concat ( args ) , this . _appRoot ) ;
3341 }
You can’t perform that action at this time.
0 commit comments