-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement: Send error back to client to show
Previously, it would be very difficult to show a proper error message to the user. Especially in VS Code a generic message was show, which was very confusing for users. Now, we send the error message in the response so that the client can handle it as they want. I wonder if we should keep displaying the message, but not sure if it's not better to just change the clients here to show the error.
- Loading branch information
Showing
5 changed files
with
35 additions
and
19 deletions.
There are no files selected for viewing
18 changes: 17 additions & 1 deletion
18
metals/src/main/scala/scala/meta/internal/metals/DebugSession.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
package scala.meta.internal.metals | ||
|
||
final case class DebugSession(name: String, uri: String) | ||
import javax.annotation.Nullable | ||
|
||
final case class DebugSession( | ||
@Nullable name: String, | ||
@Nullable uri: String, | ||
@Nullable error: String, | ||
) | ||
|
||
object DebugSession { | ||
|
||
def success(name: String, uri: String): DebugSession = { | ||
DebugSession(name, uri, null) | ||
} | ||
def failure(message: String): DebugSession = { | ||
DebugSession(null, null, message) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters