Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

VSCode/UE Intellisense Fixes Extension

Table of Contents


Unreal Engine

Compatible

  • 4.25
  • 4.26.1+
  • 5.0.0+

(newer Unreal Engine versions may require latest extension)

Incompatible

  • 4.26.0

General

This is the README for version 2.4.0 of the extension "UE Intellisense Fixes".

It currently supports Unreal Engine v4.25, v4.26.1+, and 5.0.0+

Feel free to comment about it here: https://gist.github.com/boocs/f63a4878156295b6e854cac68672f305#comments

Make sure to add @boocs to the comment to only notify me of the new comment.

You can comment about anything including any code quality comments. I'm just starting out in TypeScript and never really learned JavaScript so any info is great.

Code is hosted here: https://github.com/boocs/ue4-intellisense-fixes

Features

General

  • Fixes Unreal Engine/VSCode Intellisense config issues on startup.
    • It must happen at startup or the Tag Parser will add unneeded symbols to the browse cache file
  • Auto adds new files to compile commands file
  • Can force C++ standard in c_cpp_properties.json
  • Can force compiler path in c_cpp_properties.json (and compile commands file)
  • Added auto M1 Mac support (untested so let me know if it's working)

Logs

  • You can also see a log of what the extension is doing:

  • You can also get to the log by clicking on this icon. It will appear for 2 minutes after the extension is done.

Requirements

  • VSCode v1.63.1 or higher
  • Microsoft's C/C++ extension (ms-vscode.cpptools)
  • A VSCode project setup by the Unreal Engine (must set the engine to use VSCode)

Installation

  1. Download from here: https://github.com/boocs/ue4-intellisense-fixes/releases/

  2. Click the VSIX file to download (version will be different than pic)

    1. Click the Extensions button inside VSCode
    2. Click the ellipsis (3 dots) in upper-right corner of left side panel
    3. Choose "Install from VSIX..."
    4. Select the vsix file you just downloaded from GitHub

Running

The extension will fix your projects on startup of VSCode.

  1. You must first enable fixes in the settings. (see Extension Settings)

  2. After enabling fixes, restart VSCode for it to fix your project.

Tag Parser Cache

  1. After the fix has run and it's working, on your UE4 project, make sure to reset the Tag Parser cache to take advantage of the smaller cache size

  2. From the VSCode Command Palette, type reset and choose 'C/C++: Reset Intellisense Database'

  3. It'll take ~15 minutes for the Tag Parser to finish running

  4. You should only have to do this once. (Not after each extension update)

Multiple module projects

When you add new source/header files and restart VSCode, to fix Intellisense for the new files, the extension will ask what response file you want to use for each new file.

If you don't want to mess with figuring it out, cancel the choice menu and reset your project which should fix it instead.

Extension Settings

  • Note: For v2.0.0+ search for settings using "ue intellisense" instead of ue4
  • Fixes are disabled by default. You must enable them.
  • You can only set these settings in the global User settings.
  • Restart VSCode for newly enabled fixes to take effect.

Here are the settings:

This extension contributes the following settings:

Versions 2.0.0+

  • UEIntellisenseFixes.enableFixes false
  • UEIntellisenseFixes.enableOptionalFixes false
  • UEIntellisenseFixes.cppStandard "" : Force C++ standard in c_cpp_properties.json
  • UEIntellisenseFixes.compiler.path "" : Force compiler path in c_cpp_properties.json UEIntellisenseFixes.compiler.strictPath false : Force compiler path in compile commands file

Known Issues

Note: If you've installed with a vsix file you can safely install new updates without uninstalling any previous version.

In very old versions there could be conflicts with fixes previously done.

  • Remove old unused settings

  • Remove any prior fixes and reset your project.

  • Delete old ue4-intellisense-fixes extension folder prior to copying new one over

Note: You can skip this step if you've never fixed your project's Intellisense.

To reset your project: Reset

Note: The wording may be different depending on your IDE

Example:

Note: You should only have to do this once per project.

Release Notes

https://github.com/boocs/ue4-intellisense-fixes/blob/master/CHANGELOG.md

Removing old unused settings

(Only for very old non-vsix installations)

Go to your global User settings file.

Easiest way to open this file:

  1. Go to your settings and click on User

  2. Scroll down till you see any setting with "Edit in settings.json" and click it.

  3. This will take you to the global user setting but will also automatically paste the random setting. Delete this newly created setting if you don't want it

  4. Now look in the file for old UE4Intellisense settings. Delete these.

Uninstalling

You can uninstall/disable the extension and then do a non-destructive reset of your project. Everything should be back to normal.

Comments

Comment using the gist feature below: (Must be signed in)

Use @boocs to notify only me that there's a new message

Help

Simple

For simple questions or comments use the gist comments below. Make sure to add @boocs to your comment so it only notifies me of a new comment.

Advanced

For advanced help post here:

https://github.com/boocs/ue4-intellisense-fixes/issues

Before posting make sure to do a non-destructive reset of your project.

Reset

This is a non-destructive reset

  • Close VSCode
  • Right click on project's *.uproject file (in project's parent directory)
  • Choose Generate Visual Studio project files... (Or something similiar)
  • Start VSCode so the extension fixes can take affect

