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.1.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

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
  • The extension will fix UE VSCode Intellisense issues on startup.
    • It must happen at startup or the Tag Parser will add unneeded symbols to the browse cache file
4.26.1+
  • Fixes invalid paths in compile command's response file.
  • Adds missing source/headers to compile command's file.
    • Runs on startup. You must restart VSCode to fix Intellisense errors for new files
  • Fixes UE workspace's Tag Parser includes to increase performance.
  • Fix for wrong cppStandard and to not pollute global user setting.
  • Optional fix: Removes project specific references from UE workspace and add general Intellisense to UE source code.
  • Fix for deprecated externalConsole setting in launch.json
  • Real time
    • Detects project resets and will run extension again
    • Warns to restart VSCode on new Source/Header detection
4.25
  • Fixes no defines.
  • Fix for wrong cppStandard and to not pollute global user setting.
  • Fixes UE4 workspace's Tag Parser includes to increase performance.
  • Fix for deprecated externalConsole setting in launch.json
  • Real time
    • Detects project resets and will run extension again
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.52.0 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.

    Note: Make sure to remove any previous fixes and reset your project (see Known Issues). If installing from very old versions make sure to delete the previous version's extension folder. Newer VSIX installation versions don't have to worry about this.

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.

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 before 2.0.0

  • UE4IntellisenseFixes.enableFixes false
  • UE4IntellisenseFixes.enableOptionalFixes false
  • UE4IntellisenseFixes.cppStandard ""

Versions 2.0.0+

  • UEIntellisenseFixes.enableFixes false
  • UEIntellisenseFixes.enableOptionalFixes false
  • UEIntellisenseFixes.cppStandard ""

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 right click on your YourProjectName.uproject file, in your project directory, and choose Generate Visual Studio Project Files...

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

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 reset your project and everything should be back to normal.

Comments

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


To Top

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Jan 21, 2021

1.0.0 Released March 2nd, 2021

List of fixes:

4.26.1+

  • Fixes invalid paths in compile command's response file.
  • Adds missing source/headers to compile command's file.
  • Fixes UE4 workspace's Tag Parser includes to increase performance.
  • Fix for wrong cppStandard and to not pollute global user setting.
  • Optional fix: Removes project specific references from UE4 workspace and add general Intellisense to UE4 source code.

4.25

  • Fixes no defines.
  • Fix for wrong cppStandard and to not pollute global user setting.
  • Fixes UE4 workspace's Tag Parser includes to increase performance.
@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Mar 2, 2021

@Krzysow
A little late since the cppStandard thing was harder than I thought. Making it a setting made it easier though. Let me know if it fixes stuff.

@Krzysow

This comment has been minimized.

Copy link

@Krzysow Krzysow commented Mar 4, 2021

@boocs
I just checked the extension and everything seams to be working fine. Thanks again for the help!

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Mar 20, 2021

This unfortunately didn't work for me when I tried to fix this error when I got squiggles under my #includes. I haven't used this extension before, and I waited till the files had been parsed. The include errors came outta nowhere - it happened really suddenly. I do remember switching from clangFormat to vcFormat.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Mar 20, 2021

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Mar 21, 2021

It's perfect:

Extension "UE4 Intellisense Fixes" is now active!

Found Unreal Engine v4.26.1

Fixing invalid paths in response files.
No invalid paths returned.
End fixing invalid paths in response files.

Fixing missing compile command files.
No missing file paths found. No fixes needed.
End fix missing compile commands.

Attempting to fix UE4 workspace(Add empty tag parser).
UE4's tag parser includes is set to empty array for performance.
The setting limitSymbolsToIncludedHeaders is already set to true.
End fix UE4 workspace(Add empty tag parser).

Attempting to fix wrong cppStandard.
The main workspace c_cpp_properties.json's cppStandard is set to c++14
The ue4 workspace c_cpp_properties.json's cppStandard is set to c++14
End fix wrong cppStandard.

Attempting to fix UE4 workspace optimization.
Current Main workspace file's forced includes are already fixed.
End fix UE4 optimization.

No need to write BullCowGame CCppProperties. It was unchanged.
No need to write UE4 CCppProperties. It was unchanged.

Extension is done.
@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Mar 21, 2021

@Vivraan

I have the same BullCowGame project, on UE 4.26.1, and it works for me. I'm on Windows 10 and using VS Build Tools though.

It does sound like a configuration issue. Can you use https://pastebin.com/ and show your C/C++ logs when you first open VSCode on a file that has the error? Wait a minute or two after you open VSCode for the log to get more info.

Make sure to change the logging level to Debug:
cpp-debug

And access them here:
cpp-log

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Mar 21, 2021

@Vivraan
In addition to the above post, have you also tried a project reset? Right-click on your project's uproject file and choose Generate Visual Studio Project Files.

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Mar 22, 2021

@Vivraan
In addition to the above post, have you also tried a project reset? Right-click on your project's uproject file and choose Generate Visual Studio Project Files.

This doesn't work.

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Mar 22, 2021

@Vivraan

I have the same BullCowGame project, on UE 4.26.1, and it works for me. I'm on Windows 10 and using VS Build Tools though.

It does sound like a configuration issue. Can you use https://pastebin.com/ and show your C/C++ logs when you first open VSCode on a file that has the error? Wait a minute or two after you open VSCode for the log to get more info.

Make sure to change the logging level to Debug:
cpp-debug

And access them here:
cpp-log

https://pastebin.com/HXGTP8vG

Are you available on the Unreal Slackers Discord server?

The project was working fine until I changed formatting from clangFormat to vcFormat.

@ItsCubeTime

This comment has been minimized.

Copy link

@ItsCubeTime ItsCubeTime commented Mar 22, 2021

This unfortunately didn't work for me when I tried to fix this error when I got squiggles under my #includes. I haven't used this extension before, and I waited till the files had been parsed. The include errors came outta nowhere - it happened really suddenly. I do remember switching from clangFormat to vcFormat.

I made a short little powershell script a while ago that enables you to use Clangd language server with UE4 projects. Im on my phone rn but if you like (and if boocs is okay with it) I would be happy to share it here.

Clangd provides at least as much functionality as Microsofts langauge server and as a bonus also parses the entire UE4 project in like 3-5 seconds.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Mar 22, 2021

@ItsCubeTime

Go ahead!

@ItsCubeTime

This comment has been minimized.

Copy link

@ItsCubeTime ItsCubeTime commented Mar 22, 2021

