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

don't break short C-style comments #429

Open
NobbZ opened this issue Nov 11, 2024 · 1 comment
Open

don't break short C-style comments #429

NobbZ opened this issue Nov 11, 2024 · 1 comment

Comments

@NobbZ
Copy link

NobbZ commented Nov 11, 2024

My editor supports embedding languages in strings and using an annotytion like /* python */ in my nix code preceeding a string I can tell it what language the following string will be in.

Sadly this:

{
  c = /* python */ ''
    if __file__ == '__main__':
      print("hello")
  '';
}

becomes:

{
  c =
    /*
    python
    */
    ''
      if __file__ == '__main__':
        print("hello")
    '';
}

Which keeps the formatting but bloats the code for no reason and makes the comment appear much more important than it is.

Using a single line comment (#) works as well for the editor, though still causes code to move vertically compared to the initial version.

@sellout
Copy link

sellout commented Dec 2, 2024

Duplicate of #366.

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

No branches or pull requests

2 participants