Skip to content

Commit

Permalink
WIP #33
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitz committed Nov 21, 2019
1 parent 96fb04c commit 2423fbc
Show file tree
Hide file tree
Showing 26 changed files with 37,430 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Runtime.Standard/Runtime.Standard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="Costura.Fody" Version="4.1.0" />
<PackageReference Include="Fody" Version="6.0.4">
<PackageReference Include="Fody" Version="6.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
5 changes: 4 additions & 1 deletion Runtime/Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="Costura.Fody" Version="4.1.0" />
<PackageReference Include="Fody" Version="6.0.4">
<PackageReference Include="Fody" Version="6.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -50,6 +50,9 @@
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Rubberduck.Parsing">
<HintPath>..\..\rubberduck-vba\Rubberduck\Rubberduck.Parsing\bin\Debug\net46\Rubberduck.Parsing.dll</HintPath>
</Reference>
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Shared/Models/VisualizerData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public VisualizerData(object o, Config config) {
Config = config;

Type[] types;
T createInstance<T>(string typename, object[]? args = null) =>
(T)Activator.CreateInstance(types.Single(x => x.FullName == typename), args);
T createInstance<T>(string typename, object[]? args = null) =>
types.Single(x => x.FullName == typename).CreateInstance<T>(args);

{
var baseTypes = new[] { typeof(Parser), typeof(Lexer) };
Expand Down
7 changes: 7 additions & 0 deletions Shared/Util/Extensions/IEnumerableTuple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,12 @@ public static string Joined<T1, T2>(this IEnumerable<(T1, T2)> src, string delim
public static Dictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerable<(TKey, TValue)> src) => src.ToDictionary(t => t.Item1, t => t.Item2);

public static void Add<T1, T2>(this List<(T1, T2)> lst, T1 item1, T2 item2) => lst.Add((item1, item2));

public static IEnumerable<TResult> SelectT<T1, T2, TResult>(this IEnumerable<(T1, T2)> src, Func<T1, T2, TResult> selector) =>
src.Select(x => selector(x.Item1, x.Item2));
public static IEnumerable<TResult> SelectT<T1, T2, T3, TResult>(this IEnumerable<(T1, T2, T3)> src, Func<T1, T2, T3, TResult> selector) =>
src.Select(x => selector(x.Item1, x.Item2));
public static IEnumerable<TResult> SelectT<T1, T2, , T3, T4, TResult>(this IEnumerable<(T1, T2, T3, T4)> src, Func<T1, T2, T3, T4, TResult> selector) =>
src.Select(x => selector(x.Item1, x.Item2, x.Item3, x.Item4));
}
}
3 changes: 2 additions & 1 deletion Shared/Util/Extensions/Type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static bool IsAnonymous(this Type type) =>
};

public static string FriendlyName(this Type type) {
if (type.IsClosureClass()) { return "<closure>" ; }
if (type.IsClosureClass()) { return "<closure>"; }

if (type.IsAnonymous()) {
return "{ " + type.GetProperties().Joined(", ", p => {
Expand Down Expand Up @@ -131,5 +131,6 @@ public static bool IsTupleType(this Type type) {

public static bool InheritsFromOrImplementsAny(this Type type, IEnumerable<Type> types) => types.Any(t => t.IsAssignableFrom(type));
public static bool InheritsFromOrImplementsAny(this Type type, params Type[] types) => types.Any(t => t.IsAssignableFrom(type));
public static T CreateInstance<T>(this Type type, object[]? args = null) => (T)Activator.CreateInstance(type, args);
}
}
13 changes: 0 additions & 13 deletions Tests.Framework/TestClass.cs

This file was deleted.

15 changes: 0 additions & 15 deletions Tests.Framework/Tests.Framework.csproj

This file was deleted.

Loading

0 comments on commit 2423fbc

Please sign in to comment.