Lambda argument unexpected formatting on exactly max length line
Print width 120 (you can paste the example to https://playground.csharpier.com/)
Input:
public class ClassName
{
public static int Run()
{
await Assert.ThrowsAsync<IOException>(async () => await writer.FlushAsync(TestContext.Current.CancellationToken));
}
}
Output:
public class ClassName
{
public static int Run()
{
await Assert.ThrowsAsync<IOException>(async () => await writer.FlushAsync(TestContext.Current.CancellationToken)
);
}
}
Expected behavior:
public class ClassName
{
public static int Run()
{
await Assert.ThrowsAsync<IOException>(
async () => await writer.FlushAsync(TestContext.Current.CancellationToken)
);
}
}
or
public class ClassName
{
public static int Run()
{
await Assert.ThrowsAsync<IOException>(async () => await writer.FlushAsync(TestContext.Current.CancellationToken));
}
}
My hope is that resolving #1613 will also resolve this
I'm unable to reproduce this. I did notice that the playground was still running 1.0.0 which was unable to reproduce it. I was also unable to reproduce it after updating the playground to 1.0.2.
Updating the version in dotnet-tools.json from 1.0.1 to 1.0.3 fixes it in the CLI, however the VS Code extension might still be using an older version as it formats the file a bit differently. Perhaps this is just a matter of pushing the newest version to the extension
The VSCode extension will use the version from dotnet-tools.json when it finds an appropriate one. It will fall back to using the global version of csharpier if one is installed. Perhaps you need to update the global version.
Also the extensions don't detect when you update csharpier yet. I've been meaning to add that feature for a while now but never find the time. So if you updating csharpier with vscode open it could still be using the older version for some files.
Thanks, the problem was a globally installed 0.30.6 overriding dotnet-tools.