Skip to content

Replace VSCode-specific documentation links in hover responses with neovim-compatible navigation instructions#4

Merged
WillEhrendreich merged 2 commits into
mainfrom
copilot/fix-68ee05d4-1d9a-440f-b713-386f2886142f
Aug 30, 2025
Merged

Replace VSCode-specific documentation links in hover responses with neovim-compatible navigation instructions#4
WillEhrendreich merged 2 commits into
mainfrom
copilot/fix-68ee05d4-1d9a-440f-b713-386f2886142f

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 30, 2025

Problem

Hover responses from the F# language server contain VSCode-specific command links that are unusable in neovim:

<a href='command:fsharp.showDocumentation?%5B%7B%20%22XmlDocSig%22%3A%20%22P%3AProgram.server%22%2C%20%22AssemblyName%22%3A%20%22AppHost%22%20%7D%5D'>Open the documentation</a>

These links appear in hover documentation but don't work in neovim, leaving users with broken functionality where they can't navigate to symbol definitions.

Solution

This PR modifies the textDocument/hover handler to automatically replace VSCode-specific documentation command links with helpful neovim navigation instructions.

Before:

val server: IResourceBuilder<ProjectResource>

<a href='command:fsharp.showDocumentation?...'>Open the documentation</a>
*Full name: Program.server*
*Assembly: AppHost*

After:

val server: IResourceBuilder<ProjectResource>

**Go to definition** (place cursor on symbol and use `gd` or `<C-]>`)
*Full name: Program.server*
*Assembly: AppHost*

Implementation Details

  • Modified hover handler: Updated textDocument/hover to process response content and replace documentation links
  • New replacement function: Added _replace_documentation_links() that parses VSCode command URLs and replaces them with actionable neovim instructions
  • Preserved existing functionality: All other hover content (type signatures, metadata) remains unchanged
  • Comprehensive testing: Added full test suite covering link parsing, replacement, and integration scenarios
  • Test helpers: Exposed internal functions for testing while maintaining clean public API

Benefits

  • ✅ Removes unusable VSCode-specific command links
  • ✅ Provides clear, actionable navigation instructions for neovim users
  • ✅ Uses neovim's built-in LSP "go to definition" functionality (gd, <C-]>)
  • ✅ Maintains backward compatibility
  • ✅ Preserves all existing hover content and formatting
  • ✅ Fully tested with edge cases covered

Users can now use standard neovim LSP navigation instead of seeing broken links. When they want to go to a symbol's definition, they simply place their cursor on the symbol and press gd or <C-]>, which is the standard neovim way to navigate to definitions.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: WillEhrendreich <55286472+WillEhrendreich@users.noreply.github.com>
Copilot AI changed the title [WIP] one thing ive always wanted to have available is for the on hover docs to give links like it does in @ionide/ionide-vscode-fsharp the problem is that what comes back from the on hover request isn't something that neovim can do anything with, it just po... Replace VSCode-specific documentation links in hover responses with neovim-compatible navigation instructions Aug 30, 2025
Copilot AI requested a review from WillEhrendreich August 30, 2025 04:23
@WillEhrendreich WillEhrendreich marked this pull request as ready for review August 30, 2025 04:24
@WillEhrendreich WillEhrendreich merged commit 4923ce5 into main Aug 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants