[svn] r6789: vs-plugin/trunk: Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GotoInfo.n Nemerle.Comp...

pbludov svnadmin at nemerle.org
Thu Oct 26 08:20:42 CEST 2006


Log:
Changes in GotoInfo

Author: pbludov
Date: Thu Oct 26 08:20:37 2006
New Revision: 6789

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GotoInfo.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/NemerleCodeDomProvider.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n
   vs-plugin/trunk/Nemerle.VsIntegration/Project/ProjectInfo.cs

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 Oct 26 08:20:37 2006
@@ -4,6 +4,7 @@
 using Nemerle.Compiler;
 using Nemerle.Compiler.Typedtree;
 using Nemerle.Compiler.Parsetree;
+using Nemerle.Compiler.Utils;
 
 namespace Nemerle.Completion2
 {
@@ -18,9 +19,23 @@
 
     public this(member : IMember)
     {
-      _member = member.GetHandle();
-
       SetLocation(member.Location);
+
+      unless (HasLocation)
+      {
+        if (member is IMethod)
+        {
+          // Methods are navigable through a .pdb
+          //
+          _member = member.GetHandle();
+        }
+        else
+        {
+          // TODO:
+          // For fields: Lookup type, find ctor or any other method and go to it.
+          // For properties & events: Go to getter/setter/adder/etc
+        }
+      }
     }
 
     public this(value : LocalValue)
@@ -49,7 +64,7 @@
       }
 
       _lineEnd  = -1;
-      _filePath = t.Assembly.Location;
+      _filePath = t.Assembly.GetLocalPath();
       _member   = t.GetConstructor(Type.EmptyTypes);
     }
 

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/NemerleCodeDomProvider.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/NemerleCodeDomProvider.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/NemerleCodeDomProvider.n	Thu Oct 26 08:20:37 2006
@@ -39,7 +39,7 @@
       // Obsolete
 #pragma warning disable 618
       provider.CreateGenerator();
-  #pragma warning restore 618
+#pragma warning restore 618
     }
 
     [Obsolete("Callers should not use the ICodeCompiler interface.")]

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	Thu Oct 26 08:20:37 2006
@@ -452,5 +452,11 @@
     {
       loc.EndLine == 0 || loc.EndLine < loc.Line || (loc.EndLine == loc.Line && loc.EndColumn <= loc.Column)
     }
+
+    public GetLocalPath(this asm : Assembly) : string
+    {
+       Uri(asm.CodeBase).LocalPath;
+    }
+
   } // End of Utils module
 } // End of namespace

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Project/ProjectInfo.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Project/ProjectInfo.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Project/ProjectInfo.cs	Thu Oct 26 08:20:37 2006
@@ -61,7 +61,11 @@
 		}
 
 		private Engine _engine;
-		public  Engine  Engine { get { return _engine; } }
+		public  Engine  Engine
+		{
+			[DebuggerStepThrough]
+			get { return _engine; }
+		}
 
 		private NemerleProjectNode _projectNode;
 		public  NemerleProjectNode  ProjectNode { get { return _projectNode; } }
@@ -317,6 +321,7 @@
 
 		public Nemerle.Completion2.Project Project
 		{
+			[DebuggerStepThrough]
 			get { return Engine.Project; }
 		}
 



More information about the svn mailing list