File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
Rubberduck.Parsing/Symbols Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 2
2
using System . Collections . Generic ;
3
3
using System . Linq ;
4
4
using System . Reflection ;
5
- using System . Text ;
6
- using System . Threading . Tasks ;
7
5
using Rubberduck . VBEditor ;
6
+ using System . Runtime . CompilerServices ;
8
7
9
8
namespace Rubberduck . Parsing . Symbols
10
9
{
@@ -19,7 +18,7 @@ public static IEnumerable<Declaration> Declarations
19
18
{
20
19
if ( _adodbDeclarations == null )
21
20
{
22
- var nestedTypes = typeof ( AdodbObjectModel ) . GetNestedTypes ( BindingFlags . NonPublic ) ;
21
+ var nestedTypes = typeof ( AdodbObjectModel ) . GetNestedTypes ( BindingFlags . NonPublic ) . Where ( t => Attribute . GetCustomAttribute ( t , typeof ( CompilerGeneratedAttribute ) ) == null ) ;
23
22
var fields = nestedTypes . SelectMany ( t => t . GetFields ( ) ) ;
24
23
var values = fields . Select ( f => f . GetValue ( null ) ) ;
25
24
_adodbDeclarations = values . Cast < Declaration > ( ) ;
Original file line number Diff line number Diff line change 2
2
using System . Linq ;
3
3
using System . Reflection ;
4
4
using Rubberduck . VBEditor ;
5
+ using System . Runtime . CompilerServices ;
6
+ using System ;
5
7
6
8
namespace Rubberduck . Parsing . Symbols
7
9
{
@@ -21,7 +23,7 @@ public static IEnumerable<Declaration> Declarations
21
23
{
22
24
if ( _excelDeclarations == null )
23
25
{
24
- var nestedTypes = typeof ( ExcelObjectModel ) . GetNestedTypes ( BindingFlags . NonPublic ) ;
26
+ var nestedTypes = typeof ( ExcelObjectModel ) . GetNestedTypes ( BindingFlags . NonPublic ) . Where ( t => Attribute . GetCustomAttribute ( t , typeof ( CompilerGeneratedAttribute ) ) == null ) ;
25
27
var fields = nestedTypes . SelectMany ( t => t . GetFields ( ) ) ;
26
28
var values = fields . Select ( f => f . GetValue ( null ) ) ;
27
29
_excelDeclarations = values . Cast < Declaration > ( ) ;
Original file line number Diff line number Diff line change 2
2
using System . Linq ;
3
3
using System . Reflection ;
4
4
using Rubberduck . VBEditor ;
5
+ using System . Runtime . CompilerServices ;
6
+ using System ;
5
7
6
8
namespace Rubberduck . Parsing . Symbols
7
9
{
@@ -19,7 +21,7 @@ public static IEnumerable<Declaration> Declarations
19
21
{
20
22
if ( _standardLibDeclarations == null )
21
23
{
22
- var nestedTypes = typeof ( VbaStandardLib ) . GetNestedTypes ( BindingFlags . NonPublic ) ;
24
+ var nestedTypes = typeof ( VbaStandardLib ) . GetNestedTypes ( BindingFlags . NonPublic ) . Where ( t => Attribute . GetCustomAttribute ( t , typeof ( CompilerGeneratedAttribute ) ) == null ) ;
23
25
var fields = nestedTypes . SelectMany ( t => t . GetFields ( ) ) ;
24
26
var values = fields . Select ( f => f . GetValue ( null ) ) ;
25
27
_standardLibDeclarations = values . Cast < Declaration > ( ) ;
You can’t perform that action at this time.
0 commit comments