Right, so this is the result (Clangd has plenty of features that Im not showing here like multi-file symbol renaming, bad code practice highlighting, syntax error detection, go to declaration, preview parameters (etc), but I just wanted to show how much faster it is than Microsofts extension, Im on a i5-6500 and was probablay short on ram whilst recording, so most machines will probably run this even faster):

  • https://u.teknik.io/oVMC7.mp4 (Demoing the script, of which I just press a hotkey to have it generate the correct filepaths/script with just the press of a hotkey (Also I fixed the syntax error that it warns about in this video right after recording)).
  • https://u.teknik.io/Cj20t.mp4 (demoing the extension and responsiveness & a little what its like using, the improved parsing and intellisense speed is why I decided to go with Clangd over Microsofts C extension)

And this is taken from my personal one Note and describes what I do basically:
https://u.teknik.io/wF0nj.pdf
https://u.teknik.io/uCKLl.pdf

And some less important stuff that I took while I thought would help anyone new to Clangd:
https://u.teknik.io/PLelz.pdf
https://u.teknik.io/60xqn.pdf

Also add:
"clangd.arguments": [
"--enable-config"
],
to your settings.json (not sure if this is default but its better to be safe)

The powershell command generated by the keybindings command in my first pdf uses backslashes for the file path which works well on WIndows but you might have to replace those with forward slashesif youre on mac or Linux (so you might have to replace all \ with / if youre on Unix).

Then once everything is setup you just have to open up your VS Code project and hit the keybinding defined (alt n by my example) and you will get a powershell command that should look something like:

if (!(Test-Path "C:\Users\Oliver\Documents\Unreal Projects\BuildingEscapeUdemyC\.clangd"))
{
   New-Item "C:\Users\Oliver\Documents\Unreal Projects\BuildingEscapeUdemyC\.clangd
"}; Set-Content "C:\Users\Oliver\Documents\Unreal Projects\BuildingEscapeUdemyC\.clangd" 'CompileFlags:
  Add:
    - -IC:\Users\Oliver\Documents\Unreal Projects\BuildingEscapeUdemyC\Intermediate\Build\Win64\UE4Editor\Inc\BuildingEscapeUdemyC';        & 'D:\Program Files (x86)\Epic Games\UE_4.26\Engine\Binaries\DotNET\UnrealBuildTool.exe' Development Win64 BuildingEscapeUdemyC "C:\Users\Oliver\Documents\Unreal Projects\BuildingEscapeUdemyC\BuildingEscapeUdemyC.uproject"  -mode=GenerateClangDatabase ; Copy-Item "D:\Program Files (x86)\Epic Games\UE_4.26\compile_commands.json" -Destination "C:\Users\Oliver\Documents\Unreal Projects\BuildingEscapeUdemyC"

in your open terminal. Then hit enter and it will generate everything Clangd needs. Of course dont forget to enable the Clang extension by "LLVM extensions" as the files Im generating are for Clang specifically and is not compatible with Microsofts extension.

If youre unsure if youre using PowerShell as your terminal (and if youre on Windows), you can look for this flag in your settings.json:
"terminal.integrated.shell.windows": "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe",

I hope this didnt end up too long :P

@boocs
@Vivraan

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Mar 23, 2021

I'll take a look, @ItsCubeTime, sounds interesting.

Unfortunately trying to paste the code directly from the PDF is causing problems. Could you just share the code sample as a separate gist?

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Mar 23, 2021

Update: I tried typing in the script that runs on key press manually into the keybindings file but I'm not seeing any results. I probably messed up somewhere, so it'll be really useful if you can provide the PDF content as a gist instead!

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Mar 23, 2021

@boocs thank you for your time as well, I'm sure your extension has been greatly useful to many people in this situation. 😜

I hope we can get to the bottom of this issue asap.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Mar 23, 2021

@Vivraan
I remembered something from a post on the gamedv.tv forums. You can try a full rebuild of the game in VSCode.

  1. Close UE4 Editor
  2. In the VSCode Terminal menu choose Run Task or Run Build Task.
  3. Choose BullCowGameEditor Win64 Development Rebuild
  4. Try restarting VSCode if it still doesn't work.

rebuild

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Mar 24, 2021

@Vivraan
I remembered something from a post on the gamedv.tv forums. You can try a full rebuild of the game in VSCode.

  1. Close UE4 Editor
  2. In the VSCode Terminal menu choose Run Task or Run Build Task.
  3. Choose BullCowGameEditor Win64 Development Rebuild
  4. Try restarting VSCode if it still doesn't work.

rebuild

Already did this, no use. I even deleted the Intermediate and Binaries folder before each build so that kinda rules this out.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Mar 24, 2021

@Vivraan
Are you using the Insiders version of VSCode? DanM from gamedev.tv found there's a bug with the lastest Insiders version.

Use the non Insiders version if this is the case.

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Mar 25, 2021

@Vivraan
Are you using the Insiders version of VSCode? DanM from gamedev.tv found there's a bug with the lastest Insiders version.

Use the non Insiders version if this is the case.

Don't think I am.

Version: 1.54.3 (system setup)
Commit: 2b9aebd5354a3629c3aba0a5f5df49f43d6689f8
Date: 2021-03-15T10:55:45.459Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.19042
@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Mar 25, 2021

@Vivraan
I have the same BullCowGame project, on UE 4.26.1, and it works for me. I'm on Windows 10 and using VS Build Tools though.
It does sound like a configuration issue. Can you use https://pastebin.com/ and show your C/C++ logs when you first open VSCode on a file that has the error? Wait a minute or two after you open VSCode for the log to get more info.
Make sure to change the logging level to Debug:
cpp-debug
And access them here:
cpp-log

https://pastebin.com/HXGTP8vG

Are you available on the Unreal Slackers Discord server?

The project was working fine until I changed formatting from clangFormat to vcFormat.

@boocs are you on Discord?

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Mar 25, 2021

@Vivraan

@boocs are you on Discord?
Nope

The clangFormat/vcFormat setting shouldn't affect Intellisense.

I meant a pastebin of this window. Make sure you're on a file that has errors. Select everything (Ctrl-A) and copy it. Then paste it in a pastebin. Make sure it's when you first open VSCode or there might be too much info in the log. Make sure you wait and get these include messages for the file that is bugged or if you don't have them after ~30 seconds of having the file open.
cpplog

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Mar 26, 2021

Odd, there doesn't seem to be any issues at the moment. I'll let you know if I get anything though, seems like a recurring problem to me.

@ItsCubeTime

This comment has been minimized.

Copy link

@ItsCubeTime ItsCubeTime commented Mar 27, 2021

Update: I tried typing in the script that runs on key press manually into the keybindings file but I'm not seeing any results. I probably messed up somewhere, so it'll be really useful if you can provide the PDF content as a gist instead!

Are you available on the Unreal Slackers Discord server?

I do have Discord however. danieljackson is my usrn, you can search for my name on unreal Slackers

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Mar 30, 2021

Update: I tried typing in the script that runs on key press manually into the keybindings file but I'm not seeing any results. I probably messed up somewhere, so it'll be really useful if you can provide the PDF content as a gist instead!

Are you available on the Unreal Slackers Discord server?

I do have Discord however. danieljackson is my usrn, you can search for my name on unreal Slackers

Got it!

@ElenSerhan

This comment has been minimized.

Copy link

@ElenSerhan ElenSerhan commented Apr 1, 2021

Hi @Vivraan
I am having the exact same problem as you and I am using the same BullCow project. Please update if you get it fixed at any point.

@ItsCubeTime

This comment has been minimized.

Copy link

@ItsCubeTime ItsCubeTime commented Apr 1, 2021

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 1, 2021

@ElenSerhan

  1. What Build Task do you run? ( e.g. BullCowEditor Win64 Development Build)
  2. Does it build successfully and you're just getting Intellisense errors?

  1. Try closing the UE4 Editor.
  2. Choose BullCowEditor Win64 Development Clean
  3. Then Choose BullCowEditor Win64 Development Build (Make sure both have Editor as the suffix)
  4. Might need to restart VSCode to refresh Intellisense since cleaning will cause Intellisense error but Building should fix them
  5. Sometimes Intellisense gets stuck and needs a restart though.

  1. If you still have files that error
  2. Open a file that errors
  3. Then go to View->Command Pallete
  4. Type Diagnostics and in the drop down that pops up choose C/C++: Log Diagnostics
  5. Copy and paste the whole log into a pastebin and share the link
  6. This is what it looks like:

uediag

@magwa101

This comment has been minimized.

Copy link

@magwa101 magwa101 commented Apr 2, 2021

Boocs, I read through your VSIX and I think you interchangably mention "intellisense" and "tag parser". My understanding is that these are very different code paths within the MSC C++ Intellisense VSIX.

Your UE VSIX configures for which process, intellisense or tag parser?

@ElenSerhan

This comment has been minimized.

Copy link

@ElenSerhan ElenSerhan commented Apr 2, 2021

Hi @boocs
As I am on Pop_os I am using the following Build Task: BullCowEditor Linux Development Build
My project compiles fine and runs in UE4 it's just the red intellisense errors that I can't get rid of.
I have attached a photo of the diagnostics below:
hi

@magwa101

This comment has been minimized.

Copy link

@magwa101 magwa101 commented Apr 2, 2021

Would love to use clang, close but no banana. Back to tag parser after another 3 hours down the drain.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 2, 2021

@magwa101

Boocs, I read through your VSIX and I think you interchangably mention "intellisense" and "tag parser". My understanding is that these are very different code paths within the MSC C++ Intellisense VSIX.

Your UE VSIX configures for which process, intellisense or tag parser?

It has fixes for both Intellisense and Tag Parser.

When using Default Intellisense, Tag Parser will still be be used for looking up Symbols, Go to Definition, and Switching between header file and source file.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 2, 2021

@ElenSerhan

Hi @boocs
As I am on Pop_os I am using the following Build Task: BullCowEditor Linux Development Build
My project compiles fine and runs in UE4 it's just the red intellisense errors that I can't get rid of.
I have attached a photo of the diagnostics below:

What version of my extension are you running?
I noticed in your forced includes the SharedPCH path is different than usually. I have a fix in the latest version but maybe I need to look at it again.
Basically it's a fix that checks if SharedPCH.Engine.ShadowErrors.h is being used or SharedPCH.Engine.h is.

Can you try resetting your project to see if the SharedPCH file gets changed.


Another thing I see, your cStandard is set to gnu17. This will have no affect for UE4 but I'm wondering why VSCode is setting it to this automatically to this when you're using clang. My extension sets your cppStandard to "c++14" because that's what it shows clang uses in the VSCode docs.
If the docs are out of date, and clang should use cppStandard gnu++14 for UE4,
then I have a bug in my extension and I shouldn't default the Intellisense to c++14.

In my extension go to the setting and change the cppStandard to blank and then reset your project to remove c++14 from your c_cpp_properties files.

blankcppstandard


For future log privacy you can copy and paste the log into vscode and do a search and replace for your name. Then copy and paste the edited log into pastebin. You don't need to signup to use https://pastebin.com/.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 2, 2021

@ElenSerhan
I just found it in the clang website docs. Clang can use C++14 or gnu++14 but in VSCode it's c++14. Don't know if the capital C matters.

Can you tell me what the diagnostics says the cppStandard is after you change my extension to Blank and reset your project?

If it says gnu++14 or gnu++17 then I'm going to change my extension so that clang will automatically use gnu++14 for UE4.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 3, 2021

@ElenSerhan
cpptools will detect the wrong version of cppStandard and try to set it correctly so this may not matter. I'm going to change my extension anyway.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 3, 2021

@ElenSerhan
There is a Insiders update and cpptools extension update if you want to try that. You should also try the non-insiders version to see if it's something in the beta version that is causing it.

I also released a new extension update.

@ElenSerhan

This comment has been minimized.

Copy link

@ElenSerhan ElenSerhan commented Apr 6, 2021

Hi @boocs
Sorry for the dumb question, but what do you mean by reset the project? As in close the vscode and open it again?
If it's that, then I did that and I changed cpp standard to blank in your extension, however cppstandard is still set to "c++14"

For reference I am currently using version 1.4.1 of your extension

@ElenSerhan

This comment has been minimized.

Copy link

@ElenSerhan ElenSerhan commented Apr 6, 2021

I upgrade to version 1.4.2 of your extension and I clicked on "Refresh Visual Studio Code Project" in UE4. My cpp propreties has now changed my "cppStandard" to "gnu++14".

I ran diagnostics and the results are here: https://pastebin.com/535z7LPk

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 7, 2021

@ElenSerhan

Nothing seems weird except in the middle of the logs it still says:
Standard Version: c++14
IntelliSense Mode: linux-gcc-x64

Maybe could be it, but I've been using clang on Windows and my diagnostics isn't accurate either.

I've been dumb and never asked what Intellisense errors are you you getting?

Also if your reset your project again and start VSCode. What does my extension logs say?
https://gist.github.com/boocs/f63a4878156295b6e854cac68672f305#Logs

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 7, 2021

@ElenSerhan

I'm compiling the full source now on Ubuntu 20.04. I'll soon be able to see if my extension is bugged on linux.

@ElenSerhan

This comment has been minimized.

Copy link

@ElenSerhan ElenSerhan commented Apr 7, 2021

Thanks @boocs.
I'm getting the following error (red squiggles across my whole BullCowCartridge.cpp file):
#include errors detected. Consider updating your compile_commands.json or includePath. Squiggles are disabled for this translation unit (/home/usr/GameDev/Repos/BullCowGame-starter-kit/Source/BullCowGame/BullCowCartridge.cpp)

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 7, 2021

@ElenSerhan

I haven't tried my extension yet but I have opened BullCow game in linux without errors and Intellisense is working. Of course if you add new files it might have some errors until you reset your project to add the new files to Intellisense.

Here's some things to try though based on your logs. It looks like your VSCode might be trying to use gcc instead of clang for Intellisense based on your logs compared to mine.

You may need to force VSCode to use the clang compiler for Intellisense. Go to settings and make sure it's on the global User and search for Compiler Path. It'll say Edit in settings.json. Set the path to your clang path.

Also for clang on Ubuntu, VSCode sets the cppStandard to c++14. So it might be another indicator that you're using gcc?


Looking at the log it says your includePath is []. Look in both c_cpp_properties and remove the includePath setting if it is there.

In 4.26+ UE doesn't use this include path setting anymore and uses compile commands. It maybe interfering with compile commands. It shouldn't! But better safe to remove it. My BullCow linux project doesn't have it set.


I'm going to try my extension and see if it breaks my project.
(I'm going to have to wait for the Tag Parser to parse the project so it'll be awhile before I can test it)

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 7, 2021

@ElenSerhan
I replied above but forgot to put your @name in but I edited it in. Not sure how notifications work so just know there's a new reply above this one.

Once the Tag Parser started running my extension seemed to run fine and Intellisense was working.

I decided to build to see if that would affect it. But I chose Rebuild....

I didn't know it would rebuild UE4 as well so now I'm at 122/1744. Doing a Rebuild is dangerous with the full UE4 Source Code!

It'll be a long long time before I can test it with a full rebuild.

@ElenSerhan

This comment has been minimized.

Copy link

@ElenSerhan ElenSerhan commented Apr 7, 2021

Wow I cannot believe that worked. I changed my C_Cpp.default.compilerPath and UE4IntellisenseFixes.cppStandard in settings.json to my clang path as well as cppStandard in my c_cpp_propreties.json and now the errors are gone.It seems that c++14 was causing all my issues.
Thank you so much! I really appreciate your help.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 13, 2021

tldr: Projects with multiple modules won't work with some of the extension fixes.

Opening Epic's 4.26 ShooterGame example shows the some of the fixes, in my extension, don't work with projects with multiple modules. Multiple modules produce multiple Intellisense response files which will 'gently' break some of the fixes.

  1. The worst fix that is broken is the auto adding of missing source/header files to the compile commands file. I'll have to add a manual add feature that lets you choose the response file to use.

  2. Also noticed in ShooterGame that you can adjust your PCH name your module uses. I'll have to remove my PCH file fix and just warn when the PCH file doesn't exist. The warning will say that you may have to rebuild or reset your project. I had a bug where the pch file wasn't correct which is why I created this fix. A project reset was what it took to fix it.

  3. Then there's the generalization fix for the UE4 workspace. It needs to pull from the main response file on which preinclude files to parse. There are solutions but I'm not set on any of them yet.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 15, 2021

4.26.2 isn't fully compatible with this extension. Will be updated soon.
I anticipated it wouldn't and thought I had prepared. They changed the - to a / in the response files for cl.exe compiler flags. My regex wasn't compatible.

I was also in the process of updating/fixing some features so it'll either be late tonight or tomorrow for the fix.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Apr 15, 2021

New v1.5.0 is released with 4.26.2 fixes and some additional fixes/features.

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented May 17, 2021

@boocs just noticed that I have two compileCommands_*.json files:

image

I found that the extension updates the project-specific one but not the default one, so for making the error squiggles not reappear I have to change the Default one as well.

Is this something you've already addressed or are going to address? I don't quite get the reason for putting two of these files here.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented May 19, 2021

@Viraan
I believe you can switch VSCode configurations starting with 4.26.2.

It's weird you have to change the default version. That should only work if you've changed the configuration in the lower right in VSCode.
If you click the config in the lower right of VSCode and switch it back to the config with the project's name, as the name of the config, the extension should start working again.

I'm not sure what Epic is doing with the 2nd config or what it's for.

I'll look into supporting the 2nd config though. I'm also about to to release a small unrelated update.

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented May 19, 2021

If you click the config in the lower right of VSCode and switch it back to the config with the project's name, as the name of the config, the extension should start working again.

That seems to do away with the need to paste contents between the compile cmd files. 👍

Any idea why it changes back to Win32 or something else instead of the named config?
Can the extension set the correct configuration on its own?

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented May 19, 2021

@Vivraan

Any idea why it changes back to Win32 or something else instead of the named config?

It shouldn't do that . I'm not sure which VSCode config keeps track of the config you're using currently but there could be something wrong with it. Some write/permission issue or something that is reverting state.

There probably is a way to change configs with the API. I guess there could be some extension that is doing it but I'm not sure why it would be.

I did do a diff on both compile command files and response files mentioned in the compile command files. They're basically the same just the directory names are different in the compile command files. The response files are only different because of my extension fixing the invalid directories in the one response file.

I wasn't planning on supporting both configs since I didn't know why they were doing it yet.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented May 21, 2021

@Vivraan

My extension works on the first configuration so if the Win32 config is the first then it'll fix that config instead.

I'll look into supporting all configs but it may take awhile to figure it all out.

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented May 24, 2021

No problem, remembering to set the correct config seems to solve all of these issues. This has really made my life easier. Thanks!

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented May 25, 2021

I did end up fixing it to work on all configs for 1.6.0.

1.5.1 is still available for download in case of problems. It was a lot of changes.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented May 26, 2021

I released version 2.0.0 that supports UE5. I unfortunately named the settings incorrectly, with the UE4 prefix, so I decided to rename the settings. You'll have to redo your setting to reenable the fixes.

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented May 29, 2021

I encountered a serious issue just now - I'm trying to use the Gameplay Ability System plugin, and it's gotten included with the build but it shows error squiggles since it's not on the include path.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented May 29, 2021

@Vivraan

What version of the extension are you using and are you using UE 4.26.2?

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented May 29, 2021

@Vivraan

I'm following this tutorial and I'm 10 minutes in. So far it seems fine after figuring some stuff out.
https://www.youtube.com/watch?v=Yub52f4ZUU0

I converted his project to 4.26.2 with no problems and I'm using 2.0.0 of my extension.

After modifying *.Build.cs and adding new classes I had to refresh and Generate Visual Studio Project Files. This added the needed includes to the response file. (I'm not sure which was the fault but I think it's the Build.cs modification that caused the needed project reset)

Then I got some *.generated.h errors which was fixed by Building the project.

When I added the ATTRIBUTE_ACCESSORS Macros to the header file it complained. I added #include "AbilitySystemComponent.h" above the *.generated.h" include and that solved the problem.

I'll let you know if I find anything else.

@jessykalycia

This comment has been minimized.

Copy link

@jessykalycia jessykalycia commented Jun 4, 2021

@boocs

Thank you for the extension. However, I can't get it running on UE5. The output:

Extension "UE Intellisense Fixes" is now active!

Couldn't find the UE4/UE5 workspace.
** Error **: Couldn't parse Unreal Engine version.
** Error **: No fixable project could be created.

Reenabling Intellisense.

Extension is done.

--
Tried brand new project; this is the output.
Tried converting an UE 4.26.2 project to this; the vscode files are still 4.26.2 even though we're running in UE5. Bad intellisense.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Jun 4, 2021

@jessykalycia

Open your project's ProjectName.code-workspace file. It should have something like this:

"folders": [
		{
			"name": "MyGame",
			"path": "."
		},
		{
			"name": "UE4",
			"path": "J:\\Program Files\\Epic Games\\UE_4.26"
		}

My extension v2.0.0 searches for UE4 or UE5 for the UE name. Let me know if there's a third name I should be searching for in my code? Maybe you're using the full UE5 source code and it's named different?

Could be maybe the workspace file got corrupted and doesn't have this in there?

@jessykalycia

This comment has been minimized.

Copy link

@jessykalycia jessykalycia commented Jun 4, 2021

So... I don't have a ProjectName.code-workspace. Every time I boot up a project with VS Code, it actually opens the file, but empty; if I boot up the project with VS, it simply doesn't show up. It doesn't get built when I generate VS project (I can't do right click on uproject / generate files, I have to manually command to generate files from the new UE5 directory).

Latest build tools, latest 2019 VS Community, just updated VS Code.

Oh - and the .vscode folder/files don't get built, either.

Note: I've been using 4.26.2 so far (with your extension) and it works great. Thanks!

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Jun 4, 2021

@jessykalycia

If that's the case then UE5 might be set to use Visual Studio instead of Visual Studio Code. My right click / generate is also bugged with UE5. If I open the UE5 'Editor' I can refresh the project from the Tools menu and you can see it says Visual Studio Code. I have it set to use VSCode in the settings ( Edit menu -> Editor Preferences -> Source Code -> change Source Code Editor to Visual Studio Code )

ue5tools

@jessykalycia

This comment has been minimized.

Copy link

@jessykalycia jessykalycia commented Jun 4, 2021

I had it set to both VSCode and VS (in different projects, at startup and later); I never see "Open Visual Studio Code" because it always displays to generate files, and even after "generating", since it doesn't, it doesn't update it I guess... It doesn't generate the workspace file with either vs or vs code.

Since I have UE4 going, I think it'll be better to wait for them to fix this? I'm not sure they will, though...

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Jun 4, 2021

@jessykalycia

The workspace file is for VSCode only. It won't get created if you have UE5 set to Visual Studio. The workspace file is what makes your project open in VSCode and treated as a 'multiple workspace project'. I guess like a simple solution file for Visual Studio.

Visual Studio has it's own directory/file structure separate from VSCode that is created for your project. They never share anything. The only thing VSCode does use is the compiler that comes with Visual Studio if you don't have VS Build Tools or some other compiler you setup.

For your project if you have a .vs folder and a .sln file your project is setup for Visual Studio.
If you have a .vscode folder and a .code-workspace file your project is setup for Visual Studio Code.

The Source Code settings in Editor Preferences is what determines what IDE gets used on project creation and what IDE gets used when you refresh.

@jessykalycia

This comment has been minimized.

Copy link

@jessykalycia jessykalycia commented Jun 4, 2021

@boocs

I see. Still, even setting the IDE to Visual Studio Code, the .vs folder gets created but the .vscode doesn't (which is really weird? it also doesn't create all the files it would normally create, only one). I'm not sure how to fix this, too; in UE4, all I need to do is create a class and/or generate the project files and it does the .vscode/workspace file automatically. On UE5 it simply doesn't.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Jun 4, 2021

@jessykalycia

That is strange.

One thing you can try is creating a BuildConfiguration.xml if you don't have one.
https://docs.unrealengine.com/4.26/en-US/ProductionPipelines/BuildTools/UnrealBuildTool/BuildConfiguration/

You can set the ProjectFileGenerator to Visual Studio Code in there.

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
    <ParallelExecutor>
        <MaxProcessorCount>8</MaxProcessorCount>
    </ParallelExecutor>
    <ProjectFileGenerator>
        <Format>VisualStudioCode</Format>
    </ProjectFileGenerator>
</Configuration>

I only have the MaxProcessorCount set to 8 to test if the file is actually working. When you build, in VSCode, it will say 'Building # actions with 8 processes...' If you change the MaxProcessorCount to 7 then it would say 'Building # actions with 7 processes...'

Now you know the BuildConfiguration.xml is in the right directory structure/format and UE4/5 is reading it.

Remember that the MaxProcessorCount will be different on your computer depending on what CPU/Core Count you are using.

Although I just remembered you can't test this because it's not generating the .vscode project stuff!! I'll leave my stupidity up in case other people could find it useful.

You'll have to try doing it without testing and check that it works when you refresh your project in the Tools menu or create a new project.

Here is where my file is on my Windows 10 machine:
K:\boocs\Documents\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml


