zls
zls copied to clipboard
Top-level Doc Comments Are Not Supported
In Something.zig:
//! top level comment
/// inner comment
a: i32
In main.zig:
const Something = @import("Something.zig");
pub fn main() void {
const some = Something { .a = 2 }; // Something has no documentation
some.a; // Has top level documentation and inner documentation
}
Oddly enough, the hover info over some.a includes the top level comment and the inner comment. The expected output should be "inner comment" for a and "top level comment" for Something.

#308 hides the top level comment for members, but where and when should they be shown? The import line could have doc comments on its own:
/// Very important import
const Something = @import("Something.zig");
Should those be combined?