How do you define the diameter of the Sun That is, it's twice the radius where the radius is from the centre of the sun to some edge. But what is that edge?
Most literature will define the diameter of the Sun up to the photosphere, the layer of the solar atmosphere you would see if you were to observe the Sun in white light.

The base of the Photosphere is defined as the region where the optical depth is around 2/3, or the region where the plasma becomes transparent to most optical light wavelengths. 

Of course the true edge of the solar atmosphere could be considered as the heliopause, where the direct influence of the Sun's magnetic field and solar wind end and interstellar space begins.