Loss of knee extension is called a knee flexion contracture. It means your knee is stuck in a position of flexion and can't straighten all the way. Without full knee extension, your ability to walk is affected. Not only does it take more energy to walk without full extension, but it slows you down!
Most surgeons would advise a total knee replacement. Preoperative casting or stretch-bracing have been suggested to reduce the knee flexion contracture. The idea is to restore as much motion as possible to make the surgery easier.
There are very few studies to investigate this idea. It's likely the time it would take to gain a few degrees of motion wouldn't be worth the extra pain and loss of daily function. Extension can be much more easily restored during surgery.
The surgeon will take the necessary steps to balance the soft tissues and remove any bone spurs affecting motion. Joint motion is checked and rechecked during the operation. Minor adjustments are made in bone structure, joint capsule, and tendon length until full motion is available.