[svn] r6588: vs-plugin/trunk/Nemerle.Compiler.Utils:
Nemerle.Completion2/CodeModel/Project.MakeCompletionL...
VladD2
svnadmin at nemerle.org
Mon Aug 28 15:52:58 CEST 2006
Log:
Fix support nested class in completion engine.
Author: VladD2
Date: Mon Aug 28 15:52:52 2006
New Revision: 6588
Modified:
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.MakeCompletionList.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.MakeCompletionList.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.MakeCompletionList.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.MakeCompletionList.n Mon Aug 28 15:52:52 2006
@@ -28,7 +28,7 @@
{
when (IsValid(member))
//Fixme: member.GetName() don't compile.
- add (Completion.GetName(member), Elem.Member(member))
+ add (member.GetName(), Elem.Member(member))
}
foreach (elem in result.Elems)
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n Mon Aug 28 15:52:52 2006
@@ -155,7 +155,12 @@
*/
null
}
- | _ => throw System.Exception($"Unknown member type '$member'.");
+ | tb is TypeBuilder =>
+ Trace.Assert(false, $"TypeBuilder ($tb) not supported yet.");
+ null
+ | _ =>
+ Trace.Assert(false, $"Unknown member type '$member'.");
+ throw System.Exception($"Unknown member type '$member'.");
}
}
} // end class Project
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n Mon Aug 28 15:52:52 2006
@@ -156,19 +156,31 @@
public GetActiveMember(this typeBuilder : TypeBuilder,
fileIndex : int, line : int, col : int) : IMember
- {
- def members = typeBuilder.GetMembers(BindingFlags.Static
- %| BindingFlags.Instance %| BindingFlags.Public
- %| BindingFlags.NonPublic %| BindingFlags.DeclaredOnly);
-
- def loop(members)
+ { //FixMe: if remove type annotation ( : list[IMember]) code will not compile.
+ def loop(members : list[IMember])
{
| member :: tail =>
+ match (member)
+ {
+ | tb is TypeBuilder =>
+ if (tb.Location.Contains(fileIndex, line, col))
+ GetActiveMember(tb, fileIndex, line, col);
+ else
+ loop(tail)
+
+ | _ =>
+ //when (typeBuilder.Name == "SourceCollection") //member.Name == ".ctor"
+ // Trace.Assert(false);
if (member.Location.Contains(fileIndex, line, col)) member else loop(tail)
+ }
| [] => null
}
+ def members = typeBuilder.GetMembers(BindingFlags.Static
+ %| BindingFlags.Instance %| BindingFlags.Public
+ %| BindingFlags.NonPublic %| BindingFlags.DeclaredOnly);
+
loop(members);
}
More information about the svn
mailing list