Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Krüger <mkrueger@xamarin.com>2011-11-01 14:44:27 +0400
committerMike Krüger <mkrueger@xamarin.com>2011-11-01 14:44:27 +0400
commit9c1fdd727b5b30f273926f26973d06ff3b8b1441 (patch)
treef3d730ead515d4ea71ba42fdd5dc9f00eae6187e /main/contrib
parent4fb1425536032e081ab1fd392659cb43b42b09be (diff)
Fixed "Bug 1745 - [New Resolver] Invalid completion in class
initialization".
Diffstat (limited to 'main/contrib')
-rw-r--r--main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs b/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs
index 35aa34b498..043d645028 100644
--- a/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs
+++ b/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs
@@ -413,8 +413,10 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
var contextList = new CompletionDataWrapper (this);
var identifierStart = GetExpressionAtCursor ();
- if (!(char.IsLetter (completionChar) || completionChar == '_') && (identifierStart == null || !(identifierStart.Item2 is ArrayInitializerExpression)))
+ if (!(char.IsLetter (completionChar) || completionChar == '_') && (!controlSpace || identifierStart == null || !(identifierStart.Item2 is ArrayInitializerExpression))) {
return controlSpace ? HandleAccessorContext () ?? DefaultControlSpaceItems () : null;
+ }
+
char prevCh = offset > 2 ? document.GetCharAt (offset - 2) : '\0';
char nextCh = offset < document.TextLength ? document.GetCharAt (offset) : ' ';
const string allowedChars = ";,[(){}+-*/%^?:&|~!<>=";
@@ -431,7 +433,6 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
return null;
}
}
-
if (identifierStart == null)
return HandleAccessorContext () ?? DefaultControlSpaceItems ();
@@ -1596,8 +1597,14 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
}
baseUnit = ParseStub ("a()");
+ // Hack for handle object initializer continuation expressions
+ if (baseUnit.GetNodeAt (location) is AttributedNode) {
+ baseUnit = ParseStub ("a()};");
+ }
+
var memberLocation = currentMember != null ? currentMember.Region.Begin : currentType.Region.Begin;
var mref = baseUnit.GetNodeAt<MemberReferenceExpression> (location);
+
if (mref == null){
var invoke = baseUnit.GetNodeAt<InvocationExpression> (location);
if (invoke != null)