diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2012-06-01 12:13:02 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2012-06-01 12:13:02 +0400 |
commit | 055bc5fd592d1e4d9be6bd54f2c9ad7e68974ffa (patch) | |
tree | 2873dcd36c23490181488aa3437423ca02c776fa | |
parent | 5a40763fcddf40738e3a993d6240e9512a0ee568 (diff) |
Fixed part of 'Bug 5422 - namespace declaration should be suggestion
not completion'.
-rw-r--r-- | main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs b/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs index 5e99361730..270a308a36 100644 --- a/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs +++ b/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs @@ -622,7 +622,6 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (currentType != null && currentType.Kind == TypeKind.Enum) { return HandleEnumContext(); } - var contextList = new CompletionDataWrapper(this); var identifierStart = GetExpressionAtCursor(); if (identifierStart != null) { @@ -1441,8 +1440,9 @@ namespace ICSharpCode.NRefactory.CSharp.Completion return null; } switch (word) { - case "using": case "namespace": + return null; + case "using": if (currentType != null) { return null; } @@ -1709,7 +1709,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion return true; } - string GetLineIndent (int lineNr) + string GetLineIndent(int lineNr) { var line = document.GetLineByNumber(lineNr); for (int j = line.Offset; j < line.EndOffset; j++) { @@ -2626,6 +2626,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion location, n => n is IdentifierExpression || n is MemberReferenceExpression ); + if (expr == null) { expr = baseUnit.GetNodeAt<AstType>(location.Line, location.Column - 1); } @@ -2736,6 +2737,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion expr = baseUnit.GetNodeAt<AstType>(location.Line, location.Column); } } + if (expr == null) { return null; } |