zls
zls copied to clipboard
Semantic highlighting definition changes when the token is active
Zig Version
0.11.0-dev.2571+31738de28
Zig Language Server Version
HEAD
Steps to Reproduce
- Reference a module
- Press .
Note that it always highlights JSC as "red" unless the text position is atJSC. . It has nothing to do with syntax errors.

incase it helps, `JSC` is defined like
bun.zig:
pub const JSC = @import("./jsc.zig");
root.zig:
pub const bun = @import("./bun.zig");
bun_redirect.zig:
pub const bun = @import("root").bun;
build.zig:
var bun = b.createModule(.{
.source_file = FileSource.relative("src/bun_redirect.zig"),
});
step.addModule("bun", bun);
So @import("bun") goes to @import("root").bun which goes to @import("./bun.zig"). The reason for this indirection was so that zls would be able to provide completions for platform-specific packages.
Expected Behavior
It shouldn't change the semantic token highlight color based on the text position
Actual Behavior
The semantic token changes when it shouldn't