[svn] r7248: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService: NemerleSource.cs NemerleTypeAndMemberD...

IT svnadmin at nemerle.org
Thu Jan 11 06:36:16 CET 2007


Log:
Fixing some method tip info bugs.

Author: IT
Date: Thu Jan 11 06:36:13 2007
New Revision: 7248

Modified:
   vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs
   vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleTypeAndMemberDropdownBars .cs
   vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs

Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs	Thu Jan 11 06:36:13 2007
@@ -189,7 +189,11 @@
 			//base.ReformatSpan(mgr, span);
 		}
 
-		MethodData _methodData;
+		private MethodData _methodData;
+		public  MethodData  MethodData
+		{
+			get { return _methodData; }
+		}
 
 		public override MethodData CreateMethodData()
 		{

Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleTypeAndMemberDropdownBars .cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleTypeAndMemberDropdownBars .cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleTypeAndMemberDropdownBars .cs	Thu Jan 11 06:36:13 2007
@@ -5,13 +5,13 @@
 using Microsoft.VisualStudio.Package;
 using Microsoft.VisualStudio.TextManager.Interop;
 
-using Nemerle.Compiler;
+using Nemerle.Builtins;
 using Nemerle.Completion2;
-
-using VsPkg = Microsoft.VisualStudio.Package;
+using Nemerle.Compiler;
 using Nemerle.Compiler.Parsetree;
 using Nemerle.Compiler.Utils;
-using Nemerle.Builtins;
+
+using VsPkg = Microsoft.VisualStudio.Package;
 
 namespace Nemerle.VisualStudio.LanguageService
 {

Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs	Thu Jan 11 06:36:13 2007
@@ -12,6 +12,8 @@
 using Nemerle.VisualStudio.Project;
 using Nemerle.VisualStudio.GUI;
 
+using VsCommands2K = Microsoft.VisualStudio.VSConstants.VSStd2KCmdID;
+
 namespace Nemerle.VisualStudio.LanguageService
 {
 	class NemerleViewFilter : ViewFilter
@@ -84,31 +86,36 @@
 			return base.ExecCommand(ref guidCmdGroup, nCmdId, nCmdexecopt, pvaIn, pvaOut);
 		}
 
-		private List<Location> selectionsStack = null;
+		private List<Location> _selectionsStack = null;
 		
-		private int currentSelection;
+		private int _currentSelection;
 		public int CurrentSelection
 		{
-			get { return currentSelection; }
+			get { return _currentSelection; }
 			set
 			{
-				if (selectionsStack != null && value != currentSelection && value >= 0 && value < selectionsStack.Count)
+				if (_selectionsStack != null && value != _currentSelection && value >= 0 && value < _selectionsStack.Count)
 				{
-					currentSelection = value;
-					TextSpan span = Utils.SpanFromLocation(selectionsStack[currentSelection]);
+					_currentSelection = value;
+					TextSpan span = Utils.SpanFromLocation(_selectionsStack[_currentSelection]);
 					TextView.SetSelection(span.iEndLine, span.iEndIndex, span.iStartLine, span.iStartIndex);
 				}
 			}
 		}
 
+		public new NemerleSource Source
+		{
+			get { return (NemerleSource)base.Source; }
+		}
+
 		private void ExpandSelection()
 		{
 			TextSpan selection = GetSelection();
 			if (!SelectionIsInStack(selection))
 			{
-				selectionsStack = GetSelectionsStack(selection);
+				_selectionsStack = GetSelectionsStack(selection);
 				AddWordSpan(selection);
-				currentSelection = selectionsStack.Count;
+				_currentSelection = _selectionsStack.Count;
 			}
 			CurrentSelection--;
 		}
@@ -123,15 +130,15 @@
 		{
 			// perhaps, using OnSelectChange routine would be better
 			// to determine, whether user already moved selection or still in the selection chain
-			if (selectionsStack == null || selectionsStack.Count == 0)
+			if (_selectionsStack == null || _selectionsStack.Count == 0)
 				return false;
-			Location current = Utils.LocationFromSpan(selectionsStack[0].FileIndex, selection);
+			Location current = Utils.LocationFromSpan(_selectionsStack[0].FileIndex, selection);
 			int i = 0;
-			foreach (Location location in selectionsStack)
+			foreach (Location location in _selectionsStack)
 			{
 				if (location == current)
 				{
-					currentSelection = i;
+					_currentSelection = i;
 					return true;
 				}
 				i++;
@@ -149,17 +156,17 @@
 			GetWordExtent(selection.iEndLine, selection.iEndIndex, flags, spans);
 			TextSpan wordSpanOther = spans[0];
 			// in principle, selectionsStack contains at least the whole file location
-			if (wordSpan.Equals(wordSpanOther) && selectionsStack != null && selectionsStack.Count > 0)
+			if (wordSpan.Equals(wordSpanOther) && _selectionsStack != null && _selectionsStack.Count > 0)
 			{
-				Location last = selectionsStack[selectionsStack.Count - 1];
+				Location last = _selectionsStack[_selectionsStack.Count - 1];
 				Location word = Utils.LocationFromSpan(last.FileIndex, wordSpan);
 				if (last.StrictlyContains(word) && last != word)
-					selectionsStack.Add(word);
+					_selectionsStack.Add(word);
 			}
 			else
 			{
-				selectionsStack = new List<Location>();
-				selectionsStack.Add(Utils.LocationFromSpan(0, wordSpan));
+				_selectionsStack = new List<Location>();
+				_selectionsStack.Add(Utils.LocationFromSpan(0, wordSpan));
 			}
 		}
 
@@ -235,6 +242,35 @@
 			return base.HandlePreExec(ref guidCmdGroup, nCmdId, nCmdexecopt, pvaIn, pvaOut);
 		}
 
+		public override void HandlePostExec(
+			ref Guid guidCmdGroup, uint nCmdId, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut, bool bufferWasChanged)
+		{
+			if (guidCmdGroup == typeof(VsCommands2K).GUID)
+			{
+				switch ((VsCommands2K)nCmdId)
+				{
+					case VsCommands2K.PAGEUP:
+					case VsCommands2K.UP:
+					case VsCommands2K.PAGEDN:
+					case VsCommands2K.DOWN:
+						if (Source.MethodData.IsDisplayed)
+						{
+							if (Source.MethodData.GetOverloadCount() == 1)
+							{
+								Source.DismissCompletor();
+							}
+							else
+							{
+								
+							}
+						}
+						break;
+				}
+			}
+
+			base.HandlePostExec(ref guidCmdGroup, nCmdId, nCmdexecopt, pvaIn, pvaOut, bufferWasChanged);
+		}
+
 		/// <summary>
 		/// Here we will do our formatting...
 		/// </summary>



More information about the svn mailing list