How do I see the names of all view fields in the formatter option form? I am extending the StylePluginBase to make a custom views formatter. I would like to add a select box in the option menu with a list of all the fields currently listed within the view. How do I pull the list of fields into the buildOptionsForm function? Does the FormStateInterface have the view buried in it somewhere that I need to do something like:

$options = [];
$view = $form_state-&gt;view;
foreach($view-&gt;fields as $field){
  $options[] = $field-&gt;name;
}
A little late, but maybe still helpful for someone.
You can use $fields = $this-&gt;displayHandler-&gt;getFieldLabels(TRUE); to get an array of all currently chosen fields in the view.