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@novell.com>2009-10-12 11:57:41 +0400
committerMike Krüger <mkrueger@novell.com>2009-10-12 11:57:41 +0400
commit0b405c5607f68902dbf054b1f0a690cff6988a13 (patch)
treeb8fcc538be55e31d0504c5bc54e181e2259eae26 /main/contrib
parent71b13ed6ba933e418068007e32b93a13a6b41732 (diff)
* Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs: Fixed 'Bug 545901
- TextEditor handling of Attributes on method parameter'. svn path=/trunk/monodevelop/; revision=143942
Diffstat (limited to 'main/contrib')
-rw-r--r--main/contrib/NRefactory/Project/ChangeLog6
-rw-r--r--main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs18
2 files changed, 21 insertions, 3 deletions
diff --git a/main/contrib/NRefactory/Project/ChangeLog b/main/contrib/NRefactory/Project/ChangeLog
index daf4626041..61ddcc3e18 100644
--- a/main/contrib/NRefactory/Project/ChangeLog
+++ b/main/contrib/NRefactory/Project/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-12 Mike Krüger <mkrueger@novell.com>
+
+ * Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs: Fixed 'Bug
+ 545901 - TextEditor handling of Attributes on method
+ parameter'.
+
2009-10-09 Mike Krüger <mkrueger@novell.com>
* Src/Lexer/CSharp/Lexer.cs:
diff --git a/main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs b/main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs
index ad888a2723..cb1963a9ed 100644
--- a/main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs
+++ b/main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs
@@ -207,7 +207,13 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
foreach (AttributeSection section in attributes) {
TrackVisit(section, data);
}
+ bool formatSection = true;
+ if (data is bool)
+ formatSection = (bool)data;
+ if (!formatSection)
+ outputFormatter.Space ();
}
+
void PrintFormattedComma()
{
if (this.prettyPrintOptions.SpacesBeforeComma) {
@@ -230,7 +236,11 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
public override object TrackedVisitAttributeSection(AttributeSection attributeSection, object data)
{
- outputFormatter.Indent();
+ bool formatSection = true;
+ if (data is bool)
+ formatSection = (bool)data;
+ if (formatSection)
+ outputFormatter.Indent();
outputFormatter.PrintToken(Tokens.OpenSquareBracket);
if (this.prettyPrintOptions.SpacesWithinBrackets) {
outputFormatter.Space();
@@ -251,7 +261,9 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
outputFormatter.Space();
}
outputFormatter.PrintToken(Tokens.CloseSquareBracket);
- outputFormatter.NewLine();
+ if (formatSection) {
+ outputFormatter.NewLine();
+ }
return null;
}
@@ -737,7 +749,7 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
public override object TrackedVisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data)
{
- VisitAttributes(parameterDeclarationExpression.Attributes, data);
+ VisitAttributes(parameterDeclarationExpression.Attributes, false);
if (!parameterDeclarationExpression.DefaultValue.IsNull) {
outputFormatter.PrintText("[System.Runtime.InteropServices.OptionalAttribute, System.Runtime.InteropServices.DefaultParameterValueAttribute(");
TrackVisit(parameterDeclarationExpression.DefaultValue, data);