To Top

@boocs
Copy link
Author

boocs commented Apr 13, 2022

@Etaash-mathamsetty

I released an update to hopefully fix it. Thanks again for your help!

@Etaash-mathamsetty
Copy link

Etaash-mathamsetty commented Apr 13, 2022

regex works, but intellisense is still complaining even after full reload of intellisense

@boocs
Copy link
Author

boocs commented Apr 13, 2022

@Etaash-mathamsetty

  1. Is this a full source code project?
  2. Have you added any code to your project or is it a brand new project?
  3. Can you post a pastebin link with the extensions logs? Make sure to remove any personal identification from the log, like in some file paths, if you want. Pastebin doesn't require login to post stuff.
  4. Post the first few Intellisense errors here as well.

Note: Start putting @boocs at the top of all your posts so people don't get your replies in their e-mail. At least I think that's how it works. But to be sure you can use @boocs

@Etaash-mathamsetty
Copy link

Etaash-mathamsetty commented Apr 13, 2022

@Etaash-mathamsetty

  1. Is this a full source code project?
  2. Have you added any code to your project or is it a brand new project?
  3. Can you post a pastebin link with the extensions logs? Make sure to remove any personal identification from the log, like in some file paths, if you want. Pastebin doesn't require login to post stuff.
  4. Post the first few Intellisense errors here as well.

Note: Start putting @boocs at the top of all your posts so people don't get your replies in their e-mail. At least I think that's how it works. But to be sure you can use @boocs

@boocs

  1. yes
  2. brand new
  3. (ill add it here when I have the log)
  4. it just says "source file not found" for every include

@abc6239657639
Copy link

abc6239657639 commented Apr 22, 2022

@boocs
image

image
include files seems OK ,but other cpp or h files exclude plugins' files seems not OK.

@boocs
Copy link
Author

boocs commented Apr 22, 2022

@abc6239657639

I tested a DECLARE_DYNAMIC on a 4.25 project and it worked for me although it wasn't a plugin so maybe that's the reason.

Can you paste the full TwoParams macro?
What error messages are you getting with these in your VSCode console->problems window?

@JoshEthan
Copy link

JoshEthan commented May 3, 2022

@boocs I am also having issues with the Ubuntu and the VS Code Intellisense.

  • This the the UE5-preview source code.
  • I added new code. Just a simple new Actor class.
  • Extension Log: https://pastebin.com/jDuc7m43
  • UE Intellisense Fixes Log: https://pastebin.com/G6gGFMmC
  • Some of the errors include: #include errors detected. Consider updating your compile_commands.json or includePath. Squiggles are disabled for this translation unit (/home/user/Documents/Unreal Projects/ClassCreation/Source/ClassCreation/LightSwitchCodeOnly.cpp) and cannot open source file "LightSwitchCodeOnly.generated.h"

@boocs
Copy link
Author

boocs commented May 3, 2022

@JoshEthan

Usually generated.h files are created when you Build. Have you Built after adding the class? Do you get any Build errors?

@JoshEthan
Copy link

JoshEthan commented May 3, 2022

@boocs No build errors. I can build after making the class. The only issue is VS Code recognizing the #includes and having intellisense work properly. I get the red squiggly lines.

@boocs
Copy link
Author

boocs commented May 3, 2022

@JoshEthan

So the error started only after adding a new class?

Could be my auto add new files to compile commands is broken on Linux/Full source. In the .vscode folder, of your project, there should be 1 or 2 compileCommands_*.json files.

  • If you open them do they contain an entry to your new class that was just added?
  • Do the new class entries look different than the rest of the entries?
  • Also if you close the new class files and open a .h/.cpp file that was first create with the project do these original files have errors?

You can also add new files to your compile commands with a soft reset of your project. Try a soft reset by right clicking on the *.uproject file and choosing Generate Visual Studio project files... I forget if this is a more heavier operation with the full source version. If it is, it would be nice for my auto add files to compile commands to work on Linux/full source.

@JoshEthan
Copy link

JoshEthan commented May 3, 2022

@boocs
I don't have an exact time of the error. The error could have been before I added the class. I only got your extension after I had created the class..

  • Both compileCommands files contain the new class.
  • Entries look similar
  • Old classes also have this error: cannot open source file "GameFramework/GameModeBase.h"

I did try a Generate Visual Studio project files already. And a Refresh Visual Studio Code Project as well. I didn't see anything load or indicate it performed the Generate Visual Studio project file, so that could be it. Is there a terminal command substitute?

