Skip to content

Commit 2b1264f

Browse files
authored
Merge pull request #52 from eirannejad/master
Better Code Completion Results
2 parents 72c10dc + 16d6a8a commit 2b1264f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

PythonConsoleControl/PythonConsoleCompletionDataProvider.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ public ICompletionData[] GenerateCompletionData(string line)
5757
//IList<string> members = commandLine.ScriptScope.Engine.Operations.GetMemberNames(value);
5858
Type type = TryGetType(name);
5959
// Use Reflection for everything except in-built Python types and COM pbjects.
60-
if (type != null && type.Namespace != "IronPython.Runtime" && (type.Name != "__ComObject"))
60+
if (type != null && type.Namespace != "IronPython.Runtime" && !type.FullName.Contains("IronPython.NewTypes") && (type.Name != "__ComObject"))
6161
{
6262
PopulateFromCLRType(items, type, name);
6363
}
6464
else
6565
{
66-
string dirCommand = "dir(" + name + ")";
66+
//string dirCommand = "dir(" + name + ")";
67+
string dirCommand = "sorted([m for m in dir(" + name + ") if not m.startswith('__')], key = str.lower) + sorted([m for m in dir(" + name + ") if m.startswith('__')])";
6768
object value = commandLine.ScriptScope.Engine.CreateScriptSourceFromString(dirCommand, SourceCodeKind.Expression).Execute(commandLine.ScriptScope);
6869
AutocompletionInProgress = false;
6970
foreach (object member in (value as IronPython.Runtime.List))

0 commit comments

Comments
 (0)