VSCode with RobotCode while debugging ignores launch.json setting

How did you checkout/clone/pull the repository to your hard disk? Are you using git submodules? Where are the .git folders located?


RobotCode attempts to detect a project’s root folder based on several criteria, which is independent of the workspace opened in VSCode. The detection prioritizes what it finds first:

  1. A robot.toml file
  2. A pyproject.toml file
  3. Version control markers (like .git or .hg folders)

If none of these are found, the current folder becomes the project folder. Note that the .git folder is where git stores repository information.


I suspect you have .git folders in both your FW-TEST-RESOURCES folder and your git folder. This creates a conflict where:

  • RobotCode Runner uses FW-TEST-RESOURCES as the root folder for test execution
  • The language server component uses the git folder’s .git directory (since that’s what’s opened in VSCode)

Two possible solutions:

Option 1: Open FW-TEST-RESOURCES directly in VSCode instead of the git folder. However, this means you won’t have access to your framework files in the workspace.

Option 2: Create or modify a launch.json configuration:

If you already have a launch.json, remove all RobotCode-related configurations, then add:

{
    "name": "RobotCode: Default",
    "type": "robotcode",
    "request": "launch",
    "presentation": {
        "hidden": true
    },
    "purpose": "default",
    "robotCodeArgs": [
        "--no-vcs"
    ]
}
  • The "purpose": "default" setting makes this the default configuration for running tests with RobotCode (can be extended/overridden by other configs)
  • The --no-vcs flag disables .git directory detection for the RobotCode runner (this doesn’t affect the language server or discovery features, which use VSCode’s workspaceFolder)

Additional recommendation:

After implementing the above changes, consider creating a robot.toml configuration file in your project root:

paths = ["FW-TEST-RESOURCES/test_cases"]