Skip to content

Reference not found #2530

@dennypenta

Description

@dennypenta

Zig Version

0.15.1

ZLS Version

0.15.0

Client / Code Editor / Extensions

nvim, native lsp, nothing else

Steps to Reproduce and Observed Behavior

https://github.com/seqor/seqor/blob/414fa5f8682f2a01315f759f5ffa25dca0a73c48/src/store/inmem/BlockWriter.zig#L67C8-L67C18

in this particular file I see all the functions used outside of the file can't be found as references, but if a function is used in the file it's found.
also I can't jump into this file from its usage.

I couldn't see much logs from zls, I rebuilt it from source via zig build.
also I found the issue gets resolved time to time, for instance I launched a debugger to stop at this point in order to make sure this path is in the build and it it stop, after that reference started working.

or in theory it's because I rebuilt zls on 0.15.1 tag.
Happy to help find more info to understand whether it's a real bug or just a laggy thing

Expected Behavior

the function reference is found

Log Output

nvim lsp logs:

[DEBUG][2025-12-12 15:20:31] /opt/homebrew/share/nvim/runtime/lua/vim/lsp/log.lua:151   "LSP[zls]"      "client.request"        1       "textDocument/references"       { context = { includeDeclaration = true }, position = { character = 7, line = 64 }, textDocument = { uri = "file:///~/projects/seqor/src/store/inmem/BlockWriter.zig" } }     <function 1>    6
[DEBUG][2025-12-12 15:20:31] /opt/homebrew/share/nvim/runtime/lua/vim/lsp/log.lua:151   "rpc.send"      { id = 11, jsonrpc = "2.0", method = "textDocument/references", params = { context = { includeDeclaration = true }, position = { character = 7, line = 64 }, textDocument = { uri = "file:///Users/d.dvornikov/projects/seqor/src/store/inmem/BlockWriter.zig" } } }
[DEBUG][2025-12-12 15:20:31] /opt/homebrew/share/nvim/runtime/lua/vim/lsp/log.lua:151   "rpc.receive"   { id = 11, jsonrpc = "2.0", result = { { range = { ["end"] = { character = 17, line = 64 }, start = { character = 7, line = 64 } }, uri = "file:///~/projects/seqor/src/store/inmem/BlockWriter.zig" } } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions