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

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.
Thank you.

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

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 -

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).
Upon typing something like std::cout. a dropwdownlist with possible completitions should pop up.

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

Goto => Tools >> Options >> Text Editor >> C/C++ >> Advanced >>
IntelliSense
Change => Member List Commit Aggressive to True

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.
If it doesn't work for you at all, and it used to, and you've checked the VS options, maybe this can help.

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

I came across over the following post:
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.
After enabling the database you must close and reopen visual studio
for autocomplete use 'ctrl'+'space'

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

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.
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.

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.
Step 1: Go to settings
Step 2: Search for complete and enable all the auto complete functions
I believe that show help

Related

Remove type prefixes when passing parameters / fields in Visual Studio 2022 [duplicate]

I recently started using C in Visual Studio, and I've been having an issue where Visual Studio automatically lists the name of parameters in front of arguments to functions. It's possible I unintentionally pressed a key.
Example:
As you can see in the image, the _Format: is being displayed, which is quite annoying. I have browsed through the text editor settings, but I can't seem to find the issue.
I mainly use VS for C#, and so far this only seems to happen with C. Any solution would be appreciated.
First step, go to options. Press Ctrl+Q then type "inline":
Second step, uncheck inline hints:
I use C#, but I think the settings are the same here.
As one answer already stated, this option exists for C#.
But if that doesn't work for C, check the following link:
similar problem
Quote from the linked answer:
"If you're using C/C++ the inline hints works a bit differently. Here alt-F1 or Ctrl-Ctrl can TOGGLE hints."

Configuring Visual Studio 2019 to automatically pick up the highlighted option from intellisense in C++ by hitting enter

The intro text says it all. I tried messing around with options related with the intellisense on VS, but no success. I mean, it does pick our options via enter, but, by the default, we gotta confirm the selection with the arrow keys first, which is an unnecessary step. Any clues?
To implement your idea, you need to set Member List Commit Aggressive to true.
The specific path is Tools->Options->Text Editor->C/C++->Advanced->Member List Commit Aggressive.

Auto Formatting statements in VS Code

I am new to VS Code coming from Visual Studio 2017 and I really miss the auto-formatting options there. Like:
Automatically format statement after I type a ;
Automatically format block when I type }
Automatically format braces when they are automatically completed
My question is that is there any way to get these on options on VS Code, such as some tweaks on the settings.json?
I assume the C++ extension is enabled. To check if it is, go to the extensions tab on the left, and at the top click the three dot button and click "Show Built-in Extensions." That's where the C++ extension would be.
And I assume you've already checked this out, but there is some additional info here in the docs about including a .clang-format file and the fallback option if you don't.
vscode-cpp-docs
In theory you should be able to format using the provided "editor.formatOnType" setting. If not, try installing the Clang-Format extension and see if that works.
Clang-Format

Commit C++ Intellisense suggestion with space bar in VS 2013

I have recently been exploring C++ some after using C# exclusively for quite awhile. I'm using Visual Studio 2013 and the one thing that is bugging me to death is the inability to commit an Intellisense suggestion by pressing the space bar. I have tried to edit the commit character list in Options -> Text Editor -> C/C++ -> Advanced to accept the space bar but so far I've had no luck. Coming from C# this is very aggravating. Does anybody know if it's possible to make such a change? I know I can use Tab or Enter, but in my opinion using Space is far more fluid.
Any information would be greatly appreciated.
UPDATE: Space seems to commit some suggestions but not others. if I type "std::stri", it commits "std::string". Unfortunately, Intellisense won't commit anything created by me or even common keywords. It just adds a space after what I already typed.
Further to my comment on your question, I have installed the trial version of Visual Studio 2013 (Ultimate), and can confirm that space bar does work to complete IntelliSense suggestions. Combining all comments, it would appear that it works in the following versions:
VS 2010
VS 2012
VS 2013
Here is a screenshot of my IntelliSense settings located at Tools > Options > Text Editor > C/C++ > Advanced:
As a last resort you may want to try changing all your settings back to default, as suggested in this answer:
Tools > Import and Export Settings > Reset all settings
UPDATE: After reading JoshC's comments, I have experimented a bit more and I get the problem too. It appears to be related to whether or not the item you are trying to autocomplete is a member of a type or namespace. If it is (e.g. std::string) then space will work. If it is not (e.g. void) then it will not work (but for some reason, tab will work). As per this link, you can manually invoke the "List Members feature" by pressing CTRL+J in which case on a blank line it will include items which are in the global namespace - however this is clearly not a practical solution.
I have no idea why it discriminates between space and tab in this way. If anyone is aware of a workaround please let me know and I will edit this answer again.
The following would seem to imply that there is no solution for C++:
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2656132-support-committed-by-pressing-the-space-bar-in-c
When using Visual Studios 2012 for coding in C++, how do you autocomplete code selected in IntelliSense? (see comments)

Are there any Visual Studio add-ins for true 'smart tabs'?

'Smart Tabs' concept allows to automatically insert tab character for block indentation and space characters for in-block formatting. It's described here. Unfortunately, Visual Studio's 'smart tabs' option in text editor settings just indents text on enter press. Same name, completely different and near useless thing :). So, maybe someone knows of a visual studio addin that can change how 'tab' key work so it will insert tab characters and space characters according to rules mentioned above? Any hints are welcome.
Update: I need it for C++. According to comments, ReSharper can do something like this, but only for Basic and C#.
I have mapped the tab-button to Edit.FormatSelection in Visual Studio to achieve this and it works very well for me. I have also remapped the normal functionality of tab so that I still can access them (Edit.InsertTab and Edit.TabLeft).
If no one comes up with an "as-you-type" utility, then Astyle with its convert-tabs and indent=tab options will reformat code after-the-fact.
ReSharper does this pretty well, and is highly configurable.
Have you looked at Visual Assist?
It's been a while since I used it (back on VC++ 6.0!), and I can't see a mention of "Smart Tabs" on the home page, but it might be there somewhere.