Regions in TypeScript [closed]

烂漫一生 提交于 2019-12-20 10:16:52

问题


In my JavaScript (.js) files, I use a Visual Studio 2012 plugin for regions (here) like this:

//#region "My Region"

//Code here

//#endregion "My Region"

I would also like to have regions in TypeScript (.ts) files as well. Is this a possibility right now?


回答1:


You can download Web Essentials 2012, it lets you use regions in TypeScript.

If you use, Visual Studio 2015, here is the freshest link. Web Essentials 2015.3




回答2:


Visual Studio 2017 also has support for regions here.

Support via Web Essentials for older versions may be found here.




回答3:


To request a new feature for TypeScript, you should start a discussion on Codeplex.

There are lots of opinions about regions being a bad thing - perhaps they are telling you that you have too much in a single file. TypeScript has a great way to load modules from many different files and it may be better to use that to separate your concerns.




回答4:


You can follow the TypeScript GitHub issue here

TypeScript Regions #11073

Still no ETA on when this will be implemented, currently awaiting more feedback.



来源:https://stackoverflow.com/questions/12801815/regions-in-typescript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!