We discussed this functionality in the #vscode slack on the RobotFramework workspace.
Problem description
RobotCode only performs a static analysis, i.e. it does not analyse which keyword may have been called at some point previously and whether a variable may have been set somewhere there. This creates a lot of red lines in our repositories since we set suite variables at different times during test suites, which are then re-used in other tests.
For example we reuse data from an API response here:
POST /api/Afspraken/Put
${RESPONSE} Post On Session ${SESSIENAAM} /api/Afspraken/Put json=&{json}
Set suite Variable ${ZORGAFSPRAAKID} ${response.json()['id']}
GET /api/Afspraken/Get/{dossierId}
${response} GET On Session ${SESSIENAAM} /api/Afspraken/Get/${dossierId}
Should Be Equal As Strings ${response.json()[0]['id']} ${ZORGAFSPRAAKID}
The variable ${ZORGAFSPRAAKID} is picked up by the linter as not assigned.
Solution I would like
Take these suite variables into account in some way.
Additional context
As an alternative I switched back to the Robocorp language server for the time being.
We discussed this functionality in the #vscode slack on the RobotFramework workspace.
Problem description RobotCode only performs a static analysis, i.e. it does not analyse which keyword may have been called at some point previously and whether a variable may have been set somewhere there. This creates a lot of red lines in our repositories since we set suite variables at different times during test suites, which are then re-used in other tests.
For example we reuse data from an API response here:
The variable
${ZORGAFSPRAAKID}
is picked up by the linter as not assigned.Solution I would like Take these suite variables into account in some way.
Additional context As an alternative I switched back to the Robocorp language server for the time being.