Closed alexsorokoletov closed 8 years ago
Any chance this could work with .NET Core nowadays? Or Mono only?
@jaredpar , do you know offhand what dependencies may be blocking this on Core?
@Petermarcu @perlun not Jared, but I believe it should work just fine on .NET Core. We would need to compile it against .NET Core and use MSBuild from .NET Core
@Petermarcu it could move to .Net core with a little bit of work as @alexsorokoletov suggested. I think there is a small amount of design work involved but probably 1-2 days of work.
Sounds great! Could anyone create a GH issue about it, so we can track progress (and discuss design ideas) there?
What's the status on this issue? After using Prettier and gofmt it's quite hard to go back to a programming language that doesn't have a formatter 😅
Jared would be best person to outline the plan, but I could not agree more with Timon - after using formatter it's hard not to use it.
Basically, we have to migrate it to .net core and it will run anywhere where .net core runs.
Here are few similar issues already opened:
I've quickly tried to migrate to .NET Core and there one thing that stops it: https://github.com/dotnet/corefx/issues/18452#issuecomment-305009282
Formatting project uses package Microsoft.CodeAnalysis.CSharp.Workspaces
and it references the Microsoft.Composition
package not available on .NET Core (should be migrated to System.Composition) and there a some changes related to that (MEF classes and namespaces mostly).
I would love to have a single source of truth for formatting C# code without any options to customize it.
Turns out there is a CodeFormatter project (thank you!) but it doesn't run well on Mono. During MVPSummit Hackathon with great help of @brettfo and guidance from @jaredpar we've been able to allow to run the CodeFormatter on mono with little changes.
How to run it on Mono then? First, install the tools
sh init-tools.sh
(downloads and unzips MSBuild for Mono, one could possibly symlink to current install instead of downloading, idea taken from Mono's MSBuild fork xplat-c9).Restore NuGet packages and build the project:
nuget restore src/CodeFormattter.sln && msbuild src/CodeFormatter.sln
Then run it:
mono bin/CodeFormatter/Debug/CodeFormatter.exe ../codeformatter-test/test.rsp
Here's short video on overall process https://youtu.be/hLZ8nishxPo
Please let me know if there is a better way, I'm open for feedback. The pull request is related to #106