/**
 * Implements hook_field_widget_single_element_WIDGET_TYPE_form_alter().
 */
function {{ machine_name }}_field_widget_single_element_WIDGET_TYPE_form_alter(array &$element, \Drupal\Core\Form\FormStateInterface $form_state, array $context) {
  // Code here will only act on widgets of type WIDGET_TYPE.  For example,
  // hook_field_widget_single_element_mymodule_autocomplete_form_alter() will
  // only act on widgets of type 'mymodule_autocomplete'.
  $element['#autocomplete_route_name'] = 'mymodule.autocomplete_route';
}
