We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 984956a + f8b7a05 commit b70f894Copy full SHA for b70f894
1 file changed
src/tsserver/server.ts
@@ -982,4 +982,12 @@ namespace ts.server {
982
if (ts.sys.tryEnableSourceMapsForHost && /^development$/i.test(ts.sys.getEnvironmentVariable("NODE_ENV"))) {
983
ts.sys.tryEnableSourceMapsForHost();
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);
993
0 commit comments