dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.02k stars 4.03k forks source link

Adding indentations in csi #6885

Open ManishJayaswal opened 8 years ago

ManishJayaswal commented 8 years ago

@amcasey

genlu commented 8 years ago

Here's how Notepad++ works, I will follow the same behavior if you think it is reasonable:

@dotnet/roslyn-interactive

mattwar commented 8 years ago

Shouldn't you be using the formatter or auto-indenter?

genlu commented 8 years ago

@mattwar This task is about csi, the command-line REPL. My understanding is all the IDE features are irrelevant here. @amcasey showed me something related to this in compiler layer (e.g. SyntaxNormalizer, NormalizeWhitespace method on SyntaxToken, etc.), but we can't use them since they are manipulating syntax tree, which will not reflect back to existing text in console. I will look at their implementation and follow the same behavior.

ManishJayaswal commented 8 years ago

Sounds good to me!

mattwar commented 8 years ago

The auto-indenter mostly defers to the formatter, which is in Workspace layer.

mattwar commented 8 years ago

Since this is CSI, you should probably do something simple. If we wanted to spend the time though, being Console is no impediment. You can do crazy stuff in console.