[svn] r7232: vs-plugin/trunk:
Nemerle.Compiler.Utils/Nemerle.Completion2/Debug/AstUtils.n
Nemerle.VsIntegr...
VladD2
svnadmin at nemerle.org
Tue Jan 9 10:39:54 CET 2007
Log:
Work on AstToolWindow.
Author: VladD2
Date: Tue Jan 9 10:39:52 2007
New Revision: 7232
Modified:
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Debug/AstUtils.n
vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.cs
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Debug/AstUtils.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Debug/AstUtils.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Debug/AstUtils.n Tue Jan 9 10:39:52 2007
@@ -56,10 +56,12 @@
def fileIndex = rootNamespase.Location.FileIndex;
items.Add(AstNodeInfo($"$(indent)type $name", tb.Location));
- def scanMethod(method : MemberBuilder, indent)
+ def scanMethod(method : MethodBuilder, indent)
{
def name = method.Name;
- items.Add(AstNodeInfo($"$(indent)method $name(...)", method.Location));
+ items.Add(AstNodeInfo($"$(indent)method $name(...", method.Location));
+ def ret = method.Ast.header.ret_type;
+ items.Add(AstNodeInfo($"$(indent) ) : $ret", ret.Location));
items.Add(AstNodeInfo($"$(indent){", method.BodyLocation.FromStart()));
items.Add(AstNodeInfo($"$(indent)} // method $name", method.BodyLocation.FromEnd()));
}
Modified: vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.cs (original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.cs Tue Jan 9 10:39:52 2007
@@ -9,10 +9,10 @@
using CompUtils = Nemerle.Compiler.Utils.Utils;
using Nemerle.Compiler;
using Nemerle.Builtins;
-using Nemerle.Compiler.Utils;
using Nemerle.VisualStudio.Properties;
using Nemerle.VisualStudio.Project;
using Nemerle.VisualStudio.LanguageService;
+using Nemerle.Compiler.Utils;
namespace Nemerle.VisualStudio.GUI
{
@@ -38,8 +38,12 @@
{
_line.Text = line.ToString();
_col.Text = col.ToString();
- int index = _items.FindLastIndex(
- delegate(AstNodeInfo n) { return n.Location.Contains(line, col); });
+
+ if (_items.Count <= 0)
+ return;
+
+ int index = Nemerle.Compiler.Location.IndexOfMostNested2(_items,
+ delegate(AstNodeInfo n) { return n.Location; }, line, col);
if (index >= 0)
_grid.CurrentCell = _grid.Rows[index].Cells[0];
More information about the svn
mailing list