Edit: I forgot you can test the processes count with 4.26.2

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Jun 9, 2021

What version of the extension are you using and are you using UE 4.26.2?|

@boocs I'm using 1.1.0 of your extension and I indeed am on UE 4.26.2.

I read what you commented right below as well - good to know that things are working as expected, at least with version 2.0.0!

@krooq

This comment has been minimized.

Copy link

@krooq krooq commented Jun 14, 2021

Thanks for this, hate them sqiggly red lines!

A bit of feedback, I found this section difficult to understand.

A YourProjectName.code-workspace file in your project's directory with: *
  A folder in "folders" named UE4/UE5 and a path leading to the UE4/UE5 directory

Id suggest adding an example setup, e.g.
For a project called "Game" using UE5 the directory structure looks like this:

  • Game
    • Binaries
    • Content
    • ...other project stuff
    • Game.uproject*
    • Game.code-workspace*

Game.code-workspace looks like this

{
	"folders": [
		{
			"path": "."
		},
		{
			"name": "UE5",
			"path": "C:\\Program Files\\Epic Games\\UE_5.0EA"
		}
	],
	"settings": {}
}

@boocs

I see. Still, even setting the IDE to Visual Studio Code, the .vs folder gets created but the .vscode doesn't (which is really weird? it also doesn't create all the files it would normally create, only one). I'm not sure how to fix this, too; in UE4, all I need to do is create a class and/or generate the project files and it does the .vscode/workspace file automatically. On UE5 it simply doesn't.

