Skip to content

Instantly share code, notes, and snippets.

@boocs
Last active November 5, 2024 09:33
Show Gist options
  • Save boocs/f63a4878156295b6e854cac68672f305 to your computer and use it in GitHub Desktop.
Save boocs/f63a4878156295b6e854cac68672f305 to your computer and use it in GitHub Desktop.

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 or Plugins

When you add new source/header files or plugins 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 May 6, 2023

I've released my clangd extension for UE5

IMO clangd works better for code completion than Microsoft's C++ extension. It also has some other great features.

https://github.com/boocs/unreal-clangd

@JakobTischler
Copy link

Hi @boocs

I tried installing v3.7.2 in VSCode v1.81.1, getting the "Completed installing" info message. But, there's no call to reload VSCode, as is usual when installing .vsix files, nor does it show up in the extension list. Effectively, it doesn't seem to be installed at all.

Any ideas? Thanks.

@boocs
Copy link
Author

boocs commented Aug 30, 2023

@JakobTischler

That's one I have no idea on. I'll try to figure out some things to try.

@boocs
Copy link
Author

boocs commented Aug 31, 2023

@JakobTischler

Could it have to do with these settings? You can also choose 'Show Running Extensions' for info or even 'Enable All Extensions' to see if it fixes it.

image

@JakobTischler
Copy link

@boocs You were right that for some reason it was disabled by default. Don't know why or how, but alas... Thanks for the tip.

As a follow-up: I don't see UEIntellisenseFixes.enableFixes or UEIntellisenseFixes.enableOptionalFixes with 3.7.2. Have they been deprecated/removed?

@boocs
Copy link
Author

boocs commented Sep 1, 2023

@JakobTischler
They are only in global User settings so you can only set them in User.
image

image

@JakobTischler
Copy link

@boocs Sorry for the late reply. That would basically mean I can't use the extension if enabled only in a certain workspace or folder, correct? I wanted to restrict it that way in order to prevent overhead in other projects.

@boocs
Copy link
Author

boocs commented Sep 13, 2023

@JakobTischler
No, you can still do that. I disable extension globally and only enable it through workspace.

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