Skip to content

goto label give wrong reference #923

Closed

Description

@phanen

/bin/nvim --clean -u a.lua a.lua

local M = {}
M.cont = function() end
vim.lsp.config("ls", {
	cmd = { "emmylua_ls" },
	-- cmd = { 'lua-language-server' },
	filetypes = { "lua" },
	root_markers = {
		".luarc.json",
		".emmyrc.json",
		".luacheckrc",
		".git",
	},
	settings = { Lua = { workspace = { library = { "$VIMRUNTIME" } } } },
	workspace_required = false,
})
vim.lsp.enable("ls")

if false then
	while true do
		goto cont
		::cont::
	end
end

goto reference on ::cont::, shouldn't give reference on function

Activity

  1. CppCXY commented on Jan 12, 2026

    @CppCXY
    Member

    This actually falls back to querying any index with the same name when references cannot be found, which typically returns the expected search results.

  2. self-assigned this
    on Jun 19, 2026
  3. added theissue type on Jun 19, 2026
  4. linked a pull request that will close this issueupdate #1113on Jun 19, 2026
  5. xuhuanzy commented on Jun 19, 2026

    @xuhuanzy
    Member

    Added jump and definition query for goto. c8c3132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions