File tree 4 files changed +17
-2
lines changed
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 {
169
169
170
170
if ( cliCommand . tnsProcess ) {
171
171
this . _tnsProcess = cliCommand . tnsProcess ;
172
+ cliCommand . tnsOutputEventEmitter . on ( "tsCompilationError" , ( ) => {
173
+ this . fireEvent ( new TerminatedEvent ( ) ) ;
174
+ } ) ;
172
175
cliCommand . tnsProcess . stdout . on ( 'data' , data => { Services . logger ( ) . log ( data . toString ( ) , Tags . FrontendMessage ) ; } ) ;
173
176
cliCommand . tnsProcess . stderr . on ( 'data' , data => { Services . logger ( ) . error ( data . toString ( ) , Tags . FrontendMessage ) ; } ) ;
174
177
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 {
40
40
return { tnsProcess : debugProcess , tnsOutputEventEmitter : tnsOutputEventEmitter } ;
41
41
}
42
42
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
+
44
46
let debugPort = null ;
45
47
new scanner . StringMatchingScanner ( readableStream ) . onEveryMatch ( new RegExp ( "device: .* debug port: [0-9]+" ) , ( match : scanner . MatchFound ) => {
46
48
//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 {
44
44
return { tnsProcess : debugProcess , tnsOutputEventEmitter : tnsOutputEventEmitter } ;
45
45
}
46
46
47
- private configureReadyEvent ( readableStream : stream . Readable , eventEmitter : EventEmitter ) : void {
47
+ protected configureReadyEvent ( readableStream : stream . Readable , eventEmitter : EventEmitter ) : void {
48
+ super . configureReadyEvent ( readableStream , eventEmitter ) ;
49
+
48
50
let socketPathPrefix = 'socket-file-location: ' ;
49
51
let streamScanner = new scanner . StringMatchingScanner ( readableStream ) ;
50
52
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';
2
2
import { EventEmitter } from 'events' ;
3
3
import { Version } from '../common/version' ;
4
4
import { NativeScriptCli } from './nativeScriptCli' ;
5
+ import * as stream from 'stream' ;
6
+ import * as scanner from './streamScanner' ;
5
7
6
8
export type DebugResult = { tnsProcess : ChildProcess , tnsOutputEventEmitter : EventEmitter } ;
7
9
@@ -28,6 +30,12 @@ export abstract class Project {
28
30
29
31
public abstract debug ( options : { stopOnEntry : boolean , watch : boolean } , tnsArgs ?: string [ ] ) : DebugResult ;
30
32
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
+
31
39
protected executeRunCommand ( args : string [ ] ) : ChildProcess {
32
40
return this . cli . execute ( [ "run" , this . platformName ( ) ] . concat ( args ) , this . _appRoot ) ;
33
41
}
You can’t perform that action at this time.
0 commit comments