golang/go

x/tools/gopls: support LocationLink for relevant requests

開放

#40,195 建立於 2020年7月13日

 (0 則留言) (0 個反應) (0 位負責人)Go (19,008 個分叉)batch import
FeatureRequestToolsgoplshelp wanted

倉庫指標

星標
 (133,883 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

When requesting textDocument/definition gopls returns a Location.

This FR is about supporting returning a LocationLink instead for clients that support it (a client capability).

Rationale: some editors/plugins can use this to support previewing the entire function on hover. See https://github.com/neovim/neovim/issues/12218 and https://github.com/neovim/neovim/pull/12368 for an in-depth description.

In terms of other language servers that do this, it looks like rust-analyzer does it as well.

All (current) LSP actions that can return LocationLink's:

  • textDocument/declaration
  • textDocument/definition
  • textDocument/typeDefinition

貢獻者指南