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

IT svnadmin at nemerle.org
Thu Nov 23 21:35:09 CET 2006


Log:
Restored GoTo functionality for external locations.

Author: IT
Date: Thu Nov 23 21:35:07 2006
New Revision: 6988

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GotoInfo.n

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 Nov 23 21:35:07 2006
@@ -21,31 +21,26 @@
   public class GotoInfo
   {
     [Nemerle.DesignPatterns.ProxyPublicMembers(Include = [Line, Column, EndLine, EndColumn])]
-    [Accessor]
-    location : Location;
+    [Accessor] _location  : Location;
+    [Accessor] _member    : System.Reflection.MemberInfo;
+    [Accessor] _usageType : UsageType = UsageType.Definition;
 
-    filePath : string;
+    _filePath : string;
     
     public FilePath : string
     {
       get
       {
-        if (location.FileIndex > 0)
-          location.File
+        if (_location.FileIndex > 0)
+          _location.File
         else
-          filePath
+          _filePath
       }
     }
 
-    [Accessor]
-    member : System.Reflection.MemberInfo;
-    
-    [Accessor]
-    usageType : UsageType = UsageType.Definition;
-
     public UsageTypeToString() : string
     {
-      match (usageType)
+      match (_usageType)
       {
         | Definition => "def"
         | Usage => "use"
@@ -58,27 +53,28 @@
 
     public this(location : Location)
     {
-      this.location = location;
-      this.usageType = usageType;
+      _location  = location;
     }
 
     public this(location : Location, usageType : UsageType)
     {
-      this.location = location;
-      this.usageType = usageType;
+      _location = location;
+      _usageType = usageType;
     }
 
     public this(member : IMember)
     {
       this(member.Location);
+
       unless (HasLocation)
-        this.member = member.GetHandle();
+        _member = member.GetHandle();
     }
 
     public this(member : IMember, usageType : UsageType)
     {
       this(member);
-      this.usageType = usageType;
+
+      _usageType = usageType;
     }
 
     public this(value : ClassMember)
@@ -89,7 +85,8 @@
     public this(value : ClassMember, usageType : UsageType)
     {
       this(value);
-      this.usageType = usageType;
+
+      _usageType = usageType;
     }
 
     public this(value : LocalValue)
@@ -100,7 +97,8 @@
     public this(value : LocalValue, usageType : UsageType)
     {
       this(value);
-      this.usageType = usageType;
+
+      _usageType = usageType;
     }
 
     public this(_fh : Typedtree.Fun_header)
@@ -110,42 +108,47 @@
     public this(funHeader : Typedtree.Fun_header, usageType : UsageType)
     {
       this(funHeader);
-      this.usageType = usageType;
+
+      _usageType = usageType;
     }
 
     public this(macroEnvelope : TExpr.MacroEnvelope)
     {
       def typeOfMacro = macroEnvelope.the_macro.GetType();
-      filePath = typeOfMacro.Assembly.GetLocalPath();
-      member = typeOfMacro.GetConstructor(Type.EmptyTypes);
+
+      _filePath = typeOfMacro.Assembly.GetLocalPath();
+      _member   = typeOfMacro.GetConstructor(Type.EmptyTypes);
     }
 
     public this(macroEnvelope : TExpr.MacroEnvelope, usageType : UsageType)
     {
       this(macroEnvelope);
-      this.usageType = usageType;
+
+      _usageType = usageType;
     }
 
     public this(filePath : string, location : Location)
     {
       this(location);
-      this.filePath = filePath;
+
+      _filePath = filePath;
     }
 
     public this(filePath : string, location : Location, usageType : UsageType)
     {
       this(filePath, location);
-      this.usageType = usageType;
+
+      _usageType = usageType;
     }
 
     public HasLocation : bool
     {
-      get { !string.IsNullOrEmpty(FilePath) && Location != Location.Default }
+      get { !string.IsNullOrEmpty(FilePath) && _location.EndLine > 0 }
     }
 
     public override ToString() : string
     {
-      $"$(UsageTypeToString()): $(if (location != Location.Default) location.ToString() else FilePath)"
+      $"$(UsageTypeToString()): $(if (_location != Location.Default) _location.ToString() else FilePath)"
     }
 
     [OverrideObjectEquals]



More information about the svn mailing list