diff --git a/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs b/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs index f31455d73..bba6c1c4a 100644 --- a/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs +++ b/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs @@ -145,9 +145,7 @@ namespace ICSharpCode.Decompiler.Ast } // definitions of types and their members - Predicate predicate = n => n is TypeDeclaration || n is DelegateDeclaration || - n is FieldDeclaration || n is PropertyDeclaration || n is EventDeclaration ||n is MethodDeclaration || n is ConstructorDeclaration || - n is IndexerDeclaration || n is OperatorDeclaration; + Predicate predicate = n => n is AttributedNode; if (predicate(node)) { var n = node as AttributedNode; diff --git a/ILSpy/Bookmarks/MemberBookmark.cs b/ILSpy/Bookmarks/MemberBookmark.cs index 27ff141cb..fb8b2ec3b 100644 --- a/ILSpy/Bookmarks/MemberBookmark.cs +++ b/ILSpy/Bookmarks/MemberBookmark.cs @@ -35,6 +35,9 @@ namespace ICSharpCode.ILSpy.Bookmarks public virtual ImageSource Image { get { var attrNode = (AttributedNode)node; + if (node is EnumMemberDeclaration) + return GetMemberOverlayedImage(attrNode, MemberIcon.EnumValue); + if (node is FieldDeclaration) return GetMemberOverlayedImage(attrNode, MemberIcon.Field); diff --git a/ILSpy/Language.cs b/ILSpy/Language.cs index 0a2523d17..9bdb4fc62 100644 --- a/ILSpy/Language.cs +++ b/ILSpy/Language.cs @@ -191,12 +191,7 @@ namespace ICSharpCode.ILSpy CodeMappings = builder.CodeMappings, LocalVariables = builder.LocalVariables, DecompiledMemberReferences = builder.DecompiledMemberReferences, - AstNodes = builder.CompilationUnit.GetNodesWithLineNumbers(n => - n is TypeDeclaration || n is DelegateDeclaration || - n is FieldDeclaration || n is PropertyDeclaration || - n is EventDeclaration || n is MethodDeclaration || - n is ConstructorDeclaration || - n is IndexerDeclaration || n is OperatorDeclaration) + AstNodes = builder.CompilationUnit.GetNodesWithLineNumbers(n => n is AttributedNode) }); } @@ -205,7 +200,7 @@ namespace ICSharpCode.ILSpy OnDecompilationFinished(new DecompileEventArgs { CodeMappings = dis.CodeMappings, DecompiledMemberReferences = dis.DecompiledMemberReferences, - AstNodes = null // TODO: how can I find the AST nodes? + AstNodes = null // TODO: how can I find the nodes with line numbers from dis? }); } }