Skip to content

Commit efb76d5

Browse files
committed
added coloring
1 parent fbb6923 commit efb76d5

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/ScriptCs.Core/Extensions/TypeExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal static class TypeExtensions
1010
{
1111
internal static IEnumerable<MethodInfo> GetExtensionMethods(this Type type)
1212
{
13-
return AppDomain.CurrentDomain.GetAssemblies().SelectMany(x => x.GetTypes()).Where(x => !x.IsGenericType && !x.IsNested && x.IsSealed).
13+
return type.Assembly.GetExportedTypes().Where(x => !x.IsGenericType && !x.IsNested && x.IsSealed).
1414
SelectMany(x => x.GetMethods(BindingFlags.Static | BindingFlags.Public)).Where(x => x.IsDefined(typeof(ExtensionAttribute), false)).
1515
Where(x => x.GetParameters()[0].ParameterType == type);
1616
}

src/ScriptCs.Core/ReplCommands/ScriptPacksCommand.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Reflection;
5-
using System.Runtime.CompilerServices;
65
using System.Text;
76
using ScriptCs.Contracts;
87
using ScriptCs.Extensions;
@@ -38,11 +37,15 @@ public object Execute(IRepl repl, object[] args)
3837
}
3938

4039
var importedNamespaces = repl.Namespaces.Union(repl.ScriptPackSession.Namespaces).ToArray();
40+
var originalColor = _console.ForegroundColor;
4141

4242
foreach (var packContext in packContexts)
4343
{
4444
var contextType = packContext.GetType();
45+
46+
_console.ForegroundColor = ConsoleColor.Yellow;
4547
_console.WriteLine(contextType.ToString());
48+
_console.ForegroundColor = originalColor;
4649

4750
var methods = contextType.GetAllMethods();
4851
var properties = contextType.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly);

src/ScriptCs/ScriptCs.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<DebugSymbols>true</DebugSymbols>
3434
<DebugType>full</DebugType>
3535
<Optimize>false</Optimize>
36-
<OutputPath>..\..\..\..\..\..\..\test3\</OutputPath>
36+
<OutputPath>bin\debug\</OutputPath>
3737
<DefineConstants>DEBUG;TRACE</DefineConstants>
3838
<ErrorReport>prompt</ErrorReport>
3939
<WarningLevel>4</WarningLevel>

0 commit comments

Comments
 (0)