Conversation
This sends sbt's log message as "window/logMessage" event to LSP.
| channels.foreach { | ||
| case c: ConsoleChannel => | ||
| if (entry.channelName.isEmpty || entry.channelName == Some(c.name)) { | ||
| if (broadcastStringMessage) { |
There was a problem hiding this comment.
Was this for debug purposes? Is broadcastStringMessage meant to be wired up to something, rather than be a constant true?
There was a problem hiding this comment.
I think the way it was before is correct: it should take into account channel name, otherwise things get messed up..
There was a problem hiding this comment.
This was done on purpose, so on terminal client you still see the compiler warning etc coming from the VS Code client etc.
There was a problem hiding this comment.
compiler warning etc coming from the VS Code client
I didn't get this. What do you mean? Isn't is just about messages from sbt?
| c.publishEvent(event) | ||
| // Note that language server's LogMessageParams does not hold the execid, | ||
| // so this is weaker than the StringMessage. We might want to double-send | ||
| // in case we have a better client that can utilize the knowledge. |
There was a problem hiding this comment.
I think execId doesn't make much sense for LSP notifications, the channelName is much more important:
- notifications are not necessarily caused by some request, so they don't need
execId(which in case of ResponseMessages is the request ID) - it's important that notifications go to the right channel. So if something is triggered by an LSP client, console channel shouldn't get spammed by the log messages and another way round.
There was a problem hiding this comment.
If there are n events coming out of m commands, you need execId to distinguish them from the other.
There was a problem hiding this comment.
My point is that LSP doesn't distinguish notifications by exec-id. It does distinguish responses, but the problem here is that I see some StringEvents sent to the client with empty exec-ids, because they are sent as responses to a request that client didn't make.
This sends sbt's log message as window/logMessage event to Language Server client.