Skip to content

Commit

Permalink
lsp: Notify when a fix fails
Browse files Browse the repository at this point in the history
This will now send an LSP notification to the editor when there is a
failure during fixing. Before, only a server log message was sent.

Signed-off-by: Charlie Egan <[email protected]>
  • Loading branch information
charlieegan3 committed Aug 1, 2024
1 parent d070132 commit f7b9214
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/lsp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,16 @@ func (l *LanguageServer) StartCommandWorker(ctx context.Context) {
if err != nil {
l.logError(err)

err := l.conn.Notify(ctx, "window/showMessage", types.ShowMessageParams{
Type: 1, // error
Message: err.Error(),
})
if err != nil {
l.logError(fmt.Errorf("failed to notify client of command error: %w", err))

break
}

break
}

Expand Down

0 comments on commit f7b9214

Please sign in to comment.