boocs / ue4-intellisense-fixes

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

Couldn't find the UE4/UE5 workspace. #8

Open schuberty opened 2 years ago

schuberty commented 2 years ago

The only log I get when using the extension is:

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.

Extension is done.

Do I have to set the path of the Engine somewhere?

Using v2.1.2 version installed from VSIX and Unreal Engine 5.

schuberty commented 2 years ago

I don't know if that may be, but when I generate the project files it doesn't generate a code-workspace. But when I enter the Editor it opens VSCode with a blank test2.code-workspace file to be saved. Now if I save the workspace manually it generates with:

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {}
}

Update: Found the issue by adding

        {
            "name": "UE5",
            "path": "D:\\Programas\\Unreal Engine\\UE_5.0EA"
        },

To the code-workspace.

Now I'm getting:

Extension "UE Intellisense Fixes" is now active!

Found Unreal Engine v5.0.0

Couldn't find files in test2 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.
boocs commented 2 years ago

Is this the first time using VSCode with UE? Do you have the Unreal Engine set to use VSCode from the UE Editor Preferences/Source Code?

You do need to get Generate Project Files to work to setup the project correctly.

Is this a project you've downloaded?

I had trouble recently with a downloaded project working with, the right click uproject file, Generate Project Files.

schuberty commented 2 years ago

It's the first time I used VSCode with UE (but I retried so many times in different ways that it didn't became the first anymore) and I do have UE Editor using VSCode.

I also generated the files and this is not a project that I downloaded. But it's a project that I started with blueprint (Tested with different created projects (test1, test2, test3, ...))

boocs commented 2 years ago

If you create a brand new C++ test project does it work?

Maybe there's a bug with UE5/VSCode adding C++ to a project that was first created as a Blueprints project.

Do you have a compiler installed? clang or Visual Studio Build Tools(cl.exe)?

schuberty commented 2 years ago

Even with a newly C++ project it doesn't work.

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.19041.0",
            "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "windows-msvc-x64"
        }
    ],
    "version": 4
}

This is what is created when I do "Quick Fix > Edit Include path settings"

I have the cl.exe but what seems in the path above.

boocs commented 2 years ago

Sorry was specific enough, I meant a new Unreal Engine C++ project.

You said previously that the project started out as a Blueprint project. I just want to test a brand new Unreal Engine C++ project to see if it creates the correct VSCode config files.

Unreal should create all VSCode config files for you. If it doesn't there's an error somewhere.

schuberty commented 2 years ago

Yah, I meant with newly C++ project a UE C++ Project.

But it doesn't create VSCode config files. It creates a black workspace file that I need to save to be stored in the project. But as it's blank there's no configuration to be used in it.

boocs commented 2 years ago

Try disabling my extension (or any extension that modifies config files) and refresh your UE project. Recheck if the VSCode config file is blank.

Maybe my extension is screwing the config somehow.