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 authored and anderseknert committed Aug 1, 2024
1 parent 565f509 commit 321e982
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 @@ -448,6 +448,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 321e982

Please sign in to comment.