File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -878,7 +878,7 @@ namespace ts {
878
878
879
879
setText ( text , start , length ) ;
880
880
881
- return {
881
+ const scanner : Scanner = {
882
882
getStartPos : ( ) => startPos ,
883
883
getTextPos : ( ) => pos ,
884
884
getToken : ( ) => token ,
@@ -914,6 +914,17 @@ namespace ts {
914
914
scanRange,
915
915
} ;
916
916
917
+ if ( Debug . isDebugging ) {
918
+ Object . defineProperty ( scanner , "__debugShowCurrentPositionInText" , {
919
+ get : ( ) => {
920
+ const text = scanner . getText ( ) ;
921
+ return text . slice ( 0 , scanner . getStartPos ( ) ) + "║" + text . slice ( scanner . getStartPos ( ) ) ;
922
+ } ,
923
+ } ) ;
924
+ }
925
+
926
+ return scanner ;
927
+
917
928
function error ( message : DiagnosticMessage ) : void ;
918
929
function error ( message : DiagnosticMessage , errPos : number , length : number ) : void ;
919
930
function error ( message : DiagnosticMessage , errPos : number = pos , length ?: number ) : void {
You can’t perform that action at this time.
0 commit comments