Hover implements plugins.LSPAdapter. line/column are 1-based.
(file string, line, column int)
| 193 | |
| 194 | // Hover implements plugins.LSPAdapter. line/column are 1-based. |
| 195 | func (a *lspToolAdapter) Hover(file string, line, column int) (string, error) { |
| 196 | sess, _, err := a.acquire(file) |
| 197 | if err != nil { |
| 198 | return "", err |
| 199 | } |
| 200 | text, err := sess.Client.Hover(sess.URI, lspPos(line, column)) |
| 201 | if err != nil { |
| 202 | return "", err |
| 203 | } |
| 204 | if strings.TrimSpace(text) == "" { |
| 205 | return "No hover information at that position — check that line/column point at the symbol name (1-based).", nil |
| 206 | } |
| 207 | return truncateHoverRuneSafe(text, lspMaxHoverBytes), nil |
| 208 | } |
| 209 | |
| 210 | // truncateHoverRuneSafe bounds hover payloads on a rune boundary — servers |
| 211 | // sometimes return whole documentation pages, and hover content is arbitrary |
nothing calls this directly
no test coverage detected