Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zig doc comments /// are mangled #388

Open
MadLittleMods opened this issue Nov 2, 2023 · 0 comments · May be fixed by #389
Open

Zig doc comments /// are mangled #388

MadLittleMods opened this issue Nov 2, 2023 · 0 comments · May be fixed by #389

Comments

@MadLittleMods
Copy link

MadLittleMods commented Nov 2, 2023

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", .{});
}

Demonstration in VSCode:

Versions:

  • Rewrap 1.16.3
  • VSCode 1.83.1

Related issues:

Potential solutions

Probably just need to define some specific rules for Zig in core/Parsing.Documents.fs.

MadLittleMods added a commit to MadLittleMods/vscode-rewrap that referenced this issue Nov 2, 2023
@MadLittleMods MadLittleMods linked a pull request Nov 2, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant