[Monodevelop-patches-list] r1480 - in trunk/MonoDevelop/src/AddIns: BackendBindings/CSharpBinding BackendBindings/CSharpBinding/Parser DisplayBindings/SourceEditor DisplayBindings/SourceEditor/CodeCompletion DisplayBindings/SourceEditor/Gui
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Mon Apr 19 00:15:53 EDT 2004
Author: tberman
Date: 2004-04-19 00:15:53 -0400 (Mon, 19 Apr 2004)
New Revision: 1480
Modified:
trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog
trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Resolver.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionData.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionDataProvider.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
Log:
add the oftrequested local variables in ctrl+space behaviours
added a nasty hack to make sure you use the right resolver method (its brutal)
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog 2004-04-18 16:59:00 UTC (rev 1479)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog 2004-04-19 04:15:53 UTC (rev 1480)
@@ -1,3 +1,8 @@
+2004-04-19 Todd Berman <tberman at sevenl.net>
+
+ * Parser/Resolver.cs: Turn local variables into a properly consumable
+ type for code completion.
+
2004-04-09 Todd Berman <tberman at sevenl.net>
* CSharpBindingCompilerManager.cs: Show that something is going
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Resolver.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Resolver.cs 2004-04-18 16:59:00 UTC (rev 1479)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Resolver.cs 2004-04-19 04:15:53 UTC (rev 1480)
@@ -798,6 +798,7 @@
public ArrayList CtrlSpace(IParserService parserService, int caretLine, int caretColumn, string fileName)
{
+ Console.WriteLine ("Inside CtrlSpace");
ArrayList result = new ArrayList();
this.parserService = parserService;
IParseInformation parseInfo = parserService.GetParseInformation(fileName);
@@ -819,7 +820,7 @@
if (variables != null && variables.Count > 0) {
foreach (LocalLookupVariable v in variables) {
if (IsInside(new Point(caretColumn, caretLine), v.StartPos, v.EndPos)) {
- result.Add(v);
+ result.Add(new Parameter (name, new ReturnType (v.TypeRef.SystemType)));
break;
}
}
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2004-04-18 16:59:00 UTC (rev 1479)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2004-04-19 04:15:53 UTC (rev 1480)
@@ -1,3 +1,9 @@
+2004-04-19 Todd Berman <tberman at sevenl.net>
+
+ * Gui/SourceEditorView.cs: call the right resolver method.
+ * CodeCompletion/CodeCompletionDataProvider.cs: Add IParameter results.
+ * CodeCompletion/CodeCompletionData.cs: Add IParameter ctor.
+
2004-04-16 Todd Berman <tberman at sevenl.net>
* Gui/SourceEditorBuffer.cs: On load, place the cursor at the top
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionData.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionData.cs 2004-04-18 16:59:00 UTC (rev 1479)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionData.cs 2004-04-19 04:15:53 UTC (rev 1480)
@@ -219,6 +219,16 @@
completionString = e.Name;
documentation = e.Documentation;
}
+
+ public CodeCompletionData (IParameter o)
+ {
+ image = MonoDevelop.Gui.Stock.Field;
+ text = o.Name;
+ description = "";
+ pango_description = "";
+ completionString = o.Name;
+ documentation = "";
+ }
public void InsertAction (SourceEditorView control)
{
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionDataProvider.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionDataProvider.cs 2004-04-18 16:59:00 UTC (rev 1479)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionDataProvider.cs 2004-04-19 04:15:53 UTC (rev 1480)
@@ -73,6 +73,8 @@
IExpressionFinder expressionFinder = parserService.GetExpressionFinder(fileName);
string expression = expressionFinder == null ? TextUtilities.GetExpressionBeforeOffset(textArea, insertIter.Offset) : expressionFinder.FindExpression(textArea.Buffer.GetText(textArea.Buffer.StartIter, insertIter, true), insertIter.Offset - 2);
if (expression == null) return null;
+
+ //FIXME: This chartyped check is a fucking *HACK*
if (ctrlspace && charTyped != '.') {
AddResolveResults (parserService.CtrlSpace (parserService, caretLineNumber, caretColumn, fileName));
return (ICompletionData[])completionData.ToArray (typeof (ICompletionData));
@@ -135,6 +137,8 @@
completionData.Add(new CodeCompletionData(e));
insertedEventElements[e.Name] = e;
}
+ } else if (o is IParameter) {
+ completionData.Add (new CodeCompletionData((IParameter)o));
}
}
}
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs 2004-04-18 16:59:00 UTC (rev 1479)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs 2004-04-19 04:15:53 UTC (rev 1480)
@@ -173,7 +173,7 @@
if (triggerIter.Equals (TextIter.Zero)) return;
triggerIter.ForwardChar ();
- completionWindow = new CompletionWindow (this, ParentEditor.DisplayBinding.ContentName, new CodeCompletionDataProvider (false));
+ completionWindow = new CompletionWindow (this, ParentEditor.DisplayBinding.ContentName, new CodeCompletionDataProvider (true));
completionWindow.ShowCompletionWindow (triggerChar, triggerIter, true);
}
More information about the Monodevelop-patches-list
mailing list