Skip to content

Instantly share code, notes, and snippets.

@GLMeece
Last active March 2, 2023 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GLMeece/49c29c0831a3754e2deeaa439a9ccfc8 to your computer and use it in GitHub Desktop.
Save GLMeece/49c29c0831a3754e2deeaa439a9ccfc8 to your computer and use it in GitHub Desktop.
Example Launch.json for Robot Framework
{
"version": "0.2.0",
"configurations": [
{
"name": "Robot Framework: Launch Template",
"type": "robotframework-lsp",
"request": "launch",
"terminal": "integrated",
"env": {
"SOME_KEY": "Some value",
"ANOTHER_KEY": "Another value"
},
"args": [
"-d",
"path\\to\\output",
"-T",
"-L",
"TRACE",
"-W",
"120"
]
}
]
}
{
"robot.variables": { "EXECDIR": "${workspaceFolder}" }
}
@GLMeece
Copy link
Author

GLMeece commented Mar 2, 2023

Notes on launch.json and settings.json

Explanations about the above file examples for VS Code.

Presuppositions

  • You have created a .vscode directory at the root of your repository.
  • The launch.json and settings.json files are in that directory.
    Note: the settings.json file need not be in the workspace's .vscode directory, you can instead include those values in the user's settings.json. However, if you are intending on creating a standalone repository, you will need to create this file locally.
  • You have already installed Robocorp's Robot Framework LSP extension

Explanations for launch.json

  • The "env" section is optional but useful for populating variables at runtime.
  • The "args" segment simply adds arguments to calling robot at runtime. In the example above, I've added:
    • "-d" and "path\\to\\output" indicate where to place the output files
    • "-T" tells Robot to timestamp the output filenames.
    • "-L" and "TRACE" set the log level to trace which is the most detailed level available (very handy for debugging purposes)
    • "-W" and "120" set the console width to 120 characters.

Explanation for settings.json

  • We are simply indicating that the Robot Framework variable ${EXECDIR} is anchored to the root of the repository (with VS Code's built-in variable ${workspaceFolder}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment