[svn] r6924: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2: CodeModel/Checker.n CodeModel/Pro...

IT svnadmin at nemerle.org
Fri Nov 17 05:54:06 CET 2006


Log:
Fixed outlining for generated properties.

Author: IT
Date: Fri Nov 17 05:54:03 2006
New Revision: 6924

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n	Fri Nov 17 05:54:03 2006
@@ -278,6 +278,13 @@
         break;
 #endif
 
+      def getter = prop.GetGetter() :> MethodBuilder;
+      def setter = prop.GetSetter() :> MethodBuilder;
+
+      when (getter != null && getter.Location == prop.Location ||
+            getter == null && setter.Location == prop.Location)
+        return;
+
       def loc = ExprWalker().GetLocation(prop.Ast);
       def (line, col) = FindNext(loc.EndLine, loc.EndColumn, "}", true);
       def loc = Location(loc.FileIndex, loc.Line, loc.Column, line, col + 1);
@@ -297,8 +304,8 @@
             true);
       }
 
-      add(prop.GetGetter() :> MethodBuilder);
-      add(prop.GetSetter() :> MethodBuilder);
+      add(getter);
+      add(setter);
     }
 
     mutable _start : int;

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	Fri Nov 17 05:54:03 2006
@@ -138,6 +138,14 @@
           end = ns.Location.Line - 1;
         }
 
+      | Using as us =>
+
+        when (line >= us.NameLocations.Head.Line)
+        {
+          start = us.Location.Line;
+          env   = us.AfterEnv;
+        }
+
       | _ => ()
       }
 
@@ -275,7 +283,18 @@
     )
       : void
     {
+#if !DEBUG
+      try
+      {
+#endif
+
       Checker(this, fileName, source, addHiddenRegion, addError).Check();
+
+#if !DEBUG
+      }
+      catch { _ => () }
+#endif
+
     }
 
     public GetMethodTip(

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n	Fri Nov 17 05:54:03 2006
@@ -194,6 +194,11 @@
     /*
     */
   }/*PropEndLocation*/
+
+  public Test() : void
+  {
+    <[ decl: ]>
+  }
 }
 
 module ClassExtension



More information about the svn mailing list