Intellisense/UMacros comments fix using cpp.hint

(update: Should work with all compilers) This has been tested with VSCode using MSBuild tools 2019.

Visual Studio should also support cpp.hint files.

This fix is thanks to sean-mcmanus, one of the the VSCode cpptools devs. I had off and on been trying to fix this for years. Reminder that you can always ask people smarter than you!

  1. Create a cpp.hint file for both root workspace directories
K:\Users\me\Documents\Unreal Projects\BuildingEscape\cpp.hint
J:\Program Files\Epic Games\UE_4.26\cpp.hint
  1. Put this in both cpp.hint files
#define UFUNCTION(...) extern
#define UPROPERTY(...) extern
  1. Now any comments that are above UFUNCTION and UPROPERTY will show up with Intellisense Hover and Function completion.

  2. This could potentially work with all UMacros. I’ve only test UFUNCTION and UPROPERTY so far.

There’s currently a VSCode bug where you might not see the changes.

  1. If you don’t see any changes try adding a line and removing it(or make changes to it) from the file you don’t see the changes in. Might take a few seconds.

  2. If that doesn’t work you need to reset the Tag Parser database.

    a. In VSCode go to View->Command Pallet.

    b. A window should pop up. Type reset in this window and code completion should show an option for C/C++: Reset Intellisense DataBase. Click this option.

    c. The Tag Parser reset might take 15-20 minutes on an UE4 project.

1 Like

This is really handy. Thanks for sharing.

Added update from sean-mcmanus which said it should work on all compilers.

He also mentioned a workaround for a VSCode bug if it doesn’t work.

Privacy & Terms