diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
| commit | 00a491d93733d4625ad329b2ba8237f445364b3f (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/CodeFormatter.cs | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| download | Tango-00a491d93733d4625ad329b2ba8237f445364b3f.tar.gz Tango-00a491d93733d4625ad329b2ba8237f445364b3f.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/CodeFormatter.cs')
| -rw-r--r-- | Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/CodeFormatter.cs | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/CodeFormatter.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/CodeFormatter.cs deleted file mode 100644 index c933f7e09..000000000 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.Formatting/CodeFormatter.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.Formatting; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.Scripting.Formatting -{ - public static class CodeFormatter - { - public static String Format(String code) - { - SyntaxTree tree = CSharpSyntaxTree.ParseText(code); - CompilationUnitSyntax root = tree.GetCompilationUnitRoot(); - - //var node = ApplyBraceNewLineRule(root); - //node = ApplyCopyrightHeaderRule(node); - //node = ApplyNewLineAboveRule(node); - //node = ApplyUsingLocationRule(node); - - //Just to make VS copy the dll to output folder. - Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions a = Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions.Ignore; - - var node = Formatter.Format(root, new AdhocWorkspace()); - - return node.ToString(); - } - - //private static SyntaxNode ApplyUsingLocationRule(SyntaxNode node) - //{ - // UsingLocationRule rule = new UsingLocationRule(); - // return rule.Process(node, "CSharp"); - //} - - //private static SyntaxNode ApplyBraceNewLineRule(SyntaxNode node) - //{ - // BraceNewLineRule rule = new BraceNewLineRule(); - // return rule.Process(node, "CSharp"); - //} - - //private static SyntaxNode ApplyNewLineAboveRule(SyntaxNode node) - //{ - // NewLineAboveRule rule = new NewLineAboveRule(); - // return rule.Process(node, "CSharp"); - //} - - //private static SyntaxNode ApplyCopyrightHeaderRule(SyntaxNode node) - //{ - // CopyrightHeaderRule rule = new CopyrightHeaderRule(new Microsoft.DotNet.CodeFormatting.Options() - // { - - // }); - - // return rule.ProcessCSharp(node); - //} - } -} |
