unreal-clangd
unreal-clangd copied to clipboard
Partial update overwrite launch type
Description
The Create Unreal clangd project and Update compile command file commands don't respect the debugging launch type. For example, I'm using lldb to debug with this settings:
{
"name": "Launch MyProjectEditor (Development)",
"request": "launch",
"program": "/mnt/UnrealEngine/Engine/Binaries/Linux/UnrealEditor",
"preLaunchTask": "MyProjectEditor Linux Development Build",
"args": ["/home/MyUser/Documents/MyProject/MyProject.uproject"],
"cwd": "/mnt/UnrealEngine",
"type": "lldb"
}
will be overwritten with:
{
"name": "Launch MyProjectEditor (Development)",
"request": "launch",
"program": "/mnt/UnrealEngine/Engine/Binaries/Linux/UnrealEditor",
"preLaunchTask": "MyProjectEditor Linux Development Build",
"args": ["/home/MyUser/Documents/MyProject/MyProject.uproject"],
"cwd": "/mnt/UnrealEngine",
"type": "cppdbg",
"visualizerFile": "/mnt/UnrealEngine/Engine/Extras/VisualStudioDebugging/Unreal.natvis",
"showDisplayString": true,
"sourceFileMap": {
"/UEVFS/lost-project": "/home/MyUser/Documents/MyProject",
"/UEVFS/Root": "/mnt/UnrealEngine"
}
}
Adding launch to the unreal-clangd.native.code-workspaceFileBackupSettings doesn't seem to work (only for settings I guess).
Yikes, yeah my backup system needs to be revamped.
I'm thinking of just making a backup copy of the *.code-workspace file would be a better and easier solution.
I think I might just take the one at a time feature approach instead of waiting to bundle everything. I'll work on the backup feature next. It might be awhile though as I'll be moving soon and don't want to start something until after.
No worries. Just focus on what important first. I can temporarily use sed as a workaround for this issue.
I have started working on this.
I'm doing it without reading/writing the entire file and using the api to read/write the settings. This makes creating it slower but supposedly the proper way to do it.
Looking at it again, I think this problem is more rooted to the UBT rather than this extension. The config will be overridden whenever UBT is invoked to generate the VScode-specific files, commonly from the editor itself (generate project, add new C++ class etc.) or from the shell/explorer/.desktop extension menu. Fixing this from the extension side may fix the wizard process, but not the UBT part of the problem.
The extension command "Update compile commands (refresh project)" is just the ubt command to refresh a project (ubt refreshing a project also updates the compile commands which adds any new project files).
It should be the only command that reverts the *.code-workspace file.
I'm almost done with the update. Should be sometime this week!
Ok so I should have said end of this week... It's in testing now but I still have to update docs to 5.7. 'Should' be out tomorrow.
3.2.1 Update is out. Hopefully solves the problem!