장고 앱을 개발하다가 하나의 앱에 View 수가 많아져서 C 계열 언어처럼 전처리기로
#region ~ endregion
으로 뷰를 한방에 묶어서 접어두고 싶었다.
그래서 시작한 폭풍 구글링.
근데 파이썬은 부모만 C계열 언어지, 전처리기는 사용할 수 없다는 안타까운 소식을 접했고...
꿩 대신 닭이다, 이가 없으면 잇몸으로라도 하자는 마음에 VSCode 확장프로그램 탭을 열고, region이라고 검색해봤다.
https://marketplace.visualstudio.com/items?itemName=maptz.regionfolder
#region folding for VS Code - Visual Studio Marketplace
OverviewQ & ARating & Review Visual Studio Code Custom Folding Extension This extension enhances the default code folding abilities of Visual Studio Code editor. Regions of code that you'd like to be folded can be wrapped with #region comments. The precise
marketplace.visualstudio.com
얄루! 마침 파이썬의 주석과 같은 #을 사용한다.
요렇게 지저분했던 녀석들이 우측처럼 다 접혀 들어갔다.
끝!
Github repository: https://github.com/maptz/Maptz.VSCode.Extensions.customfolding
'Web App > Python - Django' 카테고리의 다른 글
[Django] MySQL 1366, "Incorrect string value:" 오류 해결 (0) | 2019.11.07 |
---|