When programming in UE4 when I open engine source files from within a project (e.g Actor.h) all the intellisense works as expected.
However, when I make C++ projects within UE5 and open the same engine files (e.g Actor.h) all the #include lines and others show no intellisense working.
See image below
The intellisense error is “Canot find file X” where X is the import in question.
Both UE4 and UE5 installed from the Epic Games Launcher (with Engine source and editor debugging symbols). I’m using Visual Studio 2022.
Has anyone else experienced something similar? Does anyone know how to solve this?
If this works for someone else I’d love to know what you did.
Thanks for the answer. I tried what you suggested, enabled all those settings and it didn’t work. I also uninstalled and re-installed UE5 just to be sure.
I’d like to specify some interesting points.
The intellisense is not broken within the project solution. I made new files and checked the existing ones, and all intellisense is working. This is of note since the include paths that are not working within the UE5 solution are working within my project solution.
These issues do not happen in UE4
It seems to me that the issue isn’t with intellisense not working, but more that whatever config exists that tells it about the include paths is broken in the UE5 solution?
Adding my voice into the mix, I am also experiencing these issues. Re-generating the project files works for about 2 minutes, but by the time it’s rebuilt the intellisense database my code is back to red squiggle land.
Mine seems to specify the error comes from the class definitions.
EDIT: It also appears to mostly only affect Actor files. My function library and static enum classes seem to work completely fine in the .cpp files, but display errors in the .h files.
Bumping, anyone know a fix for this? I am using UE5 precompiled engine with the source files and debug symbol addons. In VS2019 it all worked fine but VS2022 can’t handle it:
It seems random for which files work, Actor.h is b0rked for example but Character.h is fine.
Would be great to find a fix for this as VS2022 has MUCH faster intellisense especially for classes like FVector (where VS2019 would take 30s to give me suggestions)
I have learned that if you add the ‘U’ prefix to the header and .cpp file (probably A for actors), then it will work. Something with the file name is preventing it from getting a proper intellisense output.
It still has an issue with inherited functions. But, this is fine since the suggested list still shows everything appropriately.
Would like to see this get fixed.
EDIT: Forgot to mention you must also update the generated.h to include the ‘U’ as a prefix. Then clean the project, and finally rebuild.
Exit VS2022 and restart open your project you may need to rescan
Update I have tried with my source code version of UE5 using VS2022, NOT THE BINARY AS LOADED BY THE EPIC LAUNCHER, which is BUILT in VS2019, not vs2022
The BINARY is not going the generate Intellisense because it does not run
GenerateProjectFiles.bat, which generates the Intellisense paths and as the post above suggests this somehow has to be called and VS2019 cannot call VS2022 dlls.
Therefore I can go no further as I don’t use UE4 or UE5 BINARIES
So I had this same issue, where my project files had Intellisense, but not my Engine Source (I’m using a Local Binary Build built from source). I looked at the UE5.vcxproj in Intermediate/ProjectFiles with Notepad++ and saw that the source include paths were not added for the engine source (the include paths should be in the line that starts with “$(IncludePath) …”).
After running UnrealBuildTool through the debugger, and messing around with it a little bit, found out that if you add the -Engine cmd line argument when generating project files, it will fix the intellisense issues for the engine.
Not sure if this is a feature or a bug, i don’t know why -Engine isn’t automatically specified, but I hope it fixes your problem.
I’ve found that Windows Defender seems to significantly slow down VS syntax highlighting/IntelliSense. Exclusions on VS processes and the folder for the project helps significantly. Bear in mind, there’s security risks in doing this.
Furthermore, compiling in VS2022 and then Right Click → Rescan → Rescan File helps a lot and often solves highlighting problems with things like RPC routines (e.g., UFUNCTIONs marked with Server, NetMulticast, Client - where the implementation has to have _Implementation at the end). With the RPC routines, you must compile before the rescan will solve the highlighting issues with it.
If both of those two things fail and so does refresh VS solution from within Unreal editor top menu bar, then delete the compiled Binaries and rebuild the project whilst Unreal is closed.
One more thing: Hot Reload works better for me on UE5 (5.0.2) than the new Live Coding. If you change header files, close the editor and then compile from VS, then reopen the editor. Sometimes using Hot Reload doesn’t work even when the engine doesn’t crash as well, such as newly compiled binaries not being properly loaded over the old ones, so you’ll want to regularly compile without using Hot Reload anyway. Closing the editor and compiling in VS even if you haven’t made any changes will show you on the Output window that hot reload binaries are being removed, too.