如何在 Visual Studio C++ 快速版中启用自动完成功能?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3253289/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 12:27:12  来源:igfitidea点击:

How do you enable auto-complete functionality in Visual Studio C++ express edition?

c++visual-studioautocomplete

提问by Asad

Please guide me, how do you enable autocomplete functionality in VS C++? By auto-complete, I mean, when I put a dot after control name, the editor should display a dropdown menu to select from.

请指导我,你如何在 VS C++ 中启用自动完成功能?通过自动完成,我的意思是,当我在控件名称后面放一个点时,编辑器应该显示一个下拉菜单以供选择。

Thank you.

谢谢你。

回答by nisse

Start writing, then just press CTRL+SPACE and there you go ...

开始写作,然后只需按 CTRL+SPACE 就可以了...

回答by Praveen Fernando

When you press ctrl + space, look in the Status bar below.. It will display a message saying IntelliSense is unavailable for C++ / CLI, if it doesn't support it.. The message will look like this -

当您按 ctrl + 空格键时,查看下面的状态栏.. 它会显示一条消息,指出 IntelliSense 对于 C++/CLI 不可用,如果它不支持它.. 消息看起来像这样 -

enter image description here

在此处输入图片说明

回答by thebunnyrules

All the answers were missing Ctrl-J (which enables and disables autocomplete).

所有答案都缺少 Ctrl-J(启用和禁用自动完成)。

回答by ved prakash

  • Goto => Tools >> Options >> Text Editor >> C/C++ >> Advanced >> IntelliSense
  • Change => Member List Commit Aggressive to True
  • 转到 => 工具 >> 选项 >> 文本编辑器 >> C/C++ >> 高级 >> IntelliSense
  • Change => Member List Commit Aggressive to True

回答by Tony

Include the class that you are using Within your text file, then intelliSense will know where to look when you type within your text file. This works for me.

在文本文件中包含您正在使用的类,然后当您在文本文件中键入时,intelliSense 将知道在哪里查看。这对我有用。

So it's important to check the Unreal API to see where the included class is so that you have the path to type on the include line. Hope that makes sense.

因此,检查 Unreal API 以查看包含类的位置非常重要,这样您就可以在包含行中输入路径。希望这是有道理的。

回答by DumbCoder

Have you tried Visual Assist X ? Sort of lights up the VS editor.

你试过 Visual Assist X 吗?有点点亮 VS 编辑器。

回答by Christian

It's enabled by default. Probably you just tried on an expression that failed to autocomplete.

它默认启用。可能您只是尝试了一个无法自动完成的表达式。

In case you deactivated it somehow... you can enable it in the Visual Studio settings. Just browse to the Editor settings, then to the subgroup C/C++ and activate it again... should read something like "List members automatically" or "Auto list members" (sorry, I have the german Visual Studio).

如果您以某种方式停用它……您可以在 Visual Studio 设置中启用它。只需浏览到编辑器设置,然后到子组 C/C++ 并再次激活它...应该阅读类似“自动列出成员”或“自动列出成员”(对不起,我有德国 Visual Studio)。

Upon typing something like std::cout. a dropwdownlist with possible completitions should pop up.

键入 std::cout 之类的内容时。应该会弹出一个包含可能完成的下拉列表。

回答by cHao

VS is kinda funny about C++ and IntelliSense. There are times it won't notice that it's supposed to be popping up something. This is due in no small part to the complexity of the language, and all the compiling (or at least parsing) that'd need to go on in order to make it better.

VS 关于 C++ 和 IntelliSense 有点有趣。有时它不会注意到它应该弹出一些东西。这在很大程度上是由于语言的复杂性,以及为了使它更好而需要进行的所有编译(或至少是解析)。

If it doesn't work for you at all, and it used to, and you've checked the VS options, maybe this can help.

如果它根本不适合你,它曾经是,并且你已经检查了 VS 选项,也许这可以帮助

回答by yanger

I came across over the following post: http://blogs.msdn.com/b/raulperez/archive/2010/03/19/c-intellisense-options.aspx

我遇到了以下帖子:http: //blogs.msdn.com/b/raulperez/archive/2010/03/19/c-intellisense-options.aspx

The issue is that the "IntelliSense" option in c++ is disabled. This link explains about the IntelliSense database configuration and options.

问题是 C++ 中的“IntelliSense”选项被禁用。此链接解释了 IntelliSense 数据库配置和选项。

After enabling the database you must close and reopen visual studio for autocomplete use 'ctrl'+'space'

启用数据库后,您必须关闭并重新打开 Visual Studio 以自动完成使用 'ctrl'+'space'

回答by PoChien Wang

'ctrl'+'space' will open C/C++ autocomplete.

'ctrl'+'space' 将打开 C/C++ 自动完成。