nvimdev / lspsaga.nvim

improve neovim lsp experience
MIT License
3.41k stars 287 forks source link

References belong to incorrect node. #1389

Open ch3n9w opened 7 months ago

ch3n9w commented 7 months ago

Describe the bug

image

As you can see, case <- Change Statement is in main.go, however, the Reference tree show that the statement belongs to log.go, which is wrong.

Steps to reproduce

  1. create a simple golang project
  2. create log.go, which contains:
package main

func log(msg string) {
    Change <- true
}
  1. create main.go, which contains:
package main

var Change chan bool
func main() {
    select {
    case <-Change:
        // do something
    }
}
  1. put cursor to Change variable, and call lspsaga reference function

Expected behavior

case <- Change Statement is belongs to log.go in reference tree.

Neovim version (nvim -v)

NVIM v0.9.5 Build type: Release

lspsaga commit

2198c07

Terminal name/version

tmux 3.3a