boocs / ue4-intellisense-fixes

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

Seems not working for me? #29

Closed DexArson closed 1 year ago

DexArson commented 1 year ago

Hi, I'm new to UE5 engine. I created a cpp class in UE5 editor and turned to VSCode, and I found that VSCode couldn't found any header file in any new created cpp class, but the code can be successfully compiled. So I guess it's a Intellisense issue and found this plugin after a long time of googling. However, after installing it, the intellisense still not working. Is there any step I missed?

here is the code: TestActor h - TestProj (Workspace) - Visual Studio Code  Administrator  2023_5_4 16_01_06

here is the output:

*.uproject file was found!

Extension "UE Intellisense Fixes" 3.7.2 is now active!

Found Unreal Engine v5.1.1

Fixing compiler paths in compile commands.
Below is the compile commands first entry command. (WARNING) If getting errors and the compiler path is unexpected reset your UE project.
command/arguments[0]: D:\VS2019 IDE\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe
File write: D:\ue_proj\TestProj\.vscode\compileCommands_TestProj.json
Below is the compile commands first entry command. (WARNING) If getting errors and the compiler path is unexpected reset your UE project.
command/arguments[0]: D:\VS2019 IDE\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe
File write: D:\ue_proj\TestProj\.vscode\compileCommands_Default.json
Done fixing compiler paths.

Fixing compiler path in c_cpp_properties.json.
End fix c_cpp_properties compiler path.

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

** Warning **: Epic Games has included 200 paths that don't exist. Is this on purpose?
No invalid paths returned. No fixes needed.

** Warning **: Epic Games has included 200 paths that don't exist. Is this on purpose?
End fixing invalid paths in response files.

Fixing *.generated.h files!
Searching with fast-glob found nothing. (Sometimes isn't bug)
Correct *.generated.h files are found! Note: This extension doesn't test if all *.generated.h files have been created.
For Intellisense, you'll need to Build any newly created project files with the 'Editor' suffix config (e.g. MyProjectNameEditor (platform) Development Build).
All response files have the correct *.generated.h path!
End fixing *.generated.h

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.

Warning about Public/Private directory
Searching with fast-glob found nothing. (Sometimes isn't bug)
Searching with fast-glob found nothing. (Sometimes isn't bug)
You do not have this directory structure so no warning needed.
End warn Public/Private Directory

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.
Info : UE4 should be default c++14 (it can be c++17 with some special configuration)
Info : UE5 should be c++17
Current VSCode/cpptools cppStandard is:  (Can be blank)
Current c_cpp_properties.json's cppStandard is: c++17 (Overrides VSCode/cpptools if not undefined)
MAIN workspace c_cpp_properties.json's cppStandard is already set.
Current c_cpp_properties.json's cppStandard is: c++17 (Overrides VSCode/cpptools if not undefined)
MAIN workspace c_cpp_properties.json's cppStandard is already set.
Current VSCode/cpptools cppStandard is:  (Can be blank)
Current c_cpp_properties.json's cppStandard is: c++17 (Overrides VSCode/cpptools if not undefined)
UE workspace c_cpp_properties.json's cppStandard is already set.
Current c_cpp_properties.json's cppStandard is: c++17 (Overrides VSCode/cpptools if not undefined)
UE workspace c_cpp_properties.json's cppStandard is already set.
End fix wrong cppStandard.

Fixing launch.json.

Attempting to fix the json of launch.json...
Returning fixed launch file string.
No fixes need for malformed json!
Checking for deprecated external console...
There was nothing to fix!
End fix launch.json.

Start fix wrong intellisense mode
Cpu: 11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz
Didn't need to set intellisenseMode.
End fix wrong intellisense mode.

Attempting to fix UE workspace optimization.

** Warning **: Optimization of UE is enabled!
Enabling UE optimization disables red squiggle compiling for the Unreal Engine source code.
This does not affect your project's source code (it still can have red squiggles).
You can disable this optimization in this extension's settings.
End fix UE optimization.

No need to write TestProj CCppProperties. It was unchanged.

Writing d:\UE_5.1\.vscode\c_cpp_properties.json to file.

*** Number of error messages: 0
*** Number of warning messages: 3
If you get any errors you can try restarting VSCode to check if they've been fixed.

Extension is done.

here is the user setting: TestActor h - TestProj (Workspace) - Visual Studio Code  Administrator  2023_5_4 16_12_14

my system: Win 10 my ue5 version: 5.1 my VSCode version: latest

DexArson commented 1 year ago

And I have regenerated vs project files, reopened vscode, nothing changed.

boocs commented 1 year ago

It could be the compiler it's trying to use.

DexArson commented 1 year ago

I tried what you suggested, but it still doesn't work. As I mentioned before, the code itself can compile normally, it's just that intellisense doesn't work properly, so I don't think it's a compiler issue.

DexArson commented 1 year ago

I understand what's going on now. It's all because I was using the clangd extension for intellisense and disabled the original intellisense of c++ extension. For some reason, UE's including path can't be recognized by clangd and the UE Intellisense Fix extension doesn't work with clangd's intellisense. When I disabled clangd's intellisense and switched to the c++ extension, intellisense seems to be working properly.

DexArson commented 1 year ago

Anyway, thank you for making this extension and reply.

boocs commented 1 year ago

Yeah this is for Microsoft's C++ extension.

Funnily enough I'm about to release a clangd extension for Unreal soon. Might be tomorrow or Saturday. It does seem better than Microsoft's extension imo.