Skip to content

Commit 2016ff2

Browse files
committed
Update ExpressionTreeToString to 3.0
1 parent 533e234 commit 2016ff2

File tree

9 files changed

+21
-23
lines changed

9 files changed

+21
-23
lines changed

Debuggee/Debuggee.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
</PropertyGroup>
2929

3030
<ItemGroup>
31-
<PackageReference Include="ZSpitz.Util" Version="0.0.42" />
32-
<PackageReference Include="ExpressionTreeToString" Version="2.0.27" />
31+
<PackageReference Include="ZSpitz.Util" Version="0.1.56" />
32+
<PackageReference Include="ExpressionTreeToString" Version="3.0.41" />
3333
<Reference Include="Microsoft.VisualStudio.DebuggerVisualizers">
3434
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.DebuggerVisualizers.dll</HintPath>
3535
<Private>false</Private>

Package/Package.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="ExpressionTreeToString" Version="2.0.27" />
30+
<PackageReference Include="ExpressionTreeToString" Version="3.0.41" />
3131
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
32-
<PackageReference Include="ZSpitz.Util" Version="0.0.42" />
33-
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.0.42" />
32+
<PackageReference Include="ZSpitz.Util" Version="0.1.56" />
33+
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.1.56" />
3434
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
3535
<PackageReference Include="MultiSelectTreeView" Version="1.0.9" />
3636
</ItemGroup>

Serialization/Config.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using Periscope.Debuggee;
33
#endif
44
using System;
5-
using static ExpressionTreeToString.FormatterNames;
5+
using static ExpressionTreeToString.RendererNames;
66

77
namespace ExpressionTreeVisualizer.Serialization {
88
[Serializable]

Serialization/ExpressionNodeData.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
using System.Linq;
44
using System.Linq.Expressions;
55
using System.Reflection;
6-
using System.Text;
7-
using System.Threading.Tasks;
86
using ExpressionTreeToString.Util;
97
using static ExpressionTreeVisualizer.Serialization.EndNodeTypes;
108
using static ExpressionTreeToString.Globals;
119
using System.Runtime.CompilerServices;
12-
using static ExpressionTreeToString.FormatterNames;
1310
using System.Collections;
1411
using ZSpitz.Util;
1512
using static ZSpitz.Util.Functions;
1613
using ExpressionTreeToString;
14+
using static ZSpitz.Util.Language;
1715

1816
namespace ExpressionTreeVisualizer.Serialization {
1917
[Serializable]
@@ -68,14 +66,14 @@ public class ExpressionNodeData {
6866
internal ExpressionNodeData(object o, (string aggregatePath, string pathFromParent) path, VisualizerData visualizerData, ValueExtractor valueExtractor, Dictionary<string, (int start, int length)> pathSpans, bool isParameterDeclaration = false, PropertyInfo? pi = null, string? parentWatchExpression = null) :
6967
this(
7068
o, path,
71-
visualizerData.Config.Language,
69+
OneOfStringLanguageExtensions.ResolveLanguage(visualizerData.Config.Language)!.Value,
7270
valueExtractor,
7371
pathSpans, isParameterDeclaration, pi, parentWatchExpression
7472
) { }
7573

7674
private ExpressionNodeData(
7775
object o, (string aggregatePath, string pathFromParent) path,
78-
string language,
76+
Language language,
7977
ValueExtractor valueExtractor,
8078
Dictionary<string, (int start, int length)> pathSpans, bool isParameterDeclaration = false, PropertyInfo? pi = null, string? parentWatchExpression = null
8179
) {
@@ -212,7 +210,7 @@ private ExpressionNodeData(
212210

213211
string? factoryMethodName = null;
214212
if (o is BinaryExpression || o is UnaryExpression) {
215-
BinaryUnaryMethods.TryGetValue(((Expression)o).NodeType, out factoryMethodName);
213+
Globals.FactoryMethodNames.TryGetValue(((Expression)o).NodeType, out factoryMethodName);
216214
}
217215
if (factoryMethodName.IsNullOrWhitespace()) {
218216
var publicType = o.GetType().BaseTypes(false, true).FirstOrDefault(x => !x.IsInterface && x.IsPublic);

Serialization/VisualizerData.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using ExpressionTreeToString;
22
using System;
3-
using System.Collections.Generic;
43
using System.Linq.Expressions;
54
using ZSpitz.Util;
65
using static ZSpitz.Util.Functions;
@@ -17,7 +16,7 @@ public VisualizerData(object o, Config? config = null) {
1716
if (!Config.Path.IsNullOrWhitespace()) {
1817
o = ((Expression)ResolvePath(o, Config.Path)).ExtractValue();
1918
}
20-
Source = WriterBase.Create(o, Config.Formatter, Config.Language, out var pathSpans).ToString();
19+
Source = Renderers.Invoke(Config.Formatter, o, Config.Language, out var pathSpans);
2120

2221
var valueExtractor = new ValueExtractor();
2322
Root = new ExpressionNodeData(o, ("", ""), this, valueExtractor, pathSpans, false);

Tests.Visualizer/Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="ExpressionTreeToString" Version="2.0.27" />
12+
<PackageReference Include="ExpressionTreeToString" Version="3.0.41" />
1313
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
1414
<PackageReference Include="xunit" Version="2.4.1" />
15-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
15+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
1616
<PrivateAssets>all</PrivateAssets>
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
</PackageReference>
19-
<PackageReference Include="ExpressionTreeTestObjects" Version="1.0.5" />
19+
<PackageReference Include="ExpressionTreeTestObjects" Version="1.0.12" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

UI/SettingsControl.xaml.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
using static ExpressionTreeToString.FormatterNames;
1+
using static ExpressionTreeToString.Renderers;
2+
using static ZSpitz.Util.LanguageNames;
23

34
namespace ExpressionTreeVisualizer {
45
public partial class SettingsControl {
56
public SettingsControl() {
67
InitializeComponent();
78

8-
cmbFormatters.ItemsSource = new[] { CSharp, VisualBasic, FactoryMethods, ObjectNotation, TextualTree };
9+
cmbFormatters.ItemsSource = RendererKeys;
910
cmbLanguages.ItemsSource = new[] { CSharp, VisualBasic };
1011
}
1112
}

Visualizer/Visualizer.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.DebuggerVisualizers.dll</HintPath>
1717
<Private>false</Private>
1818
</Reference>
19-
<PackageReference Include="ExpressionTreeToString" Version="2.0.27" />
19+
<PackageReference Include="ExpressionTreeToString" Version="3.0.41" />
2020
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
2121
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
2222
<PackageReference Include="MultiSelectTreeView" Version="1.0.9" />
23-
<PackageReference Include="ZSpitz.Util" Version="0.0.42" />
24-
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.0.42" />
23+
<PackageReference Include="ZSpitz.Util" Version="0.1.56" />
24+
<PackageReference Include="ZSpitz.Util.Wpf" Version="0.1.56" />
2525
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
2626
<PackageReference Include="Octokit" Version="0.48.0" />
2727
<ProjectReference Include="..\Debuggee\Debuggee.csproj" />

0 commit comments

Comments
 (0)