@@ -86,10 +86,7 @@ public static void ExtractModifiers(Context cx, TextWriter trapFile, IEntity key
8686 if ( symbol . IsSealed )
8787 HasModifier ( cx , trapFile , key , "sealed" ) ;
8888
89- var fromSource = symbol . DeclaringSyntaxReferences . Length > 0 ;
90-
91- if ( symbol . IsStatic && ! ( symbol . Kind == SymbolKind . Field && ( ( IFieldSymbol ) symbol ) . IsConst && ! fromSource ) )
92- HasModifier ( cx , trapFile , key , "static" ) ;
89+ ExtractStaticModifier ( cx , trapFile , key , symbol ) ;
9390
9491 if ( symbol . IsVirtual )
9592 HasModifier ( cx , trapFile , key , "virtual" ) ;
@@ -104,8 +101,7 @@ public static void ExtractModifiers(Context cx, TextWriter trapFile, IEntity key
104101 if ( symbol . IsOverride )
105102 HasModifier ( cx , trapFile , key , "override" ) ;
106103
107- if ( symbol . Kind == SymbolKind . Method && ( ( IMethodSymbol ) symbol ) . IsAsync )
108- HasModifier ( cx , trapFile , key , "async" ) ;
104+ ExtractAsyncModifier ( cx , trapFile , key , symbol ) ;
109105
110106 if ( symbol . IsExtern )
111107 HasModifier ( cx , trapFile , key , "extern" ) ;
@@ -129,6 +125,20 @@ public static void ExtractModifiers(Context cx, TextWriter trapFile, IEntity key
129125 }
130126 }
131127
128+ public static void ExtractAsyncModifier ( Context cx , TextWriter trapFile , IEntity key , ISymbol symbol )
129+ {
130+ if ( symbol . Kind == SymbolKind . Method && ( ( IMethodSymbol ) symbol ) . IsAsync )
131+ HasModifier ( cx , trapFile , key , "async" ) ;
132+ }
133+
134+ public static void ExtractStaticModifier ( Context cx , TextWriter trapFile , IEntity key , ISymbol symbol )
135+ {
136+ var fromSource = symbol . DeclaringSyntaxReferences . Length > 0 ;
137+
138+ if ( symbol . IsStatic && ! ( symbol . Kind == SymbolKind . Field && ( ( IFieldSymbol ) symbol ) . IsConst && ! fromSource ) )
139+ HasModifier ( cx , trapFile , key , "static" ) ;
140+ }
141+
132142 public static Modifier Create ( Context cx , string modifier )
133143 {
134144 return ModifierFactory . Instance . CreateEntity ( cx , ( typeof ( Modifier ) , modifier ) , modifier ) ;
0 commit comments