#Include error and Intellisense not working

Whenever I open up visual studio code I get a #include path error and my IntelliSense is not working. I know it has something to do with the .vscode folder not generating correctly

Did you do Tools > Refresh VS Code project within Unreal?

Yes. I have done this and still no luck. I noticed whenever I was watching the course he was having the same issue as well, a red squiggly line like I have. so I’m assuming he had the same errors as I did

What are the issues that are being reported?

#include errors detected. Consider updating your compile_commands.json or includePath. Squiggles are disabled for this translation unit. Then The Path

There is also another errors
cannot open source file “initializer_list” (dependency of Cpp.h File Path

Would you mind showing a screenshot of your full VS Code window as well as the contents of the compileCommand json files?

I get the same error but so does the teacher.

I was having trouble with this too so I put in some work to figure it out because intellisense/lookup are so important. Attached is an image showing that autocomplete (it knows UE FVector) and lookup are working. Plus no red lines on includes.

Make sure to do:

  1. If in doubt purge your vs code install and start fresh. I purge and reinstall all the time. Clarifies my understanding and makes annoying errors go away. All my current VS Code settings are out of the box or effected by listed extensions. If I start with no VS Code, then install it, the following steps are all that is needed to get the displayed functionality. I myself deleted VS Code clean to make sure all settings were default again.

  2. Edit->Editor Preferences->Source Code->Source Code Editor->Visual Studio Code

  3. Tools->Refresh Visual Studio Code Project

  4. Tools->Open Visual Studio Code

  5. Get all of the extension in my screen shot. They’re not all required but start with them all, replicate the functionality, then work from there to whatever setup you want seeing if intellisense works every step.

  6. The Unreal Engine Tools extension wants ClangD extension which is mutually exclusive with the MS C++ extension. This alternative setup requires more work and I havent spent time to get it working yet. As it is the current extensions work great out of box.

  7. Here is a text paste of the extensions for your convenience:

PS C:\Users\indig\Documents\Unreal Projects\CryptRaider5.3> code --list-extensions --show-versions
captncaps.ue4-snippets@2.0.1
jawsingale.search-unreal-documentation@0.1.0
ms-vscode.cmake-tools@1.17.17
ms-vscode.cpptools@1.19.9
ms-vscode.cpptools-extension-pack@1.3.0
ms-vscode.cpptools-themes@2.0.0
openpixel.unreal-engine-4-helper@0.3.2
twxs.cmake@0.0.17
PS C:\Users\indig\Documents\Unreal Projects\CryptRaider5.3>
  1. If you paste those exts into a file called “exts” you can use the vscode cli “code” command to install them conveniently via (I use “git bash” on windows 11 to have some nice nixy tools):
cat exts | xargs -n 1 -I {} code --install-extension {}

Just to follow up, I may have been off-base as some very localized intellisense errors are just due to it not quite processing UE’s complex architecture correctly. So just ignoring them seems best.

That being said updating the IDE files and rest of steps described above can help with other itellisense errors.

Privacy & Terms