After highlighting the assignment in the source editor, go to the console and run this function. The selected code will be run and if it is reactive, it will be loaded as a funciton.

convert_selection()