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

Loading…
Cancel
Save