[svn] r7026: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel: GotoInfo.n Project.Type...

pbludov svnadmin at nemerle.org
Thu Nov 30 12:10:33 CET 2006


Log:
Goto member name location instead of member location.

Author: pbludov
Date: Thu Nov 30 12:10:30 2006
New Revision: 7026

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GotoInfo.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GotoInfo.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GotoInfo.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GotoInfo.n	Thu Nov 30 12:10:30 2006
@@ -64,7 +64,11 @@
 
     public this(member : IMember)
     {
-      this(member.Location);
+      match (member)
+      {
+      | mb is MemberBuilder => this(mb.Ast.name.Location)
+      | _                   => this(member.Location)
+      }
 
       unless (HasLocation)
         _member = member.GetHandle();
@@ -117,7 +121,7 @@
       def typeOfMacro = macroEnvelope.the_macro.GetType();
 
       _filePath = typeOfMacro.Assembly.GetLocalPath();
-      _member   = typeOfMacro.GetConstructor(Type.EmptyTypes);
+      _member   = typeOfMacro;
     }
 
     public this(macroEnvelope : TExpr.MacroEnvelope, usageType : UsageType)

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	Thu Nov 30 12:10:30 2006
@@ -201,7 +201,7 @@
 
       match (member)
       {
-      | method is MethodBuilder => getMethod(method)
+      | mb is MethodBuilder   => getMethod(mb)
       | fb is FieldBuilder      => 
 
         if (typeDecl.Builder.IsEnum)
@@ -323,7 +323,7 @@
 
       def getTypeGotoInfo(tv) 
       {
-      | MType.Class(ty is TypeBuilder, _) => ty.PartsLocation.Map(GotoInfo);
+      | MType.Class(ty is TypeBuilder, _) => ty.AstParts.Map(p => GotoInfo(p.name.Location));
       | MType.Class(ty, _)                => [GotoInfo(ty)]
       | _                                 => []
       }

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n	Thu Nov 30 12:10:30 2006
@@ -244,17 +244,20 @@
       {
         def lst = 
           if (isType)
-            typeBuilder.PartsLocation.Map(GotoInfo);
-          else
-            if (typeBuilder.LookupMemberAvailable)
+            typeBuilder.AstParts.Map(p => GotoInfo(p.name.Location))
+          else if (typeBuilder.LookupMemberAvailable)
               typeBuilder.GetMembers()      .Filter(m => m.Name == member.Name).Map(GotoInfo);
             else
               typeBuilder.GetParsedMembers().Filter(m => m.Name == member.Name).Map(GotoInfo);
-        lst.ToArray();
+
+        lst.ToArray()
       }
       else
+      {
+        Debug.Fail($"Type builder $fullName not found");
         null
     }
+    }
 
     public GetUsages([NotNull] filePath : string, line : int, col : int) : array [GotoInfo]
     {



More information about the svn mailing list