在visual studio社区2k17 C ++中键入数组循环时出现烦人的自动完成行为 [英] Annoying autocomplete behaviour when typing array loops in visual studio community 2k17 C++

查看:89
本文介绍了在visual studio社区2k17 C ++中键入数组循环时出现烦人的自动完成行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这不是一个主要的问题,更多的只是一种刺激,我肯定是由于我如何设置我的IDE。假设我有一个向量< string>这是做某事或其他什么,我希望通过它,我写一个循环,如下:

This isn't a major problem, more just an irritation which i'm sure is due to how i've set my IDE up. Let's say i have a vector<string> which is doing something or other, and i wish to itterate through it, i write a loop such as this:

for(int i=0;i<array.size();i++){
      (...)
}

虽然这样可以正常工作,但当我在末尾键入分号时对于array.size,它立即完成循环的括号,将分号放在for循环的末尾而不是在array.size函数的末尾,并要求我先处理
的初始混淆对我做了什么,然后在最后删除分号,将它放在正确的位置,并用i ++完成活动。这是一种轻微的刺激,并且在它发生的每个点消耗少量时间。

While this works fine, when i type the semi-colon at the end of array.size, it instantly completes the parentheses of the loop, putting the semi-colon at the end of the for loop not at the end of the array.size function and requiring me to first out handle the initial confusion of what it's just done to me, then to remove the semi-colon at the end, place it in the correct place, and complete the activity with i++. This is a minor irritation and consumes a small amount of time at each point it occurs.

是否有一些配置选项我可以改变哪个会阻止这种行为?更多的是出于兴趣,为什么visual studio首先会这样做?

Is there some configuration option i can be changing which will prevent this behavior? And more out of interest, why does visual studio do this at all in the first place?

谢谢

推荐答案

>虽然这很好用,但当我在array.size的末尾键入分号时,它会立即完成循环的括号,将分号放在for循环的末尾...

>While this works fine, when i type the semi-colon at the end of array.size, it instantly completes the parentheses of the loop, putting the semi-colon at the end of the for loop ...

我无法在我的VS 2017预览安装中重现这一点。

I can't reproduce this in my VS 2017 preview installation.

这是否适用于你最简单的例子,例如我曾尝试过的:

Does this happen for you with the most trivial of example, such as this that I've tried:

int main()

{

  &NBSP;矢量<串GT; vs;

  &NBSP; for(int i = 0; i< vs.size(); i ++)

int main()
{
    vector<string> vs;
    for ( int i = 0; i < vs.size(); i++ )

...当我输入';'时在size()之后,它出现在它应该的位置并且没有自动完成。

... when I type ';' after size(), it appears where it should and no automatic completion is done.

Dave


这篇关于在visual studio社区2k17 C ++中键入数组循环时出现烦人的自动完成行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