discord-csharp / MODiX

Discord Bot handling basic moderation needs, soon implements statistics.
MIT License
115 stars 63 forks source link

Repl strips indentation from code #975

Closed Atulin closed 1 year ago

Atulin commented 1 year ago

Message with the following content:

!e
```cs
enum Foo {
    Aaa,
    Bbb
}

var f = Foo.Aaa;
var res = f switch {
    Foo.Aaa => 69
};

res

produces the following output:
![image](https://user-images.githubusercontent.com/11233299/215917503-cae71134-8145-4112-9939-97b43ac2eebb.png)

This one is just an example, I noticed it happens all the time in recent days
Scott-Caldwell commented 1 year ago

I would guess that the issue is somewhere in the logic that tries to format the code nicely before sending it to the REPL: https://github.com/discord-csharp/MODiX/blob/aeb93562c7f93e1b0d3d42391b759b8f19930162/Modix.Services/Utilities/FormatUtilities.cs#L56-L84