sweetpad-dev / sweetpad

Develop Swift/iOS projects using VSCode
https://marketplace.visualstudio.com/items?itemName=sweetpad.sweetpad
MIT License
619 stars 20 forks source link

`initCommands` doesn't work with `sweetpad-lldb`type #31

Closed aelam closed 3 months ago

aelam commented 3 months ago

my scenario is I want to load ~/.lldbinit in lldb when it's launched in vscode, because vscode doesn't source ~/.lldbinit automatically

in the type of lldb, I can add initCommands then I can source it but the sweetpad-lldb doesn't have it and there might be some other items

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "sweetpad-lldb",
            "request": "launch",
            "name": "Attach to iOS app (SweetPad)",
            "preLaunchTask": "sweetpad: launch",
        },
        {
            "type": "lldb",
            "request": "attach",
            "name": "Attach(LLDB)",
            "waitFor": true,
            "program": "${command:sweetpad.debugger.getAppPath}",
            "initCommands": [
                "command source ~/.lldbinit"
            ],
        }
    ]
}
hyzyla commented 3 months ago

You can pass "initCommands" as in your second example; all those attributes will be proxied to the "CodeLLDB" debugger.

However, I've noticed that VSCode highlights it with a warning indicating that such an attribute doesn't exist in the schema. Instead of adding each CodeLLDB attribute to "sweetpad-lldb," I've added a codelldbAttributes attribute in the latest release with a free form object that will be passed to the CodeLLDB debugger.

You can use both options, but maybe codelldbAttributes will be less annoying than seeing all those warnings.

CleanShot 2024-08-03 at 20 51 34@2x