简体   繁体   English

VS2012 C ++中的Intellisense配置

[英]Intellisense configuration in VS2012 C++

I have two question concerning the autofill (IntelliSense) configuration in VS2012: 关于VS2012中的自动填充(IntelliSense)配置,我有两个问题:

When I type object and then . 当我键入object然后. in QtCreator for example, it automatically recognizes, if object is a pointer or not. 例如,在QtCreator中,它会自动识别object是否为指针。 So when I type the following (where ptr is a pointer): 因此,当我键入以下内容时(其中ptr是指针):

ptr.

it automatically shows 它会自动显示

ptr->

so I don't have to type ptr + - + > as I have to in VS2012. 因此我不必像在VS2012中那样键入ptr + - + > Is there a way to change this in VS2012? 有没有办法在VS2012中对此进行更改?

Also, when I type object.si and autocomplete it to object.size then QtCreator automatically completes it to object.size() but VS2012 makes me type the ( and ) myself. 另外,当我键入object.si并将其自动完成为object.size QtCreator会自动将其完成为object.size()但是VS2012让我自己键入() Is there a way to change that? 有办法改变吗?

It appears that what you want is not possible. 看来您想要的是不可能的。 According to this MSDN article your options are rather limited. 根据这篇MSDN文章,您的选择非常有限。

In fact for VS 2012 and later, "IntelliSense Options" are even more sparse and it's information reduced to a small section in this newer MSDN article . 实际上,对于VS 2012和更高版本,“ IntelliSense选项”更加稀疏,在最新的MSDN文章中 ,其信息仅占一小部分。

If what you want is simply to be reminded that what you thought was a solid object is a pointer, when you type ptr. 如果只是想提醒您,当您键入ptr.时,您以为是一个固态对象就是一个指针ptr. and get no IntelliSense options that is your clue, you can just back up and fix it to -> . 并且没有任何IntelliSense选项是您的线索,您只需备份并将其修复为-> But if you know darn well it's a pointer and just don't like typing so much, you're out of luck. 但是,如果您知道该死的很好,那是一个指针,只是不喜欢输入太多内容,那么您就不走运了。

Similarly for the function if you type object.size then move on, you will get red wigglies which will remind you to go back and add the () . 同样,对于该函数,如果键入object.size然后继续前进,则会出现红色摆动,这会提醒您返回并添加() But if it's just that you don't feel like typing them? 但是,仅仅是因为您不想输入它们吗? No. Though Visual Studio 2013 will close them for you - if you type ( it will do the ) and similarly for [ , { , etc. 不会。尽管Visual Studio 2013会为您关闭它们-如果您键入(它将执行)并且类似地为[{等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM