Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get IntelliSense to reliably work in Visual Studio 2008

Does anyone know how to get IntelliSense to work reliably when working in C/C++ projects? It seems to work for about 1 in 10 files. Visual Studio 2005 seems to be a lot better than 2008.

Edit: Whilst not necessarily a solution, the work-around provided here:

How to get IntelliSense to reliably work in Visual Studio 2008

Is probably the best bet if I want a decent IntelliSense system.

like image 752
Mark Ingram Avatar asked Sep 02 '08 13:09

Mark Ingram


People also ask

How do I enable IntelliSense in Visual Studio?

To access this options page, choose Tools > Options, and then choose Text Editor > C# > IntelliSense.

How do I refresh IntelliSense in Visual Studio?

For Visual Studio 2017 (and I think Visual Studio 2019 also), close Visual Studio, go into the . vs folder in your projects folder and delete all the contents apart from the . suo file, then reopen Visual Studio. This way you can rebuild the Intellisense cache without losing your preferences.

How do I enable IntelliSense in Visual Studio 2010?

The fix was to look in Visual studio menu: Resharper > options Then select IntelliSense > General -> use IntelliSense features of: Visual Studio.


2 Answers

Native C++ intellisense does not work reliably in any version of Visual Studio. I find there are two common problems:

1) Header file paths are not set-up correctly. When you find a type where intellisense is not working, use the IDE to click through each header file to find the one containing the type. (Right click on #include and select Open Document...). If this fails before you get to the file which declares the type then this is your problem. Make sure header file search paths are set-up correctly.

And,

2) The intellisense database is corrupt. This happens ALL The time. You need to close the solution, delete the .ncb file, and then reopen the solution. I posted the macro I use for this in answer to another question here.


The preprocessor can also confuse intellisense - so make sure any #defines during build are also available to intellisense. Other than that, I don't know what else can break it. I've not seen any particular issues with forward declarations.

like image 108
John Richardson Avatar answered Sep 30 '22 18:09

John Richardson


I've also realized than Intellisense is sometime 'lost', on some big project. Why? No idea.

This is why we have bought Visual Assist (from Tomato software) and disabled Intellisense by deleting the dll feacp.dll in the Visual studio subdirectory (C:\Program Files\Microsoft Visual Studio 8\VC\vcpackages)

This is not a solution, just a workaround.

like image 21
Steve Gury Avatar answered Sep 30 '22 18:09

Steve Gury