ldelossa / litee.nvim

A framework for building Neovim plugins
409 stars 14 forks source link

[Gopls] Symbol names are not unique #10

Closed ldelossa closed 2 years ago

ldelossa commented 2 years ago

With gopls it appears that:

package main

type N struct{}

func (n *N) DoIt() {
    Func1()
}

type R struct{}

func (n *R) DoIt() {
    Func1()
}

Would result in two call hierarchy objects with the same name of "DoIt".

The gopls language server does not uniquely identify method names.

This is an issue for Calltree since it assumes this and uses the "name" of the object as the key in the tree.

A simple fix would be to add some type of unique element to the "name" field of the tree node, and rip them off when marshaling the node to a UI line.