MCPcopy Create free account
hub / github.com/diillson/chatcli / Hover

Method Hover

cli/lsp_tool_adapter.go:195–208  ·  view source on GitHub ↗

Hover implements plugins.LSPAdapter. line/column are 1-based.

(file string, line, column int)

Source from the content-addressed store, hash-verified

193
194// Hover implements plugins.LSPAdapter. line/column are 1-based.
195func (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

Callers

nothing calls this directly

Calls 4

acquireMethod · 0.95
lspPosFunction · 0.85
truncateHoverRuneSafeFunction · 0.85
HoverMethod · 0.65

Tested by

no test coverage detected