Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix :Telescope lsp_references Failing to Jump Directly to Single Reference #3118

Closed
odysseus0 opened this issue May 19, 2024 · 2 comments · Fixed by #3137
Closed

Fix :Telescope lsp_references Failing to Jump Directly to Single Reference #3118

odysseus0 opened this issue May 19, 2024 · 2 comments · Fixed by #3137
Labels
bug Something isn't working

Comments

@odysseus0
Copy link

Description

When there is only one reference, some time using the :Telescope lsp_references does not properly jump to the reference.

Neovim version

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713773202

Operating system and version

macOS 14.5 23F79 arm64

Telescope version / branch / rev

telescope 0.1.6

checkhealth telescope

telescope: health#telescope#check

Checking for required plugins ~
- OK plenary installed.
- WARNING nvim-treesitter not found. (Required for `:Telescope treesitter`.)

Checking external dependencies ~
- OK rg: found ripgrep 14.1.0
- OK fd: found fd 10.1.0

===== Installed extensions ===== ~

Steps to reproduce

  1. create a new file main.go and paste in the following code.
package main

import "fmt"

func main() {
	hello()
}

func hello() {
	fmt.Println("Hello, World!")
}
  1. Open the Go file with the specified Neovim configuration.
  2. Move the cursor on top of hello() on the line func hello() {
  3. Type in command :Telescope lsp_references

Expected behavior

Cursor should jump to the only reference hello() inside

func main() {
	hello()
}

Actual behavior

The cursor won't move.

Minimal config

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({
		"git",
		"clone",
		"--filter=blob:none",
		"https://github.com/folke/lazy.nvim.git",
		"--branch=stable",
		lazypath,
	})
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
	{
		"nvim-telescope/telescope.nvim",
		tag = "0.1.6",
		dependencies = { "nvim-lua/plenary.nvim" },
	},
	{
		"neovim/nvim-lspconfig",
		config = function()
			require("lspconfig").gopls.setup({})
		end,
	},
	{ "williamboman/mason.nvim", build = ":MasonUpdate", opts = {} },
	{
		"williamboman/mason-lspconfig.nvim",
		dependencies = { "williamboman/mason.nvim" },
		opts = { ensure_installed = { "gopls" } },
	},
})
@odysseus0 odysseus0 added the bug Something isn't working label May 19, 2024
@odysseus0
Copy link
Author

Submitted a PR myself here #3120.

@ethanh20009
Copy link

Got the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants