nvimdev / lspsaga.nvim

improve neovim lsp experience
MIT License
3.42k stars 286 forks source link

Lspsaga finder def+ref show only definitions #1336

Closed yannick1974 closed 10 months ago

yannick1974 commented 10 months ago

Describe the bug

Since commit b48b807 Lspsaga finder def+ref shows only the definition while Lspsaga finder ref correctly shows the references. Reverting the commit (including the typos associated commits) makes the finder behaves correctly — well at least as before.

I experience this problem on Python code with pyright or pylsp as LSP servers.

Steps to reproduce

With a Python file like using default Lspsage configuration:

def test():
    print("foo")

if __name__ == "__main__":
    test()

Invoking Lspsaga finder def+ref on the test() shows only the definition while Lspsaga finder ref shows the two references, including the definition.

Expected behavior

Lspsaga finder def+ref should show both the definition and the references.

Neovim version (nvim -v)

v0.10.0-dev bc850ba

lspsaga commit

28051f1

Terminal name/version

konsole

glepnir commented 10 months ago

In most languages, definitions same as Declaration. But some other languages such as C python are ignored. I think adding result filtering is feasible. Elements that are the same as range should be deleted.