Browse Source

Revert "Parameter AST Node Attributes"

This reverts commit 982247e72a.
pull/67/head
Dragan 12 years ago
parent
commit
dff098fb43
  1. 18
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/NRefactoryASTConvertVisitor.cs

18
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/NRefactoryASTConvertVisitor.cs

@ -251,7 +251,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -251,7 +251,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
return base.VisitOptionDeclaration(optionDeclaration, data);
}
static void ConvertAttributes(AST.AttributedNode from, AbstractEntity to)
void ConvertAttributes(AST.AttributedNode from, AbstractEntity to)
{
if (from.Attributes.Count == 0) {
to.Attributes = DefaultAttribute.EmptyAttributeList;
@ -267,18 +267,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -267,18 +267,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
}
}
static void ConvertAttributes(AST.ParameterDeclarationExpression from, DefaultParameter to, IClass c )
{
if (from.Attributes.Count == 0) {
to.Attributes = DefaultAttribute.EmptyAttributeList;
} else {
ICSharpCode.NRefactory.Location location = from.Attributes[0].StartLocation;
ClassFinder context = new ClassFinder(c, location.Line, location.Column);
to.Attributes = VisitAttributes(from.Attributes, context);
}
}
static List<IAttribute> VisitAttributes(IList<AST.AttributeSection> attributes, ClassFinder context)
List<IAttribute> VisitAttributes(IList<AST.AttributeSection> attributes, ClassFinder context)
{
// TODO Expressions???
List<IAttribute> result = new List<IAttribute>();
@ -333,7 +322,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -333,7 +322,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
result.Add(new DefaultAttribute(new AttributeReturnType(context, attribute.Name),
target, positionalArguments, namedArguments)
{
CompilationUnit = context.CallingClass.CompilationUnit,
CompilationUnit = cu,
Region = GetRegion(attribute.StartLocation, attribute.EndLocation)
});
}
@ -579,7 +568,6 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -579,7 +568,6 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
IReturnType parType = CreateReturnType(par.TypeReference, method, currentClass, cu, TypeVisitor.ReturnTypeOptions.None);
DefaultParameter p = new DefaultParameter(par.ParameterName, parType, GetRegion(par.StartLocation, par.EndLocation));
p.Modifiers = (ParameterModifiers)par.ParamModifier;
ConvertAttributes ( par, p, currentClass );
return p;
}

Loading…
Cancel
Save