[Monodevelop-patches-list] r1465 - in trunk/MonoDevelop: gdldock/sources/gdl src/AddIns/DisplayBindings/SourceEditor/CodeCompletion src/AddIns/DisplayBindings/SourceEditor/Gui src/Libraries/SharpRefactory/src/Parser/AST
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Thu Apr 15 22:08:27 EDT 2004
Author: tberman
Date: 2004-04-15 22:08:27 -0400 (Thu, 15 Apr 2004)
New Revision: 1465
Modified:
trunk/MonoDevelop/gdldock/sources/gdl/Makefile.am
trunk/MonoDevelop/gdldock/sources/gdl/gdl-dock-paned.c
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionDataProvider.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractASTVisitor.cs
Log:
stuff
Modified: trunk/MonoDevelop/gdldock/sources/gdl/Makefile.am
===================================================================
--- trunk/MonoDevelop/gdldock/sources/gdl/Makefile.am 2004-04-15 23:02:26 UTC (rev 1464)
+++ trunk/MonoDevelop/gdldock/sources/gdl/Makefile.am 2004-04-16 02:08:27 UTC (rev 1465)
@@ -53,7 +53,6 @@
libgdlmarshal.c
libgdldock_la_LIBADD = $(GDLDOCK_LIBS)
-libgdldock_la_LDFLAGS = -avoid-version
BUILT_SOURCES = \
libgdltypebuiltins.h \
Modified: trunk/MonoDevelop/gdldock/sources/gdl/gdl-dock-paned.c
===================================================================
--- trunk/MonoDevelop/gdldock/sources/gdl/gdl-dock-paned.c 2004-04-15 23:02:26 UTC (rev 1464)
+++ trunk/MonoDevelop/gdldock/sources/gdl/gdl-dock-paned.c 2004-04-16 02:08:27 UTC (rev 1465)
@@ -559,10 +559,10 @@
switch (GDL_DOCK_ITEM (object)->orientation) {
case GTK_ORIENTATION_HORIZONTAL:
if (!paned->child1 && position == GDL_DOCK_LEFT) {
- gtk_paned_pack1 (paned, GTK_WIDGET (requestor), wresize, FALSE);
+ gtk_paned_pack1 (paned, GTK_WIDGET (requestor), FALSE, FALSE);
done = TRUE;
} else if (!paned->child2 && position == GDL_DOCK_RIGHT) {
- gtk_paned_pack2 (paned, GTK_WIDGET (requestor), wresize, FALSE);
+ gtk_paned_pack2 (paned, GTK_WIDGET (requestor), TRUE, FALSE);
done = TRUE;
}
break;
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionDataProvider.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionDataProvider.cs 2004-04-15 23:02:26 UTC (rev 1464)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionDataProvider.cs 2004-04-16 02:08:27 UTC (rev 1465)
@@ -1,7 +1,7 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
-// <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
+// <owner name="Mike Kr�¼ger" email="mike at icsharpcode.net"/>
// <version value="$version"/>
// </file>
@@ -41,6 +41,17 @@
int caretLineNumber;
int caretColumn;
string fileName;
+ bool ctrlspace;
+
+ public CodeCompletionDataProvider() : this (false)
+ {
+ }
+
+ public CodeCompletionDataProvider (bool ctrl)
+ {
+ this.ctrlspace = ctrl;
+ }
+
ArrayList completionData = null;
@@ -62,6 +73,10 @@
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;
+ if (ctrlspace && charTyped != '.') {
+ AddResolveResults (parserService.CtrlSpace (parserService, caretLineNumber, caretColumn, fileName));
+ return (ICompletionData[])completionData.ToArray (typeof (ICompletionData));
+ }
if (charTyped == ' ') {
if (expression == "using" || expression.EndsWith(" using") || expression.EndsWith("\tusing")|| expression.EndsWith("\nusing")|| expression.EndsWith("\rusing")) {
string[] namespaces = parserService.GetNamespaceList("");
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs 2004-04-15 23:02:26 UTC (rev 1464)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs 2004-04-16 02:08:27 UTC (rev 1465)
@@ -151,21 +151,20 @@
void TriggerCodeComplete ()
{
+
TextIter iter = buf.GetIterAtMark (buf.InsertMark);
- char triggerChar = '.';
+ char triggerChar = '\0';
TextIter triggerIter = TextIter.Zero;
do {
- //FIXME: This code is placeholder until you can
- //just switch on iter.Char
- string s = buf.GetText (iter, buf.GetIterAtOffset (iter.Offset + 1), true);
- switch (s) {
- case " ":
+ switch (iter.Char[0]) {
+ case ' ':
+ case '\t':
+ case '.':
+ case '(':
+ case '[':
triggerIter = iter;
- triggerChar = ' ';
+ triggerChar = iter.Char[0];
break;
- case ".":
- triggerIter = iter;
- break;
}
if (!triggerIter.Equals (TextIter.Zero))
break;
@@ -174,8 +173,8 @@
if (triggerIter.Equals (TextIter.Zero)) return;
triggerIter.ForwardChar ();
- completionWindow = new CompletionWindow (this, ParentEditor.DisplayBinding.ContentName, new CodeCompletionDataProvider ());
-
+ completionWindow = new CompletionWindow (this, ParentEditor.DisplayBinding.ContentName, new CodeCompletionDataProvider (true));
+
completionWindow.ShowCompletionWindow (triggerChar, triggerIter, true);
}
@@ -219,56 +218,60 @@
}
switch ((char)key) {
- case ' ':
- if (1 == 1) {
- string word = GetWordBeforeCaret ();
- if (word != null) {
- CodeTemplateGroup templateGroup = CodeTemplateLoader.GetTemplateGroupPerFilename(ParentEditor.DisplayBinding.ContentName);
-
- if (templateGroup != null) {
- foreach (CodeTemplate template in templateGroup.Templates) {
- if (template.Shortcut == word) {
- InsertTemplate(template);
- return false;
- }
- }
+ case ' ':
+ string word = GetWordBeforeCaret ();
+ if (word != null) {
+ //if (word.ToLower () == "new") {
+ // if (EnableCodeCompletion) {
+ // completionWindow = new CompletionWindow (this, ParentEditor.DisplayBinding.ContentName, new CodeCompletionDataProvider (true));
+ // completionWindow.ShowCompletionWindow ((char)key, buf.GetIterAtMark (buf.InsertMark), false);
+ // }
+ //}
+ CodeTemplateGroup templateGroup = CodeTemplateLoader.GetTemplateGroupPerFilename(ParentEditor.DisplayBinding.ContentName);
+
+ if (templateGroup != null) {
+ foreach (CodeTemplate template in templateGroup.Templates) {
+ if (template.Shortcut == word) {
+ InsertTemplate(template);
+ return false;
}
}
}
- goto case '.';
-
- case '.':
- bool retval = base.OnKeyPressEvent (evnt);
- if (EnableCodeCompletion) {
- completionWindow = new CompletionWindow (this, ParentEditor.DisplayBinding.ContentName, new CodeCompletionDataProvider ());
- completionWindow.ShowCompletionWindow ((char)key, buf.GetIterAtMark (buf.InsertMark), false);
- }
- return retval;
+ }
+ goto case '.';
+
+ case '.':
+ bool retval = base.OnKeyPressEvent (evnt);
+ if (EnableCodeCompletion) {
+ completionWindow = new CompletionWindow (this, ParentEditor.DisplayBinding.ContentName, new CodeCompletionDataProvider ());
+ completionWindow.ShowCompletionWindow ((char)key, buf.GetIterAtMark (buf.InsertMark), false);
+ }
+ return retval;
/*case '(':
- try {
- InsightWindow insightWindow = new InsightWindow(this, ParentEditor.DisplayBinding.ContentName);
-
- insightWindow.AddInsightDataProvider(new MethodInsightDataProvider());
- insightWindow.ShowInsightWindow();
- } catch (Exception e) {
- Console.WriteLine("EXCEPTION: " + e);
- }
- break;
- case '[':
- try {
- InsightWindow insightWindow = new InsightWindow(this, ParentEditor.DisplayBinding.ContentName);
-
- insightWindow.AddInsightDataProvider(new IndexerInsightDataProvider());
- insightWindow.ShowInsightWindow();
- } catch (Exception e) {
- Console.WriteLine("EXCEPTION: " + e);
- }
- break;*/
+ try {
+ InsightWindow insightWindow = new InsightWindow(this, ParentEditor.DisplayBinding.ContentName);
+
+ insightWindow.AddInsightDataProvider(new MethodInsightDataProvider());
+ insightWindow.ShowInsightWindow();
+ } catch (Exception e) {
+ Console.WriteLine("EXCEPTION: " + e);
+ }
+ break;
+ case '[':
+ try {
+ InsightWindow insightWindow = new InsightWindow(this, ParentEditor.DisplayBinding.ContentName);
+
+ insightWindow.AddInsightDataProvider(new IndexerInsightDataProvider());
+ insightWindow.ShowInsightWindow();
+ } catch (Exception e) {
+ Console.WriteLine("EXCEPTION: " + e);
+ }
+ break;*/
}
-
+
return base.OnKeyPressEvent (evnt);
}
-
+
public int FindPrevWordStart (string doc, int offset)
{
for ( offset-- ; offset >= 0 ; offset--)
Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractASTVisitor.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractASTVisitor.cs 2004-04-15 23:02:26 UTC (rev 1464)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Parser/AST/AbstractASTVisitor.cs 2004-04-16 02:08:27 UTC (rev 1465)
@@ -543,6 +543,7 @@
}
public virtual object Visit(AssignmentExpression assignmentExpression, object data)
{
+ if (assignmentExpression.Left == null || assignmentExpression.Right == null) return null;
assignmentExpression.Left.AcceptVisitor(this, data);
return assignmentExpression.Right.AcceptVisitor(this, data);
}
More information about the Monodevelop-patches-list
mailing list