Skip to content

C# Formatter Adding Spaces After Float Declarations #258

@hjc

Description

@hjc

Hi, just installed the Unibeautify extension and while it does what I really want (wrap long lines), it's causing a bigger problem with floats. Here's an example snippet:

using System;

public class BeautifyExample {
    public BeautifyExample() {
        float four = 4f;
    }
}

Upon save it reformats this to:

using System;

public class BeautifyExample {
    public BeautifyExample() {
        float four = 4 f;
    }
}

I've disabled and re-enabled the Unibeautify extension and confirmed it was caused by this. My current config is:

{
  "C#": {
    "beautifiers": ["Pretty Diff"],
    "break_chained_methods": false,
    "indent_comments": true,
    "indent_size": 4,
    "indent_style": "space",
    "max_preserve_newlines": 1,
    "multiline_ternary": "never",
    "quotes": "double",
    "wrap_line_length": 80
  }
}

VS Code version is 1.11.2. OS is Windows.

Which was generated through the online config generator linked in the docs.

I'm also not sure how to work around this? It does it automatically on save, I don't see a comment for ignoring lines and I can't for the life of me find a setting that controls this. Any help would be appreciated! Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions