Browse Source

Fixed failing unit test.

newNRvisualizers
Mike Krüger 14 years ago
parent
commit
6f4a46c066
  1. 1
      ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs
  2. 4
      ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngineBase.cs
  3. 1
      ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs

1
ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs

@ -478,7 +478,6 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
var contextList = new CompletionDataWrapper (this); var contextList = new CompletionDataWrapper (this);
var identifierStart = GetExpressionAtCursor(); var identifierStart = GetExpressionAtCursor();
Console.WriteLine("id:" + identifierStart);
if (identifierStart != null && identifierStart.Node is TypeParameterDeclaration) { if (identifierStart != null && identifierStart.Node is TypeParameterDeclaration) {
return null; return null;
} }

4
ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngineBase.cs

@ -424,7 +424,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
string memberText = mt.Item1; string memberText = mt.Item1;
var memberLocation = mt.Item2; var memberLocation = mt.Item2;
int closingBrackets = 0; int closingBrackets = 1;
int generatedLines = 0; int generatedLines = 0;
var wrapper = new StringBuilder (); var wrapper = new StringBuilder ();
bool wrapInClass = memberLocation != new TextLocation (1, 1); bool wrapInClass = memberLocation != new TextLocation (1, 1);
@ -449,12 +449,10 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
if (closingBrackets > 0) { if (closingBrackets > 0) {
wrapper.Append(new string ('}', closingBrackets)); wrapper.Append(new string ('}', closingBrackets));
} }
using (var stream = new System.IO.StringReader (wrapper.ToString ())) { using (var stream = new System.IO.StringReader (wrapper.ToString ())) {
try { try {
var parser = new CSharpParser (); var parser = new CSharpParser ();
var result = parser.Parse(stream, "stub.cs", memberLocation.Line - 1 - generatedLines); var result = parser.Parse(stream, "stub.cs", memberLocation.Line - 1 - generatedLines);
return result; return result;
} catch (Exception) { } catch (Exception) {
Console.WriteLine("------"); Console.WriteLine("------");

1
ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs

@ -107,7 +107,6 @@ namespace ICSharpCode.NRefactory.CSharp
subContainer.Accept(this); subContainer.Accept(this);
} }
} }
Console.WriteLine("attr:" + mc.UnattachedAttributes);
if (nDecl != null) { if (nDecl != null) {
AddAttributeSection (nDecl, nspace.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole); AddAttributeSection (nDecl, nspace.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);
if (loc != null && loc.Count > 2) if (loc != null && loc.Count > 2)

Loading…
Cancel
Save