[svn]
r7089: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel:
Project.Type.n Project....
pbludov
svnadmin at nemerle.org
Fri Dec 15 07:38:42 CET 2006
Log:
Navigation for enums and usings.
Author: pbludov
Date: Fri Dec 15 07:38:39 2006
New Revision: 7089
Modified:
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Using.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n
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 Fri Dec 15 07:38:39 2006
@@ -311,6 +311,7 @@
| tv is TyVar => (QuickTipInfo(loc, tv))
| tc is TExpr.ImplicitValueTypeCtor => (QuickTipInfo(loc, tc.ty))
| fh is Typedtree.Fun_header => (QuickTipInfo(loc, fh))
+ | p is Pattern.Enum => (QuickTipInfo(loc, p.fld, manager))
| _ => (null)
}
}
@@ -341,6 +342,7 @@
| tb is TypeBuilder => tb.PartsLocation.Map(GotoInfo);
| fh is Typedtree.Fun_header => [GotoInfo(fh)]
| m is IMember => [GotoInfo(m)]
+ | p is Pattern.Enum => [GotoInfo(p.fld)]
| _ => []
}
}
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Using.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Using.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Using.n Fri Dec 15 07:38:39 2006
@@ -222,5 +222,38 @@
null
}
}
+
+ private GetUsingGoto(
+ usingDecl : Decl.Using,
+ fileIndex : int,
+ line : int,
+ col : int) : list [GotoInfo]
+ {
+ if (Contains(usingDecl.NameLocations, fileIndex, line, col))
+ {
+ def (names, _) = Truncate(usingDecl.Name, usingDecl.NameLocations, fileIndex, line, col);
+
+ def node = OpenNs(names /*usingDecl.Name*/, usingDecl.BeforeEnv.CurrentNamespace, false);
+
+ match (node.Value)
+ {
+ | Cached(ty)
+ | NotLoaded(ty) =>
+ match(ty)
+ {
+ | tb is TypeBuilder => tb.AstParts.Map(p => GotoInfo(p.name.Location));
+ | ti is TypeInfo => [GotoInfo(ti)];
+ | _ => []
+ }
+ | _ => []
+ }
+ }
+ else
+ {
+ // Alias name or whitespace
+ //
+ []
+ }
+ }
} // end class Project
} // end namespace
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 Dec 15 07:38:39 2006
@@ -228,7 +228,8 @@
match (decl)
{
- | Type as tp => GetTypeGoto(tp, fileIndex, line, col).ToArray();
+ | Using as us => GetUsingGoto(us, fileIndex, line, col).ToArray();
+ | Type as tp => GetTypeGoto (tp, fileIndex, line, col).ToArray();
| _ => null
}
}
More information about the svn
mailing list