So last night I think I was somehow stretching in my sleep, not constantly, just maybe like one long stretch of my legs at some point. Problem was this wasnt like a good stretch, more a huge tendon-yanking stretch . I remember it hurting when it happened, though I wasnt really conscious

Long story short, its morning and in my right leg, the (tendon?) from below the knee (on the back-facing side) to my ankle hurts like hell when extended (ie im standing up).

Anyone know any causes or solutions? Dont think its the first time Ive done this, but certainly the most severe