(f *ast.NodeFactory, newDecl *ast.Node, isDeclKind func(*ast.Node) bool, symbol *ast.Symbol)
| 210 | } |
| 211 | |
| 212 | func simplifyModifiers(f *ast.NodeFactory, newDecl *ast.Node, isDeclKind func(*ast.Node) bool, symbol *ast.Symbol) *ast.Node { |
| 213 | decls := core.Filter(symbol.Declarations, isDeclKind) |
| 214 | var declWithModifiers *ast.Node |
| 215 | if len(decls) > 0 { |
| 216 | declWithModifiers = decls[0] |
| 217 | } else { |
| 218 | declWithModifiers = newDecl |
| 219 | } |
| 220 | modifiers := declWithModifiers.ModifierFlags() & ^(ast.ModifierFlagsExport | ast.ModifierFlagsAmbient) |
| 221 | return ast.ReplaceModifiers(f, newDecl, f.NewModifierList(ast.CreateModifiersFromModifierFlags(modifiers, f.NewModifier))) |
| 222 | } |
| 223 | |
| 224 | // SymbolToEntityName implements NodeBuilderInterface. |
| 225 | func (b *NodeBuilder) SymbolToEntityName(symbol *ast.Symbol, meaning ast.SymbolFlags, enclosingDeclaration *ast.Node, flags nodebuilder.Flags, internalFlags nodebuilder.InternalFlags, tracker nodebuilder.SymbolTracker) *ast.Node { |
no test coverage detected