Javascript TypeScript 中的区域
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12801815/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Regions in TypeScript
提问by ROFLwTIME
In my JavaScript (.js) files, I use a Visual Studio 2012 plugin for regions (here)like this:
在我的 JavaScript (.js) 文件中,我使用 Visual Studio 2012 插件来处理区域(此处),如下所示:
//#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?
我还希望在 TypeScript (.ts) 文件中有区域。现在有这种可能吗?
采纳答案by unjuken
You can download Web Essentials 2012, it lets you use regions in TypeScript.
您可以下载Web Essentials 2012,它可以让您在 TypeScript 中使用区域。
If you use, Visual Studio 2015, here is the freshest link. Web Essentials 2015.3
如果您使用 Visual Studio 2015,这里是最新链接。 网络精要 2015.3
回答by Highdown
回答by Fenton
To request a new feature for TypeScript, you should start a discussion on Codeplex.
要为 TypeScript 申请新功能,您应该开始讨论 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.
有很多关于区域是坏事的意见- 也许他们告诉您单个文件中的内容太多。TypeScript 有一种从许多不同文件加载模块的好方法,最好使用它来分离您的关注点。
回答by wonea
You can follow the TypeScript GitHub issue here
您可以在此处关注 TypeScript GitHub 问题
Still no ETA on when this will be implemented, currently awaiting more feedback.
仍然没有关于何时实施的预计时间,目前正在等待更多反馈。