Drupal - Debug plugin discovery

Most of the time it is because the file is not picked up, there are a few common cases for that:

  1. Ensure that the filename matches the class name exactly, case sensitive. Without the extension of course.

  2. Ensure that the namespace matches the folder path exactly, case sensitive.

  3. Restart Apache to clear apcu cache, I've had issues with this when renaming/moving files with a class quite a bit in Drupal 8. Also setting class_loader_auto_detect to FALSE in settings.php should solve this one.

There are even more things to check if you're actually the one providing the plugin type such as the plugin manager.