I am also experiencing this same behaviour. It seems that VSCode support is broken in UE5?
The .vscode folder is generated in the Source folder with c_cpp_properties.json inside it.
A .vs folder and .sln file are also generated at the project root even with VSCode selected in the IDE settings in UE5.

The log im getting is:

Extension "UE Intellisense Fixes" is now active!

Temporarily disabling Intellisense.

Found Unreal Engine v5.0.0

Couldn't find files in Game workspace's .vscode folder with glob: .vscode/c_cpp_properties.json
** Error **: No files found for getCCppConfigCopy().
** Error **: The main cCppProperties wasn't enabled at construction setup.
** Error **: This fixable project hasn't been initialized properly and is invalid.
Reenabling Intellisense.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Jun 14, 2021

@krooq

A bit of feedback, I found this section difficult to understand.

It shouldn't be meant as a "how to setup a UE project" section. I might go the opposite direction and just say a "Unreal Engine project setup automatically by the Engine" or something like that. That's why I had the star '*' there to try to make it more clear with the Note at the end.

The .vscode folder is generated in the Source folder with c_cpp_properties.json inside it.

Yep, something is really broken if it's doing that and is the reason for the Extension errors. The extension looks for the .vscode folder in the project's parent directory. This is beyond the extension's scope though, sorry!

You can try reporting this weird behavior to Epic's Bug Report and hope they fix it.

@Sneirox

This comment has been minimized.

Copy link

@Sneirox Sneirox commented Sep 2, 2021

Extension do not work!!!!! Errors are still appears!!!!!

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Sep 2, 2021

Extension do not work!!!!! Errors are still appears!!!!!

  1. What does the extension log say? https://gist.github.com/boocs/f63a4878156295b6e854cac68672f305#logs

  2. You can also try building your project.
    Some errors only go away after you build. Changing a header file above the class definition will cause errors like this.

@Sneirox

This comment has been minimized.

Copy link

@Sneirox Sneirox commented Sep 2, 2021

Extension do not work!!!!! Errors are still appears!!!!!

1. What does the extension log say? https://gist.github.com/boocs/f63a4878156295b6e854cac68672f305#logs

2. You can also try building your project.
   Some errors only go away after you build. Changing a header file above the class definition will cause errors like this.

Attempting to fix UE workspace optimization.
Current Main workspace file's forced includes are already fixed.
End fix UE optimization.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Sep 2, 2021

Extension do not work!!!!! Errors are still appears!!!!!

@Sneirox

Can you paste the whole log?

From the top:

Extension "UE Intellisense Fixes" is now active!

Found Unreal Engine v4.26.2
...

To the bottom of the log.

@Sneirox

This comment has been minimized.

Copy link

@Sneirox Sneirox commented Sep 3, 2021

Can you paste the whole log?

`Extension "UE Intellisense Fixes" is now active!

Found Unreal Engine v4.26.2

Fixing invalid paths in response files.
No invalid paths returned. No fixes needed.
No invalid paths returned. No fixes needed.
End fixing invalid paths in response files.

Fixing missing compile command files.
No missing file paths found. No fixes needed.
No missing file paths found. No fixes needed.
End fix missing compile commands.

Attempting to fix UE workspace(Add empty tag parser).
UE's tag parser includes are set to empty array for performance.
The setting limitSymbolsToIncludedHeaders is already set to true.
End fix UE workspace(Add empty tag parser).

Attempting to fix wrong cppStandard.
Extension's cppStandard setting was set to empty string.
Intellisense will use cpptools cppStandard setting instead of this extension's setting.
End fix wrong cppStandard.

Fixing launch.json.
launch.json didn't need to be changed.
End fix launch.json.

Attempting to fix UE workspace optimization.
Current Main workspace file's forced includes are already fixed.
End fix UE optimization.

No need to write MyProject CCppProperties. It was unchanged.
No need to write UE4 CCppProperties. It was unchanged.

Extension is done.
`

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Sep 3, 2021

@Sneirox

Nothing seems weird with that log.

  1. What are some of the errors that you are getting?

  2. Is this a new project or have you made any changes?

  3. If you've made changes, can you try creating a brand new project with no changes and see if you still get errors.

  4. Make sure when you're opening the project that VSCode's title bar says (Workspace). Like so:

filename.h - ProjectName (Workspace) - Visual Studio Code

  1. Don't paste it here but use pastebin.com and paste your entire C++ log. First you need to turn it on.
    a. Open VSCode's setting and search for 'logging'
    b. Scroll down to 'C_Cpp: Logging Level'
    c. Change the value to Debug
    d. Close and Reopen your project
    e. Get to the C++ log the same way as the extension log.
    https://gist.github.com/boocs/f63a4878156295b6e854cac68672f305#logs
    You see Console and UE Intellisense Fixes highlighted in green?
    Click UE Intellisense Fixes and change it to 'C/C++'.
    f. Wait 1 minute
    g. Copy the whole log and paste it into a pastebin and post the web address
    1. Make sure to search and replace, the log, for any Names or info you don't want public
@Sneirox

This comment has been minimized.

Copy link

@Sneirox Sneirox commented Sep 3, 2021

@boocs

  1. cannot open source file "intrin.h" (dependency of "/home/sneirox/Programs/EpicGames/UE-4.26.2/Engine/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/Engine/SharedPCH.Engine.ShadowErrors.h")
  2. new project
  3. ...
  4. It's Workspace
  5. https://pastebin.com/wKWvet0p
@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Sep 3, 2021

@Sneirox

In my extensions settings, try forcing the Cpp Standard setting to 'c++14'. UE4 doesn't support gcc so it's probably a bug where VSCode improperly auto uses gcc as it's intellisense compiler.

