boocs / ue4-intellisense-fixes

Automatically fixes VSCode/Unreal Engine Intellisense Config bugs on startup
MIT License
162 stars 9 forks source link

UE4 4.24.3 HTML5 Support Advice #3

Closed Suicosmos closed 3 years ago

Suicosmos commented 3 years ago

Hello, I use Visual Studio Code on Linux and I was having the expected issues with intellisense when using Unreal Engine based Projects. I wanted to say thank you so much for this extension. I have a separate 4.24.3 html based project. I know that 4.24.3 is not supported, but I am willing to put in the work required to make this compatible with 4.24.3 (for html based ue4 projects).

I managed to make the extension apply to 4.24.3 projects successfully. but as expected it does not work, I wanted to know before I proceed if you had any advice to offer in this endeavor?

Thank you for your time.

boocs commented 3 years ago

I'm pretty sure the Defines bug started with 4.25 but you never know.

What Intellisense errors are you getting?

Suicosmos commented 3 years ago

Thanks for the quick reply. The errors I get are pretty simple in nature.

Screenshot from 2021-04-07 22-49-55

Screenshot from 2021-04-07 22-51-33

I've ensured that "usr/include" and "usr/local/include" are both added to the include paths. for example "sys/sysctl.h" is located in "usr/include/linux". which makes it very confusing when this is not found :(.

as for the others compiling,building the project etc works fine, even using ctrl+click to find the definition of the highlighted file works fine.

boocs commented 3 years ago

When you're on a file that errors, go to View->Command Palette. Type diagnostics and choose C/C++: Log Diagnostics.

A log should appear. Copy and paste the log into https://pastebin.com/ . It's free and there's no sign up. If you're concerned about privacy make to to search/replace any user name in the logs.

Here's what it might look like:

-------- Diagnostics - 4/8/2021, 3:19:07 AM
Version: 1.2.2
Current Configuration:
{
    "name": "SimpleShooterEditor Editor Win64 Development (SimpleShooter)",
    "intelliSenseMode": "msvc-x64",

... // rest of the log
Suicosmos commented 3 years ago

Here are the Logs. :)

https://pastebin.com/dfRZp6QR

boocs commented 3 years ago

(Hopefully html5/4.24.3 projects follow the same structure as 4.25 projects)

In your includePath, it doesn't look like you have the directory with your .generated.h and .gen.cpp files.

Make sure you can Build your project successfully first. This will create the directory structure and files.

Then look somewhere in /home/test_user/Documents/test_projects/test_project_html/Intermediate/Build for those files and add that directory.


Also if you ever use the Public/Private directory structure when creating C++ classes then you'll want to add the public and private directories to the includePath. (e.g. J:/Users/me/Documents/Unreal Projects/MyHtml5Project/Source/MyHtml5Project/Private)

Suicosmos commented 3 years ago

Taking your advice about adding that path worked! :D. the generated.h header error is gone and now I just have this error remaining...

Screenshot from 2021-04-10 01-43-14

sysctl.h is located in "/usr/include/linux". Although.. it seems to be referencing a different directory with the "sys/" part of the "sys/sysctl.h". the thing is I have search my entire system and the sys/sysctl.h does not exist.

boocs commented 3 years ago

Also are you sure you searched the UE4 Source?

In the UE4 4.26.1 Full Source, sys/sysctl.h is inside a couple of the UE4 source directories.

(e.g. UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/aarch64-unknown-linux-gnueabi/usr/include/sys/sysctl.h)

I typed that path so it may contain errors


You can also try making a sys subdirectory somewhere and copy the sysctl.h header inside to try placating Intellisense. Make sure to add the parent directory of sys to your includePath. Of course if sysctl.h includes stuff that isn't in the includePath then you'll still get errors. You can experiment though!

Suicosmos commented 3 years ago

ahh, I see my mistake... XD. I was so fixated on the needed headers being apart of the linux system that i did not even consider the UE4 Source headers. I successfully added the emsdk/sys directory "/home/test_user/Desktop/ue4-4.24.3-html5/Engine/Platforms/HTML5/Build/emsdk/emsdk-1.39.18/upstream/emscripten/system/include/compat" which contains "sys/sysctl.h" resolving that issue.

"bits/Alltypes.h" was next so i followed the same concept and added "/home/test_user/Desktop/ue4-4.24.3-html5/Engine/Platforms/HTML5/Build/emsdk/emsdk-1.39.18/upstream/emscripten/system/lib/libc/musl/arch/emscripten" which contains "bits/alltypes.h" solving that as well.

then from here I simply went to each error found the UE4 Source based header and added it to the include path and the issue is resolved!! Thank you so much for being patience with me.

boocs commented 3 years ago

No problem!

Be sure to make a file of all the includePaths you added so you can replace them if they ever go away.