-
-
Notifications
You must be signed in to change notification settings - Fork 278
RCS0053 - Formatting issues #1517
Copy link
Copy link
Closed
Labels
Description
Product and Version Used:
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.5" />
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.12.5" />Steps to Reproduce:
Visual Studio and VS Code default formatting (CTRL+K+D on Windows in VS) format the following file differently.
internal sealed class Test
{
public static TiktokenTokenizer CreateTokenizer(TokenizerEncoding encoding) =>
TiktokenTokenizer.CreateForEncoding(encoding switch
{
TokenizerEncoding.Cl100kBase => "cl100k_base",
TokenizerEncoding.O200kBase => "o200k_base",
_ => throw new Exception("Invalid encoding")
});
}Actual Behavior:
RCS0053 formats it this way
internal sealed class Test
{
public static TiktokenTokenizer CreateTokenizer(TokenizerEncoding encoding) =>
TiktokenTokenizer.CreateForEncoding(encoding switch
{
TokenizerEncoding.Cl100kBase => "cl100k_base",
TokenizerEncoding.O200kBase => "o200k_base",
_ => throw new Exception("Invalid encoding")
});
}
<img width="613" alt="image" src="https://github.com/user-attachments/assets/506bdb4e-be5d-4947-8e2f-d41e03e06197">Expected Behavior:
internal sealed class Test
{
public static TiktokenTokenizer CreateTokenizer(TokenizerEncoding encoding) =>
TiktokenTokenizer.CreateForEncoding(encoding switch
{
TokenizerEncoding.Cl100kBase => "cl100k_base",
TokenizerEncoding.O200kBase => "o200k_base",
_ => throw new Exception("Invalid encoding")
});
}Reactions are currently unavailable