Skip to content

zig fmt: Mixing comments and doc comments has weird results #5483

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

Closed
squeek502 opened this issue May 30, 2020 · 2 comments
Closed

zig fmt: Mixing comments and doc comments has weird results #5483

squeek502 opened this issue May 30, 2020 · 2 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library. zig fmt
Milestone

Comments

@squeek502
Copy link
Collaborator

squeek502 commented May 30, 2020

var foo: u8 = undefined;

/// doc comment
// normal comment
var bar: u8 = undefined;

I expect the above to be unchanged by zig fmt, but instead it changes it to:

var foo: u8 = undefined;
/// doc comment
// normal comment
var bar: u8 = undefined;

Not sure if this is intended behavior or not.


Note also that this currently remains unchanged:

var foo: u8 = undefined;

// normal comment
/// doc comment
var bar: u8 = undefined;
@Vexu Vexu added enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library. labels Jun 7, 2020
@Vexu Vexu added this to the 0.7.0 milestone Jun 7, 2020
@andrewrk andrewrk modified the milestones: 0.7.0, 0.8.0 Oct 14, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Nov 6, 2020
@ifreund
Copy link
Member

ifreund commented Mar 7, 2021

Fixed by #7920

@ifreund ifreund closed this as completed Mar 7, 2021
@Mouvedia
Copy link

Mouvedia commented Mar 8, 2021

These should be moved to 0.8.0.

@Vexu Vexu modified the milestones: 0.9.0, 0.8.0 Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library. zig fmt
Projects
None yet
Development

No branches or pull requests

5 participants