[svn] r6947: nemerle/trunk/ncc/hierarchy/TypeBuilder.n vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Comp...

IT svnadmin at nemerle.org
Sun Nov 19 01:01:01 CET 2006


Log:
Hints for base classes and interfaces.

Author: IT
Date: Sun Nov 19 01:00:55 2006
New Revision: 6947

Modified:
   nemerle/trunk/ncc/hierarchy/TypeBuilder.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/CompletionElem.n
   vs-plugin/trunk/Nemerle.VSIP.sln

Modified: nemerle/trunk/ncc/hierarchy/TypeBuilder.n
==============================================================================
--- nemerle/trunk/ncc/hierarchy/TypeBuilder.n	(original)
+++ nemerle/trunk/ncc/hierarchy/TypeBuilder.n	Sun Nov 19 01:00:55 2006
@@ -83,7 +83,7 @@
   {
     get
     {
-      System.Diagnostics.Trace.Assert(!Manager.IsInCompletionMode);
+      System.Diagnostics.Trace.Assert(Manager.IsInCompletionMode);
       pt_tydecl :: partial_parts
     }
   }

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	Sun Nov 19 01:00:55 2006
@@ -197,7 +197,32 @@
             (pb.Location,        null, pb)
 
       | tb is TypeBuilder       => (tb.Location,      null, tb)
-      | null                    => (Location.Default, null, null)
+      | null                    => 
+
+        def part = typeBuilder.AstParts.Find(
+          p => p is TopDeclaration.Class && p.Location.FileIndex == fileIndex && p.Location.Contains(line, col));
+
+        match (part)
+        {
+        | Some(Class(ext, _)) => 
+
+          match (ext.Find(ex => ex.Location.Contains(line, col)))
+          {
+          | Some(ex) => 
+
+            def mt = typeBuilder.MonoBindType(ex);
+
+            if (mt.Equals(typeBuilder.InternalType.Void) || mt.Equals(typeBuilder.InternalType.Object))
+              (Location.Default, null, null)
+            else
+              (ex.Location, null, mt)
+
+          | _        => (Location.Default, null, null)
+          }
+
+        | _ => (Location.Default, null, null)
+        }
+
       | _                       =>
         Trace.Assert(false, $"Unknown member type '$member'.");
         throw System.Exception($"Unknown member type '$member'.");
@@ -249,13 +274,13 @@
 
       match (tObj)
       {
-      | me is TExpr.MacroEnvelope         => [(GotoInfo(me))]
-      | lv is LocalValue                  => [(GotoInfo(lv))]
+      | me is TExpr.MacroEnvelope         => [GotoInfo(me)]
+      | lv is LocalValue                  => [GotoInfo(lv)]
       | tc is TExpr.ImplicitValueTypeCtor => getTypeGotoInfo(tc.ty)
       | tv is TyVar                       => getTypeGotoInfo(tv)
       | tb is TypeBuilder                 => tb.PartsLocation.Map(GotoInfo);
-      | fh is Typedtree.Fun_header        => [(GotoInfo(fh))]
-      | m  is IMember                     => [(GotoInfo(m))]
+      | fh is Typedtree.Fun_header        => [GotoInfo(fh)]
+      | m  is IMember                     => [GotoInfo(m)]
       | _                                 => []
       }
     }
@@ -390,12 +415,29 @@
               {
                 def members = List();
 
+                mutable l = int.MaxValue;
+
                 foreach (elem in result.Elems)
                 {
                 | Overloads(values) =>
 
                   foreach (overload in values)
-                    match (overload.Member) { | m is IMethod => members.Add(m); | _ => () }
+                  {
+                    match (overload.Member)
+                    {
+                    | m is IMethod => 
+
+                      when (l > m.Name.Length)
+                      {
+                        l = m.Name.Length;
+                        members.Clear();
+                      }
+
+                      members.Add(m);
+
+                    | _            => ()
+                    }
+                  }
 
                 | _ => ()
                 }

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/CompletionElem.n
==============================================================================

Modified: vs-plugin/trunk/Nemerle.VSIP.sln
==============================================================================
--- vs-plugin/trunk/Nemerle.VSIP.sln	(original)
+++ vs-plugin/trunk/Nemerle.VSIP.sln	Sun Nov 19 01:00:55 2006
@@ -11,6 +11,9 @@
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nemerle.Compiler.Utils", "Nemerle.Compiler.Utils\Nemerle.Compiler.Utils.csproj", "{DBC77173-9367-485F-B425-74E6D6AB3F82}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleTest", "ConsoleTest\ConsoleTest.csproj", "{D5EB7C03-398D-4C41-91C9-4ED474CC1312}"
+	ProjectSection(ProjectDependencies) = postProject
+		{DBC77173-9367-485F-B425-74E6D6AB3F82} = {DBC77173-9367-485F-B425-74E6D6AB3F82}
+	EndProjectSection
 EndProject
 Global
 	GlobalSection(DPCodeReviewSolutionGUID) = preSolution



More information about the svn mailing list