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

C# clang-format with Microsoft style broken #454

Closed
ShinyZero0 opened this issue Mar 21, 2023 · 1 comment
Closed

C# clang-format with Microsoft style broken #454

ShinyZero0 opened this issue Mar 21, 2023 · 1 comment

Comments

@ShinyZero0
Copy link

I have redefined the clangformat for C# like this:

let g:neoformat_cs_clangformat = {
     \ 'exe': 'clang-format',
     \ 'args': ['--style=Microsoft', '--assume-filename=.cs'],
     \ }

Also i tried to create the same as a custom formatter. Anyway, even if i format the whole buffer, the result differs from manually running the exact same command on a file. E.g. i get the broken lambdas:

output.ForEach(p = > Console.WriteLine(p));

and some cursed public keywords placement while the tabstop is 4

public
class Program
{
  public
    static void Main(string[] args)
    {}
}

and broken string interpolation like this

Console.WriteLine($ "Var: {var}");

when i run the same command from shell, i don't get these issues and formatting is good

@ShinyZero0
Copy link
Author

Fixed, --assume-filename isn't working without stdin so it recognized the file as C code for some reason (i thought neoformat tempfile saves the extension). With stdin = 1 in neoformat it works well.

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

1 participant