When a new extension attribute is defined or the type of an existing extension attribute is changed, the generated extension attributes class needs to be deleted (e.g. Magento\Catalog\Api\Data\ProductExtension).
Ideally the watcher would determine the type that needs to be deleted and remove only that one class, but that would require parsing and diffing, and I think that's more effort than it's worth.
Probably it's more stable and fast enough to simply remove all generated *Extension classes in generated/code when an extension_attributes.xml file is changed.
When a new extension attribute is defined or the type of an existing extension attribute is changed, the generated extension attributes class needs to be deleted (e.g.
Magento\Catalog\Api\Data\ProductExtension
). Ideally the watcher would determine the type that needs to be deleted and remove only that one class, but that would require parsing and diffing, and I think that's more effort than it's worth. Probably it's more stable and fast enough to simply remove all generated*Extension
classes ingenerated/code
when anextension_attributes.xml
file is changed.