Williams, 21, played through the pain barrier against Sheffield United in the playoffs but will have the operation tomorrow to repair the damaged ligaments.
It is thought he will be out for anything up to three months suggesting he will withdraw from the Scotland Under 21 squad to face Germany on Friday 6 June.