diff --git a/Debuggee/Debuggee.csproj b/Debuggee/Debuggee.csproj index 4412a7e..a8bfb90 100644 --- a/Debuggee/Debuggee.csproj +++ b/Debuggee/Debuggee.csproj @@ -28,8 +28,8 @@ - - + + ..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.DebuggerVisualizers.dll false diff --git a/Package/Package.csproj b/Package/Package.csproj index 5d11ed6..916af4a 100644 --- a/Package/Package.csproj +++ b/Package/Package.csproj @@ -27,10 +27,10 @@ - + - - + + diff --git a/Serialization/Config.cs b/Serialization/Config.cs index ea2751e..9c41975 100644 --- a/Serialization/Config.cs +++ b/Serialization/Config.cs @@ -2,7 +2,7 @@ using Periscope.Debuggee; #endif using System; -using static ExpressionTreeToString.FormatterNames; +using static ExpressionTreeToString.RendererNames; namespace ExpressionTreeVisualizer.Serialization { [Serializable] diff --git a/Serialization/ExpressionNodeData.cs b/Serialization/ExpressionNodeData.cs index e01be65..0ce9c70 100644 --- a/Serialization/ExpressionNodeData.cs +++ b/Serialization/ExpressionNodeData.cs @@ -3,17 +3,15 @@ using System.Linq; using System.Linq.Expressions; using System.Reflection; -using System.Text; -using System.Threading.Tasks; using ExpressionTreeToString.Util; using static ExpressionTreeVisualizer.Serialization.EndNodeTypes; using static ExpressionTreeToString.Globals; using System.Runtime.CompilerServices; -using static ExpressionTreeToString.FormatterNames; using System.Collections; using ZSpitz.Util; using static ZSpitz.Util.Functions; using ExpressionTreeToString; +using static ZSpitz.Util.Language; namespace ExpressionTreeVisualizer.Serialization { [Serializable] @@ -68,14 +66,14 @@ public class ExpressionNodeData { internal ExpressionNodeData(object o, (string aggregatePath, string pathFromParent) path, VisualizerData visualizerData, ValueExtractor valueExtractor, Dictionary pathSpans, bool isParameterDeclaration = false, PropertyInfo? pi = null, string? parentWatchExpression = null) : this( o, path, - visualizerData.Config.Language, + OneOfStringLanguageExtensions.ResolveLanguage(visualizerData.Config.Language)!.Value, valueExtractor, pathSpans, isParameterDeclaration, pi, parentWatchExpression ) { } private ExpressionNodeData( object o, (string aggregatePath, string pathFromParent) path, - string language, + Language language, ValueExtractor valueExtractor, Dictionary pathSpans, bool isParameterDeclaration = false, PropertyInfo? pi = null, string? parentWatchExpression = null ) { @@ -212,7 +210,7 @@ private ExpressionNodeData( string? factoryMethodName = null; if (o is BinaryExpression || o is UnaryExpression) { - BinaryUnaryMethods.TryGetValue(((Expression)o).NodeType, out factoryMethodName); + Globals.FactoryMethodNames.TryGetValue(((Expression)o).NodeType, out factoryMethodName); } if (factoryMethodName.IsNullOrWhitespace()) { var publicType = o.GetType().BaseTypes(false, true).FirstOrDefault(x => !x.IsInterface && x.IsPublic); diff --git a/Serialization/VisualizerData.cs b/Serialization/VisualizerData.cs index 6cb9a6b..736e10a 100644 --- a/Serialization/VisualizerData.cs +++ b/Serialization/VisualizerData.cs @@ -1,6 +1,5 @@ using ExpressionTreeToString; using System; -using System.Collections.Generic; using System.Linq.Expressions; using ZSpitz.Util; using static ZSpitz.Util.Functions; @@ -17,7 +16,7 @@ public VisualizerData(object o, Config? config = null) { if (!Config.Path.IsNullOrWhitespace()) { o = ((Expression)ResolvePath(o, Config.Path)).ExtractValue(); } - Source = WriterBase.Create(o, Config.Formatter, Config.Language, out var pathSpans).ToString(); + Source = Renderers.Invoke(Config.Formatter, o, Config.Language, out var pathSpans); var valueExtractor = new ValueExtractor(); Root = new ExpressionNodeData(o, ("", ""), this, valueExtractor, pathSpans, false); diff --git a/Tests.Visualizer/Tests.csproj b/Tests.Visualizer/Tests.csproj index 7c365e2..fb4985e 100644 --- a/Tests.Visualizer/Tests.csproj +++ b/Tests.Visualizer/Tests.csproj @@ -9,14 +9,14 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/UI/SettingsControl.xaml.cs b/UI/SettingsControl.xaml.cs index 5a5a550..24904c7 100644 --- a/UI/SettingsControl.xaml.cs +++ b/UI/SettingsControl.xaml.cs @@ -1,11 +1,12 @@ -using static ExpressionTreeToString.FormatterNames; +using static ExpressionTreeToString.Renderers; +using static ZSpitz.Util.LanguageNames; namespace ExpressionTreeVisualizer { public partial class SettingsControl { public SettingsControl() { InitializeComponent(); - cmbFormatters.ItemsSource = new[] { CSharp, VisualBasic, FactoryMethods, ObjectNotation, TextualTree }; + cmbFormatters.ItemsSource = RendererKeys; cmbLanguages.ItemsSource = new[] { CSharp, VisualBasic }; } } diff --git a/Visualizer/Periscope b/Visualizer/Periscope index b635283..364b219 160000 --- a/Visualizer/Periscope +++ b/Visualizer/Periscope @@ -1 +1 @@ -Subproject commit b635283cd73e8e30ab63cae27c2cfa1235ca0e9a +Subproject commit 364b21923d7d63fff79f61fa71f4b0145795d638 diff --git a/Visualizer/Visualizer.csproj b/Visualizer/Visualizer.csproj index d0e654c..3cf2099 100644 --- a/Visualizer/Visualizer.csproj +++ b/Visualizer/Visualizer.csproj @@ -16,12 +16,12 @@ ..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.DebuggerVisualizers.dll false - + - - + +