unreal-clangd icon indicating copy to clipboard operation
unreal-clangd copied to clipboard

Partial update overwrite launch type

Open drpsyko101 opened this issue 1 month ago • 6 comments

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).

drpsyko101 avatar Oct 28 '25 07:10 drpsyko101

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.

boocs avatar Oct 28 '25 07:10 boocs

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.

boocs avatar Oct 28 '25 07:10 boocs

No worries. Just focus on what important first. I can temporarily use sed as a workaround for this issue.

drpsyko101 avatar Oct 28 '25 08:10 drpsyko101

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.

boocs avatar Nov 04 '25 19:11 boocs

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.

drpsyko101 avatar Nov 10 '25 04:11 drpsyko101

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!

boocs avatar Nov 10 '25 06:11 boocs

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.

boocs avatar Nov 16 '25 03:11 boocs

3.2.1 Update is out. Hopefully solves the problem!

boocs avatar Nov 18 '25 05:11 boocs