zls icon indicating copy to clipboard operation
zls copied to clipboard

Top-level Doc Comments Are Not Supported

Open Leguu opened this issue 5 years ago • 1 comments

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.

Image

Leguu avatar Apr 08 '21 18:04 Leguu

#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?

tau-dev avatar Apr 12 '21 20:04 tau-dev