Closed olafurpg closed 6 years ago
I have a WIP commit from January that started this refactoring https://github.com/scalameta/metals/commit/3a8c1a7a797a8fdea80cd913aa8f068de3624621 Opening this ticket to remind myself to complete that work
After more thinking, it's fine to keep the signature unchanged. lsp4s should be an idiomatic scala LSP implementation so it would be weird to rely on exceptions for control flow.
However, the vscode client doesn't seem to report several error codes, but it's possible to accommodate that while keeping the signature unchanged.
Currently, the response for async lsp4s requests is
Task[Either[Response.Error, T]]
. However, editors like vscode don't even present Response.Error like "invalid request" in the UI so it's better to usewindow/showMessage
to report problems. We should refactor the signature to returnTask[T]
instead and make Response.Error extend Throwable so we can still handle them.