zls icon indicating copy to clipboard operation
zls copied to clipboard

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

Open lingthing opened this issue 4 months ago • 0 comments

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'

lingthing avatar Aug 25 '25 12:08 lingthing