nvimdev / nvimdev/lspsaga.nvim

References belong to incorrect node.

Open
#1,389 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Lua
Stars
3.8k
Forks
308
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reference lookup with the two-file Go project described in the issue, using the lspsaga reference function on Change. Trace how the reference tree assigns the select case between main.go and log.go. Done means the tree attributes each reference to the file containing it, including the case <- Change statement in main.go.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, lua, neovim
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.