Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension fails to find c_cpp_properties.json #14

Open
MagdielM opened this issue May 4, 2022 · 7 comments
Open

Extension fails to find c_cpp_properties.json #14

MagdielM opened this issue May 4, 2022 · 7 comments

Comments

@MagdielM
Copy link

MagdielM commented May 4, 2022

As of version 3.0.2, it seems the extension fails to detect c_cpp_properties.json in my workspace's .vscode directory. I last tested this with the recent Lyra sample project released by Epic. I'm currently running UE version 5.0.1.

Searching for *.uproject file...
Searching with fast-glob found nothing. (Sometimes isn't bug)
*.uproject file was found!

Extension "UE Intellisense Fixes" 3.0.1 is now active!

Found Unreal Engine v5.0.1

Searching with fast-glob found nothing. (Sometimes isn't bug)
Couldn't find files in UE5 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.

I can confirm the .vscode folder is at the root of the project directory.
image

Interestingly, the UE-generated workspace file did not point to the engine folder, but this was simple to fix manually. Not sure if anything else about the generated configuration may be causing issues.

{
    "folders": [
        {
            "name": "LyraStarterGame",
            "path": "."
        },
    ],
    "settings": {
        "typescript.tsc.autoDetect": "off"
    },
    "extensions": {
        "recommendations": [
            "ms-vscode.cpptools",
            "ms-dotnettools.csharp"
        ]
    }
}
@boocs
Copy link
Owner

boocs commented May 5, 2022

I tried this with v5.0.1 on Windows and it worked for me. Can you tell me the exact steps to reproduce this? How I got mine to work:

  • Installed the Lyra Project.
  • Opened folder and saw that it didn't automatically install any project files.
  • Right clicked on the *.uproject file and chose Generate Visual Studio Project Files

I did already have my Unreal Engine set to use VSCode.

@boocs
Copy link
Owner

boocs commented May 5, 2022

I do still get a bunch of Intellisense errors. I'll have to figure that out.

@boocs
Copy link
Owner

boocs commented May 5, 2022

After Building it creates *.generated.h files. I had to do Generate Visual Studio Project Files again so that the path to those are added to the appropriate files.

Everything seems to work after that. There are a few small Intellisense errors in certain files but I'm sure those will be easy to fix with a little work. For example in LyraCharacter.cpp the only error now is:
"message": "incomplete class type \"TTuple<uint8, FGameplayTag>\" is not allowed",

@boocs
Copy link
Owner

boocs commented May 6, 2022

I am going to add a fix for this. It will warn if no *.generated.h files and will auto add *.generated.h files path to the main *.rsp file.

@MagdielM
Copy link
Author

MagdielM commented May 8, 2022

  • Installed the Lyra Project.
  • Opened folder and saw that it didn't automatically install any project files.
  • Right clicked on the *.uproject file and chose Generate Visual Studio Project Files

Sorry for taking so long to get back to this. I followed pretty much these exact steps except I first used the "Create Visual Studio Code" project from the Tools menu in the editor, then did it from the .uproject file with the editor closed when the previous option didn't fix the problem.

@boocs
Copy link
Owner

boocs commented May 9, 2022

They only thing I can do is give a better warning. My extension relies on that path being there since different projects can use different Unreal versions.

Pretty strange bug!

@boocs
Copy link
Owner

boocs commented May 9, 2022

I forgot if you right click on the *.uproject there is a Switch Unreal Engine Version option. If this happens to you again try selecting the unreal version you created your project with and hit ok. It will also generate project files.

I tested this out with a 5.0.1 project and removed the path to the unreal engine in the code-workspace file. When I switched engines, to the same version, it created the unreal path in code-workspace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants