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

VladD2 svnadmin at nemerle.org
Wed Nov 15 03:44:53 CET 2006


Log:
Refactoring

Author: VladD2
Date: Wed Nov 15 03:44:48 2006
New Revision: 6898

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TraceWriter.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n
   vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleLanguageService.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Project/ProjectInfo.cs

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	Wed Nov 15 03:44:48 2006
@@ -140,10 +140,8 @@
 
         def ast = method.Ast;
 
-        if (ast.Body.Location.Contains(line, col))
-        {
-          ExprFinder().Find(method.GetParsedBody(), method.GetTypedBody(), line, col);
-        }
+        if (method.BodyLocation.Contains(line, col))
+          ExprFinder().Find(method.BodyParsed, method.BodyTyped, line, col);
         else if (ast.header.Location.Contains(line, col))
         {
           if (ast.header.ret_type.Location.Contains(line, col))

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n	Wed Nov 15 03:44:48 2006
@@ -29,7 +29,7 @@
       {
         _currentMessages = SCG.List(32);
 
-        Trace.WriteLine("### Build types tree!");
+        Trace.WriteLine(">>>> ##### Build types tree!");
         Instance = this;
         Init();
 
@@ -128,6 +128,7 @@
 
         _rowProject = _project;
 #pragma warning restore 618 // Obsolete
+        Trace.WriteLine("<<<< ##### Build types tree finish!");
       }
       finally
       {

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TraceWriter.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TraceWriter.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TraceWriter.n	Wed Nov 15 03:44:48 2006
@@ -23,7 +23,8 @@
           $"$m1($m2,$m3,$m4,$m5):$m6"
         | _ => value
       }
-      Trace.Write(result);
+      //Trace.Write(result);
+      _ = result;
     }
 
     public override WriteLine(value : string) : void

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	Wed Nov 15 03:44:48 2006
@@ -25,16 +25,6 @@
         startIndex, CompareOptions.Ordinal);
     }
 
-    public GetParsedBody(this /*[NotNull]*/ method : MethodBuilder) : PExpr
-    {
-      method.BodyParsed
-    }
-
-    public GetTypedBody(this /*[NotNull]*/ method : MethodBuilder) : TExpr
-    {
-      method.BodyTyped
-    }
-
     public IsNullOrEmpty(this value : string) : bool
     {
       if (value == null) true else value.Length == 0

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	Wed Nov 15 03:44:48 2006
@@ -226,7 +226,14 @@
 
 		private AuthoringScope Check(ParseRequest request)
 		{
+			//return null;
+			Trace.WriteLine(">>>> ##### Check!");
+			try
+			{
+
 			ProjectInfo projectInfo = ProjectInfo.FindProject(request.FileName);
+				Nemerle.Completion2.Project p = projectInfo.Engine.Project;
+				Trace.Assert(p != null);
 
 			if (projectInfo == null)
 				return null;
@@ -238,7 +245,7 @@
 
 			request.Sink.ProcessHiddenRegions = true;
 
-			projectInfo.UpdateFile(request);
+				//projectInfo.UpdateFile(request);
 
 			projectInfo.Project.Check(
 				request.FileName,
@@ -254,10 +261,10 @@
 						r.tsHiddenText = Convert(location);
 						r.iType        = (int)HIDDEN_REGION_TYPE.hrtCollapsible;
 						r.dwBehavior   = (int)HIDDEN_REGION_BEHAVIOR.hrbEditorControlled; //.hrbClientControlled;
-						r.pszBanner    = string.IsNullOrEmpty(text)? null: text;
+							r.pszBanner = string.IsNullOrEmpty(text) ? null : text;
 						r.dwClient     = 25;
-						r.dwState      = (uint)(allExpanded || isExpanded?
-							HIDDEN_REGION_STATE.hrsExpanded: HIDDEN_REGION_STATE.hrsDefault);
+							r.dwState = (uint)(allExpanded || isExpanded ?
+								HIDDEN_REGION_STATE.hrsExpanded : HIDDEN_REGION_STATE.hrsDefault);
 
 						request.Sink.AddHiddenRegion(r);
 					}
@@ -284,6 +291,16 @@
 
 			return GetDefaultScope(request);
 		}
+			catch (Exception e)
+			{
+				Trace.WriteLine("!!! Check() throw Exception " + e.Message);
+				throw;
+			}
+			finally
+			{
+				Trace.WriteLine("<<<< ##### Check!");
+			}
+		}
 
 		private AuthoringScope GetMethodScope(ParseRequest request)
 		{

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	Wed Nov 15 03:44:48 2006
@@ -362,32 +362,45 @@
 		{
 			ErrorHelper.ThrowIfPathNullOrEmpty(filePath, "filePath");
 
+			Trace.WriteLine(">>>> ##### GetQuickTip!");
+
 			QuickTipInfo info = Project.GetQuickTipInfo(filePath, line + 1, col + 1);
 
 			if (info != null)
 				info.Text = info.Text.Replace(_projectLocation, "");
 
+			Trace.WriteLine("<<<< ##### GetQuickTip!");
+
 			return info;
 		}
 
 		public GotoInfo[] GetGoto(string filePath, int line, int col, ISource source)
 		{
+			Trace.WriteLine(">>>> ##### GetGoto!");
 			ErrorHelper.ThrowIfPathNullOrEmpty(filePath, "filePath");
-			return Project.GetGotoInfo(filePath, line + 1, col + 1);
+			GotoInfo[] result = Project.GetGotoInfo(filePath, line + 1, col + 1);
+			Trace.WriteLine("<<<< ##### GetGoto!");
+			return result;
 		}
 
 		public GotoInfo[] GetUsages(string filePath, int line, int col, ISource source)
 		{
+			Trace.WriteLine(">>>> ##### GetUsages!");
 			ErrorHelper.ThrowIfPathNullOrEmpty(filePath, "filePath");
-			return Project.GetUsages(filePath, line + 1, col + 1);
+			GotoInfo[] result = Project.GetUsages(filePath, line + 1, col + 1);
+			Trace.WriteLine("<<<< ##### GetUsages!");
+			return result;
 		}
 
 		public NemerleMethods GetMethodTip(string filePath, int line, int col, ISource source)
 		{
+			Trace.WriteLine(">>>> ##### GetMethodTip!");
 			ErrorHelper.ThrowIfPathNullOrEmpty(filePath, "filePath");
 
 			MethodTipInfo info = Project.GetMethodTip(filePath, line + 1, col + 1, source);
-			return info != null? new NemerleMethods(info): null;
+			NemerleMethods result = info != null ? new NemerleMethods(info): null;
+			Trace.WriteLine("<<<< ##### GetMethodTip!");
+			return result;
 		}
 	}
 }



More information about the svn mailing list