If that doesn't work, use the C++ extension setting "compilerPath" to set your clang path.

  1. Check your log to see if the gcc stuff goes away.
  2. Do you still have the bug?
@Sneirox

This comment has been minimized.

Copy link

@Sneirox Sneirox commented Sep 4, 2021

@boocs

does not affect in any way

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Sep 4, 2021

@Sneirox

  1. Try setting the C++ extension's intellisense mode to linux-clang-x64 as well. Make sure to set all these settings in the global settings. UE will sometimes change local VSCode configurations and remove your settings.
  2. Can you post the pastebin log again with these settings changed?
  3. Are you using Ubuntu?
  4. Searching for intrin.h, on google, I found a lot of problems with the same bug related and unrelated to UE4.
@chriswingler

This comment has been minimized.

Copy link

@chriswingler chriswingler commented Sep 30, 2021

Does this work with 4.27? I keep getting ** Error **: No fixable project could be created.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Sep 30, 2021

@chriswingler

Does this work with 4.27? I keep getting ** Error **: No fixable project could be created.

It should be working. Make sure to use the latest extension version.

Are you using the chaos version of 4.27? That could be a reason since I haven't tested that version.

@chriswingler

This comment has been minimized.

Copy link

@chriswingler chriswingler commented Sep 30, 2021

Ahh looks like I hadn't updated. Sorry about that! Thanks.

@OmegaWeaponDev

This comment has been minimized.

Copy link

@OmegaWeaponDev OmegaWeaponDev commented Oct 5, 2021

Hi boocs,

I am currently using UE 4.27.0 and I am still getting the #include path errors after installing this extension.

Extension Log: https://hastebin.com/otozisivib.properties

The Errors:
#include errors detected. Consider updating your compile_commands.json or includePath. Squiggles are disabled for this translation unit (C:\Users\Jamie\Documents\Unreal Projects\SimpleShooter\Source\SimpleShooter\ShooterAIController.cpp).

cannot open source file "sal.h" (dependency of "C:\Users\Jamie\Documents\Unreal Projects\SimpleShooter\Intermediate\Build\Win64\SimpleShooterEditor\Development\Engine\SharedPCH.Engine.ShadowErrors.h")

C/CPP Log: https://hastebin.com/jabegayeza.properties

Please let me know if you're wanting anything else

Note: I am using the latest version of this extension and the latest version of Visual Studio Code. The red squiggles are also under every single line in the code.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Oct 5, 2021

@OmegaWeaponDev

I have the same project so I made a copy and converted it to 4.27 with no errors.

I searched for a file that had #include <sal.h> in it and found (WindowsPlatform.h). I opened it and still no errors. When I hit F12 on sal.h it showed me it is in two locations on my computer.

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037\include\sal.h
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\sal.h

VSCode, at least on Windows, automatically includes these locations for Intellisense. For some reason it's not doing so based on your logs.
Are you sure you installed everything needed?

The first path is the stand alone cl.exe compiler. I'm using Visual Studio Build Tools. The other one is a Windows SDK. You should have at least the Windows SDK installed.

You can do this from the Visual Studio Installer.

Here's what my includes also include when the Windows SDK is installed:

...
include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\UM
include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\UCRT
include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\SHARED
include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\WINRT
include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\CPPWINRT
@OmegaWeaponDev

This comment has been minimized.

Copy link

@OmegaWeaponDev OmegaWeaponDev commented Oct 5, 2021

@boocs

I have both those files and make sure I had the windows SDK by modifying the Visual Studio Build Tools and even updating the build tools. However, I am still getting the same errors. The extension does seem to fix them, but then intellisense updates and they all come back. I am so getting the additional error of: Unable to resolve configuration with compilerPath "C:\Program". Using "cl.exe" instead.

In the Visual Stuido Installer for Build Tools I have:
MSVC v142 - VS 2019 C++
Windows 10 SDK (10.0.19041.0)
C++ CMake Tools for Windows
C++ AddressSanitizer

I also have Desktop development with c++ ticked.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Oct 6, 2021

@OmegaWeaponDev

The "C:\Program". Using "cl.exe" error should only happen on a fresh project. This is a new 4.27.0 error and was fixed in my latest extension version. If you get this error even after running my extension and restarting VSCode then you may not have the latest version of my extension. Make sure you have 2.1.0 and not 2.0.1 installed.

Also make sure you don't have "C_Cpp.default.windowsSdkVersion" settings set anywhere. Maybe you have it set to a version that no longer exists. Delete this setting so VSCode can automatically find the version to use.

Another test you can do is to enable cpptool's extension logging. Go to settings and search for logging. Click C/C++ to narrow the search results. Change C_Cpp: Logging Level to Debug. Switch to a non source file e.g. c_cpp_properties.json. Close and reopen VSCode. To see the logging windows open a VSCode console and go to the OUTPUT tab. In the upper right, of the console, click the dropdown menu and select C/C++. Wait for the Tag Parser to finish processing. You should still have open the c_cpp_properties.json file. Once the Tag Parser is finished open ShooterAIController.cpp. The default Intellisense will now start logging. Mine shows this:

sending compilation args for K:\ME\DOCUMENTS\UNREAL PROJECTS\SIMPLESHOOTER2_7\SOURCE\SIMPLESHOOTER\SHOOTERAICONTROLLER.CPP
  include: K:\PROGRAM FILES\EPIC GAMES\UE_4.27\ENGINE\SOURCE
 ... (lots of other UE_4.27 directories)
  include: K:\ME\DOCUMENTS\UNREAL PROJECTS\SIMPLESHOOTER2_7\INTERMEDIATE\BUILD\WIN64\UE4EDITOR\INC\SIMPLESHOOTER
  include: K:\ME\DOCUMENTS\UNREAL PROJECTS\SIMPLESHOOTER2_7\SOURCE
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\BUILDTOOLS\VC\TOOLS\MSVC\14.29.30133\INCLUDE
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\UM
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\UCRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\SHARED
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\WINRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\CPPWINRT
  preinclude: K:\ME\DOCUMENTS\UNREAL PROJECTS\SIMPLESHOOTER2_7\INTERMEDIATE\BUILD\WIN64\UE4EDITOR\DEVELOPMENT\SIMPLESHOOTER\DEFINITIONS.SIMPLESHOOTER.H
  preinclude: K:\ME\DOCUMENTS\UNREAL PROJECTS\SIMPLESHOOTER2_7\INTERMEDIATE\BUILD\WIN64\SIMPLESHOOTEREDITOR\DEVELOPMENT\ENGINE\SHAREDPCH.ENGINE.SHADOWERRORS.H
  stdver: ms_c++14
  intelliSenseMode: windows-msvc-x64
