How to extend Views Plugin ViewsSelection.php to have $form_state I need to add in the current $form_state into the ViewsSelection. I have copied the file /core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php to /modules/custom/fsed_entry/fsed_project_entity_reference_options/src/Plugin/EntityReferenceSelection/ProjectsSelection.php where I have the file overriding views' implementation. However, I can't seem to figure out how to get $form_state into my variables so that I can use a value from another form element. I have been trying to experiment with FormCache but I have not been successful. Any ideas on best approach here?

For background, I need the $form_state because the field that is being rendered (and this plugin is used on) here was ajaxed in and I want to pass in a value that I can add onto the handler_settings -&gt; view -&gt; arguments that this plugin uses.
There is no form state, at least not with autocomplete. And since the same code is designed to work with autocomplete and other widgets, it can't rely on form state anywhere.

If you have autocomplete you can possibly pass in the settings in the entity_autocomplete form element which should be passed to your plugin. Not sure about other widgets, you might need your own widget to be able to do that.