feat(pack): support textDocument/documentLink in confirmation buffer

Problem: In `vim.pack.update()` confirmation buffer it might be useful
  to be able to use `gx` (open link at cursor) when cursor is on
  something like commit or tag.

Solution: Add `textDocument/documentLink` method support for the
  in-process LSP. This may be used by LSP clients and makes `gx`
  automatically work.

  The shortcoming is that this requires tracking how to construct a URL
  from source and commit/tag. Currently only GitHub hosted repositories
  are supported.
This commit is contained in:
Evgeni Chasnovski
2026-04-23 19:50:02 +03:00
parent 4ed2e66d2e
commit d01dc690e1
4 changed files with 156 additions and 6 deletions

View File

@@ -1247,6 +1247,9 @@ end
--- - |]]| and |[[| to navigate through plugin sections.
---
--- Some features are provided via LSP:
--- - 'textDocument/documentLink' - compute links for plugin paths, sources,
--- commits, and tags. Use |gx| to open a link to an object at cursor.
--- Only supports GitHub hosted repositories for commit and tag links.
--- - 'textDocument/documentSymbol' (`gO` via |lsp-defaults| or |vim.lsp.buf.document_symbol()|) -
--- show structure of the buffer.
--- - 'textDocument/hover' (`K` via |lsp-defaults| or |vim.lsp.buf.hover()|) - show more