@Majd-Yahia

This comment has been minimized.

Copy link

@Majd-Yahia Majd-Yahia commented Oct 10, 2021

I have tried to use the extension with Unreal Engine 5 and I got this error showing up after installing and reloading vs.
image

I am using Windows 10

@TelesphorosGames

This comment has been minimized.

Copy link

@TelesphorosGames TelesphorosGames commented Oct 10, 2021

I have tried to use the extension with Unreal Engine 5 and I got this error showing up after installing and reloading vs. image

I am using Windows 10

I am getting this exact same error, I am brand new to coding and want to learn Unreal, but thus far my Intellisense and this UE intellisense fixes extension are not working. Please help, thanks so much.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Oct 10, 2021

@Majd-Yahia

That's strange that the *.code-workspace file is empty.

Refreshing your project should create a new *.code-workspace as long as you have UE5 set to use VSCode. You can either right click on your *.uproject file to refresh it there or do it inside UE5 in the Tools menu (different than UE4).

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Oct 10, 2021

@TelesphorosGames @Majd-Yahia

To make sure UE5 is set to use VSCode open UE5 and go to Editor Preferences. Then go to Source Code and change the dropdown menu to Visual Studio Code.

I just tested creating a project on Windows 10 with UE5 preview 2 and it seems to be working. It's strange that it's creating an empty *.code-workspace file.

@TelesphorosGames
Try to refresh your project as mentioned in the post above this if VSCode is already set to be used.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Oct 10, 2021

@TelesphorosGames @Majd-Yahia

If the *.code-workspace file is not empty and you still get this error make sure you're opening your project as a workspace and not a folder. You need to double click the *.code-workspace file to open your project as a workspace.

To know if you've opened your project as a workspace the titlebar will have (Workspace) in the title after your project name.

@TelesphorosGames

This comment has been minimized.

Copy link

@TelesphorosGames TelesphorosGames commented Oct 11, 2021

@boocs Wow, first let me just thank you sincerely for being so helpful. I really appreciate the assistance here and admire your dedication to your work!

I'm new to coding but from what I can tell UE5 is not generating a .code-workspace for the project I'm working through. This was a pre-packaged course project and I think it might actually be the issue. I've got everything set up just the way you said - UE5 is set to use VScode, but I can't get a .code-workspace file to generate upon refreshing my project. I've tried to rebuild the project several ways now and have been digging at this for almost a week now, but I think it may be an issue with the project itself. I'm going to finish this one without any intellisense fix and when I get to the next course, I'll try to get it working once more and keep you updated.

Again, thanks sincerely for your help here. Your reply did help me understand the program even better than before.

Cheers,
Tele

P.S. I did create a new project in UE5 and when it generated blank code, it only gave me an empty .code-workspace file. I'll definitely keep you posted as I go, thanks again!

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Oct 11, 2021

@TelesphorosGames

Do you have non-ascii characters in your project or Unreal path? If I remember correctly, the Unreal Engine doesn't like non-ascii characters in paths.

@TelesphorosGames

This comment has been minimized.

Copy link

@TelesphorosGames TelesphorosGames commented Oct 12, 2021

@boocs Hello again and thanks once more. Just an update on the situation : UE4.27 is running VSCode with the UE fixes correctly with new project files. I generated a blank C++ project in 4.27 and set Visual Studio Code as my Source Code editor preference. Then I went to File -> Open Code with Visual Studio Code and this opened me a workspace with all of the files I needed to access. I checked the .code-workspace file and it is populated the correct way, unlike the .code-workspace files I had been getting from UE5. I'm testing it again now in UE5 - Generating a fresh project and Visual Studio Code project. Unfortunately, there is no way to easily launch Visual Studio Code directly from UE5 like there was in UE 4.27. Instead, I tried generating a blank C++ class from Tools -> Add C++ Class . The actual compiling of said code took about 20 minutes (was locked at 86% for a long time, so long I thought it froze), and when it was finished, the .code-workspace file was empty.

image

For Now, I'll be using 4.27 to do my studies - Everything is working perfectly in that version with Visual Studio Code and with your UE Intellisense Fix when I start VS code from Unreal.

I really appreciate your help,
Tele

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Oct 13, 2021

Updated extension for 4.27.1+ to work.

boocs

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Oct 13, 2021

@boocs it would be best to switch to GitHub issues for keeping track of any bugs, and use GitHub discussions on your repo for the extension.

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Oct 13, 2021

@Vivraan

Yeah I've thought about switching. I was new to GitHub when I first created this and didn't know a lot of the features.

I don't know when I'll switch but I will eventually.

@Vivraan

This comment has been minimized.

Copy link

@Vivraan Vivraan commented Oct 13, 2021

The cons are of course having to redirect everyone from this massive monolithic thread, since it's the best known link to discussing your package.

@chriswingler

This comment has been minimized.

Copy link

@chriswingler chriswingler commented Oct 13, 2021

Heyo, does this work with UE5 source builds? I have the latest extension version.

I've been getting this:

Couldn't find the UE4/UE5 workspace.
** Error **: Couldn't parse Unreal Engine version.
** Error **: No fixable project could be created.
@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Oct 14, 2021

@chriswingler

Heyo, does this work with UE5 source builds? I have the latest extension version.

It should but I've only tested full source on Ubuntu with 4.26.

When you get that error my extension is not finding the workspace that should load when you open the VSCode's workspace(*.code-workspace) file in your project directory. If you are opening your project this way it will have (Workspace) in the titlebar of VSCode.

If you're opening it correctly and it still errs, open your project's *.code-workspace in a text editor and let me know the name of the UE5 workspace. In my extension I search for UE4 and UE5, if the Unreal Engine has starting naming the workspace anything else then I'd have to update my extension.

@chriswingler

This comment has been minimized.

Copy link

@chriswingler chriswingler commented Oct 14, 2021

Ah ok. I actually don't have a .code-workspace file. Can you share what your workspace file looks like?

@boocs

This comment has been minimized.

Copy link
Owner Author

@boocs boocs commented Oct 14, 2021

@chriswingler

It requires multiple configs to be setup to work with VSCode so that wouldn't work.

In the parent full source UE4 directory, there should be a GenerateProjectFiles script file. I had to launch it for it to create a VSCode project. I'm not sure how it knew to do a VSCode project though.

Looking it up on google and someone said you can pass the flag -VSCode to GenerateProjectFiles for it to create a VSCode project.

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