The emission shape is a property of the ParticlesMaterial. If you hover your mouse on the material, you'll see the property name is
process_material. Hovering on the emission shape shows
emission_shape. Since you said "extents", I assume you're using a "Box" shape, in which case the extents property is
So, to set it:
$Particles2D.process_material.emission_box_extents = Vector3(2, 2, 2)
All this and more in the ParticlesMaterial reference.