boocs / ue4-intellisense-fixes

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

Hasn't been initialized properly #6

Closed Ty-lerCox closed 2 years ago

Ty-lerCox commented 2 years ago
Extension "UE Intellisense Fixes" is now active!

Found Unreal Engine v5.0.0

** Error **: This fixable project hasn't been initialized properly and is invalid.

I am receiving the following error message when launching VSCode. Here are some of my configs:

c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "D:/Games/UE_5.0EA/**",
                "D:/Games/UE_5.0EA/Engine/Source/Runtime/**",
                "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/include",
                "C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/ucrt",
                "C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/shared"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.19041.0",
            "compilerPath": "C:/Program Files/LLVM/bin/clang-cl.exe",
            "cStandard": "gnu17",
            "cppStandard": "c++20",
            "intelliSenseMode": "windows-clang-x64"
        }
    ],
    "version": 4
}

Space.code-workspace

{
  "folders": [
    {
      "name": "Space",
      "path": "."
    },
    {
      "name": "UE5",
      "path": "D:\\Games\\UE_5.0EA"
    }
  ],
  "settings": {
    "intelliSenseMode": "windows-clang-x64",
    "C_Cpp.default.forcedInclude": [
      "C:/Users/user/projects/Space/Intermediate/Build/Win64/UnrealEditor/Development/Space/Definitions.Space.h"
    ]
  }
}
boocs commented 2 years ago

You shouldn't setup your own c_cpp_properties.json. Let UE set it up itself. If you need to add VSCode C++ settings you should set them in the global User config.

You'll need to reset your config so the default UE/VSCode c_cpp_properties.json is recreated. Right click on your project's *.uproject file and choose Generate Visual Studio Project Files.

If this doesn't work 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.

boocs commented 2 years ago

Were you able to figure out the problem?

TomSol-hub commented 2 years ago

Hey, I've got the same problem with UE4 ver 4.27.1

After much headache, I managed to get intellisence to work properly after editing the compileCommands_...json

It seems that there's a new format for the commands, where it puts the following path for the cl.exe "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\"

If I remove this section from the commands and save it, it's working again, but it'll be put in again if you select to Refresh your project.

Any idea how I can automate this process?

boocs commented 2 years ago

@TomSol-hub

What extension version are you running? That should've been fixed a few releases ago.

TomSol-hub commented 2 years ago

What extension version are you running? That should've been fixed a few releases ago.

Hey, it says I'm on 2.1.0 - UE Intellisense Fixes v2.1.0

boocs commented 2 years ago

@TomSol-hub

I'm pretty sure if you upgrade to the latest it'll be fixed. I think it was 2.1.1 where I fixed the problem you're having.

TomSol-hub commented 2 years ago

@boocs Oh jeeze, my bad. It seems I've forgotten how I got the extension and that it wasn't from the extensions tab of VSCode and was wondering why I couldn't find it. Got and installed the latest version 2.1.2 and all's working just beautifully. Thank you a ton!