Search code examples
visual-studio-codeunreal-engine4

The way to fix unreal 4.27 vscode intelligence bug


The unreal engine 4.27 has bug on vscode intelligence.

I have find out how to fix it and write it out.

First the bug is the compileCommands_Default.json and compileCommands_LearnUE4.json is the main compilecommand file for vscode intelligence.

The bug is every "command" fields lost a double quotation marks. details show below

[
    {
        "file": "D:\\\\unreal\\\\LearnUE4\\\\Source\\\\LearnUE4\\\\LearnUE4.Build.cs",
        "command": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\cl.exe @\"D:\\unreal\\LearnUE4\\.vscode\\compileCommands_Default\\LearnUE4.210.rsp\"",
        "directory": "D:\\game\\UE_4.27\\Engine\\Source"
    }
]

Look at the command field

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe

which should change to "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe"

add a quotation at the begin and end.


Solution

  • My VSCode extension fixes this and other problems. https://github.com/boocs/ue4-intellisense-fixes

    My solution was just to remove the path and just keep the cl.exe

    I did report it to Epic a while ago, in a bug report, and gave them both solutions. But I think reporting is just a black hole that rarely works.