@Etaash-mathamsetty
Copy link

Etaash-mathamsetty commented May 3, 2022

I still get notfications even when you guys are doing @ (insert username), so I guess it's not worth doing it

@boocs
Copy link
Author

boocs commented May 3, 2022

@Etaash-mathamsetty
Thanks for letting me know. Must just be for easily spotting the highlighted name while scrolling.

@JoshEthan
We can move this to the more advanced help.

Edited:See post below

@boocs
Copy link
Author

boocs commented May 3, 2022

@JoshEthan
I remember you have to pass the -VSCode flag. Here's a better post: https://www.reddit.com/r/unrealengine/comments/nn2n7h/visual_studio_code_with_ue5/

@boocs
Copy link
Author

boocs commented May 18, 2022

Extension version 3.1.0 released.

This is a pretty big release so let me know of any bugs.

@voxelium
Copy link

voxelium commented Jul 19, 2022

@boocs Why might this error ** Error **: changeIntellisenseSettings() threw an error. occur for an extension "Fast Header Intellisense" ?

@boocs
Copy link
Author

boocs commented Jul 19, 2022

@voxelium

That's for my other extension "Fast Header Intellisense" . Looking at the code, it looks like a normal API function call is throwing an exception. This function call updates the *.code-workspace file in your project.

Pretty strange bug. Some of the most likely exceptions would be:

  • write permission issue
  • corrupted file
  • You didn't open your project as a workspace (does it have the word '(Workspace)' on the top titlebar when your project is open?)

I can update my extension later so the error message does give the exception message.

@voxelium
Copy link

voxelium commented Jul 19, 2022

@boocs Sorry, I couldn't find a forum for your extension "Fast Header Intellisense".
Thank you for your answer.
I understand.
I disable the C/C++ extension and enable CLANGD instead because I need the UNreal Engine Tools for building project in VSCode extension

@boocs
Copy link
Author

boocs commented Jul 19, 2022

@voxelium
Yeah clangd seems pretty good. I'm currently building an extension that helps setup clangd on Windows. The current UE/clang compile commands, for Windows, has some bugs.

No ETA on when it'll be released.

@ZenithRahman
Copy link

ZenithRahman commented Sep 5, 2022

does this works with unreal engine 4.27.2 ?

@boocs
Copy link
Author

boocs commented Sep 5, 2022

@ZenithRahman

It should work with 4.27.2. I'm releasing a new version today with less complicated compiler path fixes. I would wait.

It also depends on what hardware you're running. I know M1 Mac can crash with 4.27.2 but are 'fine' with 5.0.3.

@boocs
Copy link
Author

boocs commented Sep 6, 2022

I released the new version 3.4.0. As always let me know of any bugs.

@abc6239657639
Copy link

abc6239657639 commented Sep 6, 2022

@boocs
Copy link
Author

boocs commented Sep 6, 2022

@abc6239657639

Yep, I'm on Windows and tested it on 5.0.3. Should work!

I rented a cloud M1 Mac so that's why I know it works, on that hardware, for 5.0.3.

@Osama-Gamal
Copy link

Osama-Gamal commented Sep 18, 2022

I installed this extension but It didn't fix my project , I am using Garuda Linux (Arch Based Distro) , so after Installing the extension I added this settings

image

I closed visual code and opened it again but nothing happen , I just got this output which tells me that everything is fine

image

I tried also to disable optimize fix but still not work , so what can I do to make this extension works ?

@boocs
Copy link
Author

boocs commented Sep 18, 2022

@Osama-Gamal

For UE5 you need to change Cpp Standard to c++17 instead of c++14 you have it set to.

Restart VSCode after you change the setting.

@Osama-Gamal
Copy link

Osama-Gamal commented Sep 18, 2022

@boocs
Copy link
Author

boocs commented Sep 18, 2022

@Osama-Gamal

I've tried it on Ubuntu 22.04 and it works. c++17 is the correct setting for UE5.

clang 13.0.1 is the recommended compiler for UE5 development: https://docs.unrealengine.com/5.0/en-US/linux-development-requirements-for-unreal-engine/
When you scroll up on my extension's log it'll tell you the compiler path that you're using.
Put that path in the terminal with a -v flag to see what version it is.

@Osama-Gamal
Copy link

Osama-Gamal commented Sep 19, 2022

@boocs
Copy link
Author

boocs commented Sep 19, 2022

@Osama-Gamal
I have a new version of my extension 3.4.0. You can just install it and it will replace the old version.

The new extension version will help with only using one compiler. The weirdness I see is you have two different compiler paths set which might be the issue.

Go here to create a new issue after installing 3.4.0 and you still have errors:
https://github.com/boocs/ue4-intellisense-fixes/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment