boocs / ue4-intellisense-fixes

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

Error while “Fixing invalid paths in response files” on Mac #15

Closed yggie closed 2 years ago

yggie commented 2 years ago

I get this error repeatedly on startup:

Regex couldn't parse matches in compile commands file. re: (?<=@"|@').*.rsp , flags: gm

The compileCommands_xxx.json generated by UE5 on Mac appears to use non-quoted rsp file references, for example:

    {
        "file": "/Users/name/path/to/MyProject/Source/MyProject/Example.h",
        "command": "\"/usr/bin/clang++\" @/Users/name/path/to/Project/.vscode/compileCommands_Default/MyProject.007.rsp",
        "directory": "/Users/Shared/EpicGames/UE_5.0/Engine/Source"
    },

But the regex used in the source code does not expect the @ without a quote:

https://github.com/boocs/ue4-intellisense-fixes/blob/efaa1ed3df2fedd8d23fcf9cbbe439492c0a998f/src/project/compileCommands.ts#L9

Not sure if there is a reason for this. I’ve patched the extension and it appears to work with the changes on my fork. Will make a PR shortly if you’re happy to accept the change upstream.