Skip to content

implement symbol references within the Zig standard library #2614

@Techatrix

Description

@Techatrix

The current implementation of cross-file references in #2608 is generally constrained to files within workspace folders. Since the Zig standard library is typically located outside any workspace, requests that target symbols in the std will not find references within it's own code.

Example:

// root.zig
const Allocator = std.mem.Allocator;
// lib/std/mem/Allocator.zig (standard library)
const Allocator = @This();
ptr: *anyopaque,
vtable: *const VTable,
pub const VTable = struct {
...

A references request on Allocator in root.zig will search files that are in same module as root.zig. This is acceptable as searching the standard library as well would be costly and likely undesired.

A references request on Allocator in Allocator.zig will only search the file itself. This should instead load and search all files within the standard library.

This issue should also address what to do about the skip_std_references config option which is unused since #2608.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions