zls icon indicating copy to clipboard operation
zls copied to clipboard

Completions not working when importing after declarations.

Open mattatticus opened this issue 8 months ago • 0 comments

Zig Version

0.14.0

ZLS Version

0.14.0

Client / Code Editor / Extensions

NVIM v0.11.1, nvim-lspconfig, blink.cmp

Steps to Reproduce and Observed Behavior

pub const std_options: std.Options = .{
    // Does not trigger completions when typing '.'
};

pub fn main() !void {}

// Imports here.
const std = @import("std");

Expected Behavior

The completions should work when typing '.' inside the std_options.

Now, the completions do work when the imports are declared above std_options (or where they are being used). This is a problem in all the other editors I've tried namely, Zed and Helix.

I've also tried using Zig master and building Zls from source, but the problem still persists.

Relevant log output


mattatticus avatar Apr 27 '25 17:04 mattatticus