Skip to content

Commit f8b7a05

Browse files
committed
Handle the variadic args for inline console.logs
1 parent f04c7ed commit f8b7a05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tsserver/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ namespace ts.server {
975975
// the log. This is so that language service plugins which use
976976
// console.log don't break the message passing between tsserver
977977
// and the client
978-
console.log = (msg) => logger.msg(msg, Msg.Info);
979-
console.warn = (msg) => logger.msg(msg, Msg.Err);
980-
console.error = (msg) => logger.msg(msg, Msg.Err);
978+
console.log = (...args) => logger.msg(args.length === 1 ? args[0] : args.join(", "), Msg.Info);
979+
console.warn = (...args) => logger.msg(args.length === 1 ? args[0] : args.join(", "), Msg.Err);
980+
console.error = (...args) => logger.msg(args.length === 1 ? args[0] : args.join(", "), Msg.Err);
981981
}

0 commit comments

Comments
 (0)