While running gopls
and lsp-mode
on a Golang project, is there a way to list all implementations of an interface's function?
When invoked on a function name, xref-find-definition
jumps inside the interface definition. For example, M-. on function area
in this example will jump to the area() line in:
type geometry interface {
area() float64
perim() float64
}
..and not to its implementation. This is expected behavior since only at runtime could the actual function that gets called be derived.
As for xref-find-references
, the list does not include the function definitions - just the interface definition and calls to it, which again, makes sense.
However, this is not what one often looks for when they want to jump based on a function call. Is there a way to jump to or list implementations of an interface's function?