有没有人制作过 VS 代码片段来基于“item”?在camelCased集合的foreach中?
我一直使用 foreach 快捷方式。在很多情况下我都会做同样的事情,我认为最好保存最后一步。
顺序如下,最后一步是我希望自动发生的。
我的问题几乎是:是否有人已经做到了这一点,或者非常擅长自定义代码片段,或者非常好以至于他们可以真正快速地做到这一点?
我已经不止一次地阅读过有关代码片段的文档,并且由于某种原因拒绝为我点击这些内容之一。
I type:
foreach<tab><tab>
Result:
foreach (**var** item in collection)
{
}
I type:
<tab><tab>
Result:
foreach (var item in **collection**)
{
}
I type (using auto complete specific to my project): camp<tab>
Result:
foreach (var item in **campaignList**)
{
}
-->我想要做的是根据Camel Cased的campaignList自动使项目变成“campaign”<--
Type: shift-<tab>shift-<tab>
foreach (var **item** in campaignList)
{
}
Type: campaign<enter>
foreach (var campaign in campaignList)
{
}
I use the foreach shortcut all the time. In many cases I do the same thing and I think it would nice to save the last step.
The sequence follows, with the last step being what I'd like to have happen automatically.
My question is pretty much: has anyone already done this or is so good with a custom code snippet or so good that they could do it real quick?
I've read the docs on code snippetts more than once and it's one of those things that for some reason refuese to click for me.
I type:
foreach<tab><tab>
Result:
foreach (**var** item in collection)
{
}
I type:
<tab><tab>
Result:
foreach (var item in **collection**)
{
}
I type (using auto complete specific to my project): camp<tab>
Result:
foreach (var item in **campaignList**)
{
}
--> What I would like to do is automatically make item turn into 'campaign' here based on campaignList being camel cased <--
Type: shift-<tab>shift-<tab>
foreach (var **item** in campaignList)
{
}
Type: campaign<enter>
foreach (var campaign in campaignList)
{
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您始终可以编写自己的代码片段。
You can always write your own code snippets.