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

IT svnadmin at nemerle.org
Tue Sep 26 06:13:32 CEST 2006


Log:
Working on regions.

Author: IT
Date: Tue Sep 26 06:13:26 2006
New Revision: 6714

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.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.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n	Tue Sep 26 06:13:26 2006
@@ -1,3 +1,4 @@
+using System;
 using System.Diagnostics;
 
 using Nemerle.Assertions;
@@ -177,15 +178,18 @@
 
           // Get region location.
           //
-          def loc      = method.Location.TrimStart(method.fun_header.Location, true);
+          def loc      = method.Location.TrimStart(method.fun_header.Location, false);
           def bodyCode = getText(loc.Line, loc.Column, loc.EndLine, loc.EndColumn);
 
+          when (!loc.IsEmptyLocation())
+          {
           addHiddenRegion(
             if (bodyCode.Length > 0 && bodyCode[0] == ' ')
               Location(loc.FileIndex, loc.Line, loc.Column + 1, loc.EndLine, loc.EndColumn)
             else
               loc,
-            false);
+              true);
+          }
 
         | _ => ()
         }

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	Tue Sep 26 06:13:26 2006
@@ -447,5 +447,10 @@
       l1.Line   == l2.Line   && l1.EndLine   == l2.EndLine &&
       l1.Column == l2.Column && l1.EndColumn == l2.EndColumn
     }
+
+    public IsEmptyLocation(this loc : Location) : bool
+    {
+      loc.EndLine == 0 || loc.EndLine < loc.Line || (loc.EndLine == loc.Line && loc.EndColumn <= loc.Column)
+    }
   } // End of Utils module
 } // End of namespace

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	Tue Sep 26 06:13:26 2006
@@ -211,7 +211,7 @@
 
 						r.tsHiddenText = Convert(location);
 						r.iType        = (int)HIDDEN_REGION_TYPE.hrtCollapsible;
-						r.dwBehavior   = (int)HIDDEN_REGION_BEHAVIOR.hrbEditorControlled; //hrbClientControlled;
+						r.dwBehavior   = (int)HIDDEN_REGION_BEHAVIOR.hrbEditorControlled; //.hrbClientControlled;
 						r.dwState      = (uint)(isExpanded? HIDDEN_REGION_STATE.hrsExpanded: HIDDEN_REGION_STATE.hrsDefault);
 						r.pszBanner    = null;
 						r.dwClient     = 25;

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	Tue Sep 26 06:13:26 2006
@@ -293,7 +293,6 @@
 			}
 		}
 
-
 		public Nemerle.Completion2.Project Project
 		{
 			get { return Engine.Project; }



More information about the svn mailing list