If you copy and paste folded code in vscode or jetbrain IDEs, the code will expand automaticly. What you see is not what you get.
But sometimes we’d like to keep the code folded, we just need the skeleton. So how to do it?
Step1: Open your file by vscode
cmd + shift + p (mac) or
ctrl+shift+p (windows) to open
Command Palette, search and select
Step3: Toolbar -> Selection -> Column Selection Mode
Step4: Column select all the code, copy and paste, done!
check the gif https://cdn.liushiming.cn/img/2022-04-14_21-18-44.gif