Run the last touched test file in VSCode Typescript Vitest

Here’s my launch.json:

{
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Debug Current Test File",
      "autoAttachChildProcesses": true,
      "skipFiles": ["<node_internals>/**", "**/node_modules/**"],
      "program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
      "args": ["run", "${relativeFile}"],
      "smartStep": true,
      "console": "internalConsole"
    }
  ]
}

I have to click on the test file I want to run everytime before I press f5 to debug.

I want to remember the last opened test file in the tabs, possibly detecting from a given set of file grobs or a specific directory.

Not the last executed test file, but the last opened test file in the editor.