File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -982,4 +982,12 @@ namespace ts.server {
982
982
if ( ts . sys . tryEnableSourceMapsForHost && / ^ d e v e l o p m e n t $ / i. test ( ts . sys . getEnvironmentVariable ( "NODE_ENV" ) ) ) {
983
983
ts . sys . tryEnableSourceMapsForHost ( ) ;
984
984
}
985
+
986
+ // Overwrites the current console messages to instead write to
987
+ // the log. This is so that language service plugins which use
988
+ // console.log don't break the message passing between tsserver
989
+ // and the client
990
+ console . log = ( ...args ) => logger . msg ( args . length === 1 ? args [ 0 ] : args . join ( ", " ) , Msg . Info ) ;
991
+ console . warn = ( ...args ) => logger . msg ( args . length === 1 ? args [ 0 ] : args . join ( ", " ) , Msg . Err ) ;
992
+ console . error = ( ...args ) => logger . msg ( args . length === 1 ? args [ 0 ] : args . join ( ", " ) , Msg . Err ) ;
985
993
}
You can’t perform that action at this time.
0 commit comments