protected function addPluginTypeServiceDataAnnotated(&$data, $service, $discovery) {
    $reflection = new \ReflectionClass($service);

    // Get the properties that the plugin manager constructor sets.
    // E.g., most plugin managers pass this to the parent:
    //   parent::__construct('Plugin/Block', $namespaces, $module_handler, 'Drupal\Core\Block\BlockPluginInterface', 'Drupal\Core\Block\Annotation\Block');
    // See Drupal\Core\Plugin\DefaultPluginManager
    // The list of properties we want to grab out of the plugin manager
    //  => the key in the plugin type data array we want to set this into.
    $plugin_manager_properties = [
      'subdir' => 'subdir',
      'pluginInterface' => 'plugin_interface',
      'pluginDefinitionAnnotationName' => 'plugin_definition_annotation_name',
    ];
    foreach ($plugin_manager_properties as $property_name => $data_key) {
      if (!$reflection->hasProperty($property_name)) {
        // plugin.manager.menu.link is different.
        $data[$data_key] = '';
        continue;
      }

      $property = $reflection->getProperty($property_name);
      $property->setAccessible(TRUE);
      $data[$data_key] = $property->getValue($service);
    }
  }