(result: Hover | null, _cwd?: string)
| 251 | * Formats hover result |
| 252 | */ |
| 253 | export function formatHoverResult(result: Hover | null, _cwd?: string): string { |
| 254 | if (!result) { |
| 255 | return 'No hover information available. This may occur if the cursor is not on a symbol, or if the LSP server has not fully indexed the file.' |
| 256 | } |
| 257 | |
| 258 | const content = extractMarkupText(result.contents) |
| 259 | |
| 260 | if (result.range) { |
| 261 | const line = result.range.start.line + 1 |
| 262 | const character = result.range.start.character + 1 |
| 263 | return `Hover info at ${line}:${character}:\n\n${content}` |
| 264 | } |
| 265 | |
| 266 | return content |
| 267 | } |
| 268 | |
| 269 | /** |
| 270 | * Maps SymbolKind enum to readable string |
no test coverage detected