Skip to content

Commit 6b6c347

Browse files
committed
Fixes #82
1 parent fd8abcb commit 6b6c347

5 files changed

Lines changed: 28 additions & 10 deletions

File tree

Visualizer.Shared/Util/Extensions/CallSiteBinder.cs renamed to Shared/Util/Extensions/CallSiteBinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Dynamic;
33
using System.Runtime.CompilerServices;
44

5-
namespace ExpressionTreeVisualizer.Util {
5+
namespace ExpressionToString.Util {
66
public static class CallSiteBinderExtensions {
77
public static string BinderType(this CallSiteBinder callSiteBinder) {
88
switch (callSiteBinder) {

Shared/Util/Extensions/IEnumerableTuple.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ public static IEnumerable<TResult> SelectT<T1, T2, TResult>(this IEnumerable<Val
1919
src.Select(x => selector(x.Item1, x.Item2));
2020
public static IEnumerable<TResult> SelectT<T1, T2, T3, TResult>(this IEnumerable<ValueTuple<T1, T2, T3>> src, Func<T1, T2, T3, TResult> selector) =>
2121
src.Select(x => selector(x.Item1, x.Item2, x.Item3));
22+
public static IEnumerable<(T1, T2)> WhereT<T1, T2>(this IEnumerable<(T1, T2)> src, Func<T1, T2, bool> predicate) => src.Where(x => predicate(x.Item1, x.Item2));
2223
}
2324
}

Tests.DotNetCore/Tests.DotNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
1616
<PackageReference Include="Pather.CSharp" Version="2.1.0" />
1717
<PackageReference Include="xunit" Version="2.4.1" />
1818
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">

Visualizer.Shared/Visualizer.Shared.projitems

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<ItemGroup>
1212
<Compile Include="$(MSBuildThisFileDirectory)Converters.cs" />
1313
<Compile Include="$(MSBuildThisFileDirectory)ExpressionRootPrompt.xaml.cs" />
14-
<Compile Include="$(MSBuildThisFileDirectory)Util\Extensions\CallSiteBinder.cs" />
1514
<Compile Include="$(MSBuildThisFileDirectory)Util\Extensions\DependencyObject.cs" />
1615
<Compile Include="$(MSBuildThisFileDirectory)Util\Extensions\MultiSelector.cs" />
1716
<Compile Include="$(MSBuildThisFileDirectory)Util\Extensions\MultiSelectTreeView.cs" />

Visualizer.Shared/VisualizerData.cs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
using static ExpressionToString.FormatterNames;
1111
using System.Collections;
1212
using System.Runtime.CompilerServices;
13-
using ExpressionTreeVisualizer.Util;
1413
using static ExpressionToString.Globals;
1514
using System.Reflection;
1615
using System.Diagnostics;
16+
using System.Diagnostics.CodeAnalysis;
1717

1818
namespace ExpressionTreeVisualizer {
1919
[Serializable]
@@ -284,8 +284,8 @@ internal ExpressionNodeData(object o, (string aggregatePath, string pathFromPare
284284
return new[] { (prp.Name, prp.GetValue(o), prp) };
285285
}
286286
})
287-
.Where(x => x.Item2 != null)
288-
.Select(x => new ExpressionNodeData(x.Item2, (FullPath ?? "", x.Item1), visualizerData, false, x.Item3, WatchExpressionFormatString))
287+
.Where(x => x.x != null)
288+
.SelectT((relativePath, o1, prp) => new ExpressionNodeData(o1, (FullPath ?? "", relativePath), visualizerData, false, prp, WatchExpressionFormatString))
289289
.ToList();
290290

291291
// populate URLs
@@ -350,11 +350,29 @@ public void ClearSelection() {
350350
}
351351

352352
[Serializable]
353+
[SuppressMessage("", "IDE0032", Justification = "https://github.com/dotnet/core/issues/2981")]
353354
public struct EndNodeData {
354-
public string Closure { get; set; }
355-
public string Name { get; set; }
356-
public string Type { get; set; }
357-
public string Value { get; set; }
355+
private string _closure;
356+
private string _name;
357+
private string _type;
358+
private string _value;
359+
360+
public string Closure {
361+
get => _closure;
362+
set => _closure = value;
363+
}
364+
public string Name {
365+
get => _name;
366+
set => _name = value;
367+
}
368+
public string Type {
369+
get => _type;
370+
set => _type = value;
371+
}
372+
public string Value {
373+
get => _value;
374+
set => _value = value;
375+
}
358376
}
359377

360378
public enum EndNodeTypes {

0 commit comments

Comments
 (0)