Hello, i use neovim on arch and article don’t help me
Clangd didn’t index any file with compile_commands from “ue gen” on version 5.2 - 5.4.1
I solved that problem by using command below:
Let’s assume that unreal engine is installed on path - /opt/unreal-engine
Then by using command
/opt/unreal-engine/Engine/Build/BatchFiles/Linux/Build.sh -mode=GenerateClangDatabase -project={PATH_TO_YOUR_UPROJECT_FILE} -game -engine {YourProject}Editor Linux Development
You can get compile_commands at path /opt/unreal-engine/compile_commands.json
This compile_commands works out of the box, there is no need to add flags c++20 and others (in my case).
For newbies: clangd tries to find compile_commands.json going from your project directory to root, if compile_commands will be in /opt/unreal-engine/compile_commands.json, clangd won’t find it.
You need to directly specify dirs where clangd will find compile_commands or make a symbolic link from your project dir → /opt/unreal-engine/compile_commands.json (in my case)
UPD:
ue build generates same compile_commands as command:
/opt/unreal-engine/Engine/Build/BatchFiles/Linux/Build.sh ...