Skip to content

All methods of MemoryPool have no hover prompts, and cannot "Go to Definition" #2464

@lingthing

Description

@lingthing

Zig Version

0.15.1

ZLS Version

0.15.0

Client / Code Editor / Extensions

Visual Studio Code with extension vscode-zig

Steps to Reproduce and Observed Behavior

As shown in the following figure, it is impossible to go to the definition of pool.create() .
Image

code:

const std = @import("std");

pub fn main() !void {

    // .init() have no hover, and cannot "Go to Definition".
    var pool: std.heap.MemoryPool(u64) = .init(std.heap.smp_allocator);

    // .deinit() same as above
    defer pool.deinit();

    // All methods of MemoryPool have no hover, and cannot "Go to Definition".
    const p = try pool.create();
    pool.destroy(p);
}

Expected Behavior

Instances or methods of MemoryPool have hover prompts and can "Go to Definition".
Changing the type definition of the pool to look like the sixth line can achieve the expected result.
Image

Log Output

2025-08-25 20:45:32.880 [info] Starting ZLS      0.15.0 @ '/home/user/zig-x86_64-linux-0.15.1/zls'
2025-08-25 20:45:32.880 [info] Log File:         /home/user/.cache/zls/zls.log (info)
2025-08-25 20:45:32.880 [info] Client Info:      Visual Studio Code (1.92.2)
2025-08-25 20:45:32.880 [info] added Workspace Folder: file:///home/user/Desktop/test_zls_memorypool
2025-08-25 20:45:32.998 [info] Set config option 'semantic_tokens' to "partial"
2025-08-25 20:45:32.998 [info] Set config option 'builtin_path' to "/home/user/.cache/zls/builtin.zig"
2025-08-25 20:45:32.998 [info] Set config option 'zig_lib_path' to "/home/user/zig-x86_64-linux-0.15.1/lib"
2025-08-25 20:45:32.998 [info] Set config option 'zig_exe_path' to "/home/user/zig-x86_64-linux-0.15.1/zig"
2025-08-25 20:45:32.999 [info] Set config option 'build_runner_path' to > "/home/user/.cache/zls/build_runner/cf46548b062a7e79e448e80c05616097/build_runner.zig"
2025-08-25 20:45:32.999 [info] Set config option 'global_cache_path' to "/home/user/.cache/zls"
2025-08-25 20:45:32.999 [info] trying to start Build-On-Save for 'file:///home/user/Desktop/test_zls_memorypool'

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