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

pbludov svnadmin at nemerle.org
Thu Oct 19 10:03:10 CEST 2006


Log:
Goto macro source.

Author: pbludov
Date: Thu Oct 19 10:03:05 2006
New Revision: 6770

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GotoInfo.n
   vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleAuthoringScope.cs
   vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs
   vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.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 19 10:03:05 2006
@@ -14,11 +14,11 @@
     [Accessor] mutable _lineEnd   : int;
     [Accessor] mutable _colStart  : int;
     [Accessor] mutable _colEnd    : int;
-    [Accessor] mutable _member    : IMember;
+    [Accessor] mutable _member    : System.Reflection.MemberInfo;
 
     public this(member : IMember)
     {
-      _member = member;
+      _member = member.GetHandle();
 
       SetLocation(member.Location);
     }
@@ -40,6 +40,17 @@
 
     public this(_mc : PExpr.MacroCall, _texpr : TExpr)
     {
+      def t =
+
+      match (_mc.ns.Value)
+      {
+      | MacroCall(m) => m.GetType();
+      | _ => throw ArgumentException("mc");
+      }
+
+      _lineEnd  = -1;
+      _filePath = t.Assembly.Location;
+      _member   = t.GetConstructor(Type.EmptyTypes);
     }
 
     private SetLocation(location : Location) : void

Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleAuthoringScope.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleAuthoringScope.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleAuthoringScope.cs	Thu Oct 19 10:03:05 2006
@@ -112,7 +112,7 @@
 					{
 						mdiPtr                = Marshal.GetIUnknownForObject(mdiUnk);
 
-						SymbolToken    token  = new SymbolToken(info.Member.GetHandle().MetadataToken);
+						SymbolToken    token  = new SymbolToken(info.Member.MetadataToken);
 						ISymbolBinder1 binder = new SymBinder();
 						ISymbolReader  reader = binder.GetReader(mdiPtr, info.FilePath, null);
 						ISymbolMethod  method = reader.GetMethod(token);

Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs	Thu Oct 19 10:03:05 2006
@@ -195,7 +195,7 @@
 				case ParseReason.MatchBraces:
 				case ParseReason.None:
 				case ParseReason.MemberSelectAndHighlightBraces: 
-					Trace.WriteLine("Reson '" + request.Reason + "' not handled.");
+					Trace.WriteLine("Request reason '" + request.Reason + "' not handled.");
 					break;
 			}
 

Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs	Thu Oct 19 10:03:05 2006
@@ -1,6 +1,5 @@
 using System;
 using System.Collections;
-using System.Collections.Generic;
 using System.Diagnostics;
 using System.Globalization;
 using System.Runtime.InteropServices;
@@ -8,8 +7,6 @@
 using Microsoft.VisualStudio;
 using Microsoft.VisualStudio.Package;
 using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.Shell.Interop;
 
 using Nemerle.VisualStudio.Project;
 
@@ -60,6 +57,9 @@
 			string      fileName    = GetFilePath();
 			ProjectInfo projectInfo = ProjectInfo.FindProject(fileName);
 
+			if (null == projectInfo)
+				return;
+
 			for (int i = 0; i < lineChange.Length; i++)
 			{
 				TextLineChange changes = lineChange[i];
@@ -115,10 +115,7 @@
 				ArrayList regions = new ArrayList();
 				ArrayList spans   = new ArrayList();
 
-				uint nr;
-				int  ret = ppenum.GetCount(out nr);
-
-				while ((ret=ppenum.Next(1, aregion, out fetched)) == NativeMethods.S_OK && fetched == 1)
+				while ((ppenum.Next(1, aregion, out fetched)) == NativeMethods.S_OK && fetched == 1)
 				{
 					NativeMethods.ThrowOnFailure(aregion[0].GetSpan(aspan));
 



More information about the svn mailing list