Zig doc comments start with three/triple slashes (///). When using the Rewrap extension on them, they end up getting mangled where the subsequent lines start with a double slash and the extra slash from the original comments get mixed in with the rest of the text.
Before:
foo.zig
const std = @import("std");
/// This is an long example doc comment describing foo. We expect the Rewrap extension to wrap it
/// with three slashes. But it ends up breaking up the entire comment and counting the extra slash
/// as part of the comment and intermingling it with the rest of the text.
pub fn foo() void {
std.log.debug("foo", .{});
}
After Rewrap:
foo.zig
const std = @import("std");
/// This is an long example doc comment describing foo. We expect the Rewrap extension
//to wrap it / with three slashes. But it ends up breaking up the entire comment and
//counting the extra slash / as part of the comment and intermingling it with the rest
//of the text.
pub fn foo() void {
std.log.debug("foo", .{});
}
Zig doc comments start with three/triple slashes (
///
). When using the Rewrap extension on them, they end up getting mangled where the subsequent lines start with a double slash and the extra slash from the original comments get mixed in with the rest of the text.Before:
foo.zig
After Rewrap:
foo.zig
Demonstration in VSCode:
Versions:
1.16.3
1.83.1
Related issues:
Potential solutions
Probably just need to define some specific rules for Zig in
core/Parsing.Documents.fs
.