Skip to content

Commit

Permalink
L: don't panic if hover help is not available (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
farhaven authored May 12, 2024
1 parent c376e71 commit 9602b48
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/lsp/acmelsp/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,21 @@ func (rc *RemoteCmd) Hover(ctx context.Context) error {
if err != nil {
return err
}

hov, err := rc.server.Hover(ctx, &protocol.HoverParams{
TextDocumentPositionParams: *pos,
})
if err != nil {
return err
}

if hov == nil {
fmt.Fprintln(rc.Stdout, "No hover help available.")
return nil
}

fmt.Fprintf(rc.Stdout, "%v\n", hov.Contents.Value)

return nil
}

Expand Down

0 comments on commit 9602b48

Please sign in to comment.