Skip to content
Discussion options

You must be logged in to vote

The configuration is evaluated when you launch a new debug session.

I think what could work is using a forward reference to mutate the configuration within the program function:

local lldb_launch
lldb_launch = {
  name = "Launch",
  type = "lldb",
  request = 'launch',
  program = function()
    local module = vim.fn.input('Module name: ')
    local apps = {'non_test_app', 'non_test_app2'}
    local is_test = true

    -- 👇❗
    lldb_launch.cwd = 'whatever'

    for _, v in ipairs(apps) do
      if module == v then
          is_test = false
      end
    end
    if is_test then
        return '${workspaceFolder}/bin/tests/debug/' .. module .. '/' .. module .. '-tests'
    end
    return vim.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AlexXandreE
Comment options

Answer selected by AlexXandreE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants