func (v *enumFieldNamesPrefixVisitor) VisitEnumField(field *parser.EnumField) bool {
	expectedPrefix := strs.ToUpperSnakeCase(v.enumName)
	if !strings.HasPrefix(field.Ident, expectedPrefix) {
		v.AddFailuref(field.Meta.Pos, "EnumField name %q should have the prefix %q", field.Ident, expectedPrefix)

		expected := expectedPrefix + "_" + field.Ident
		err := v.Fixer.SearchAndReplace(field.Meta.Pos, func(lex *lexer.Lexer) fixer.TextEdit {
			lex.Next()
			return fixer.TextEdit{
				Pos:     lex.Pos.Offset,
				End:     lex.Pos.Offset + len(lex.Text) - 1,
				NewText: []byte(expected),
			}
		})
		if err != nil {
			panic(err)
		}
	}
	return false
}
// VisitEnumField checks the enum field.
VisitEnumField checks the enum field.
// VisitEnumField checks the enum field .
func (v *enumFieldNamesPrefixVisitor) VisitEnumField(field *parser.EnumField) bool {
	expectedPrefix := strs.ToUpperSnakeCase(v.enumName)
	if !strings.HasPrefix(field.Ident, expectedPrefix) {
		v.AddFailuref(field.Meta.Pos, "EnumField name %q should have the prefix %q", field.Ident, expectedPrefix)
		expected := expectedPrefix + "_" + field.Ident
		err := v.Fixer.SearchAndReplace(field.Meta.Pos, func(lex *lexer.Lexer) fixer.TextEdit {
			lex.Next()
			return fixer.TextEdit{
				Pos:     lex.Pos.Offset,
				End:     lex.Pos.Offset + len(lex.Text) - 1,
				NewText: []byte(expected),
			}
		})
		if err != nil {
			panic(err)
		}
	}
	return false
}
func ( v * enumFieldNamesPrefixVisitor ) VisitEnumField ( field * parser . EnumField ) bool { expectedPrefix := strs . ToUpperSnakeCase ( v . enumName ) if ! strings . HasPrefix ( field . Ident , expectedPrefix ) { v . AddFailuref ( field . Meta . Pos , " " , field . Ident , expectedPrefix ) expected := expectedPrefix + " " + field . Ident err := v . Fixer . SearchAndReplace ( field . Meta . Pos , func ( lex * lexer . Lexer ) fixer . TextEdit { lex . Next ( ) return fixer . TextEdit { Pos : lex . Pos . Offset , End : lex . Pos . Offset + len ( lex . Text ) - 1 , NewText : [ ] byte ( expected ) , } } ) if err != nil { panic ( err ) } } return false }
VisitEnumField checks the enum field.
VisitEnumField checks the enum field .