Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Variables Which Are Compounds of Scalars and Environmental Variables Not Recognized #329

Open
GLMeece opened this issue Oct 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@GLMeece
Copy link

GLMeece commented Oct 9, 2024

Description

Variables which are composed of both a partial string and an environmental variable are not recognized, even if both variables are populated and accessible to RobotCode. This is documented in the Variables inside variables section in the official guide.

Example

robot.toml

[env]
ENV_ALIAS = "STAGING"

test.robot

*** Variables ***
${TENANT_PROD}      123456
${TENANT_STAGING}   654321

***Test Cases***
We Are In Staging
    Log To Console                 ${TENANT_%{ENV_ALIAS}}
    Should Be Equal As Integers    ${TENANT_%{ENV_ALIAS}}    654321

Playground example
Note: Due to limitations of the Playground environment, I could not replicate my inline example directly, but the essence of the correct behavior should be observable.

Steps To Reproduce

  1. Re-create an example as above (either inline code or the Playground example)
  2. Note how RobotCode flags the first portion of the variable name as well as the compounded name as not found.

Error Examples

Variable '${TENANT_}' not found.robotcode.namespace(VariableNotFound)
Variable '${TENANT_%{ENV_ALIAS}}' not found.

Expected behavior

RobotCode should be able to resolve the combination as a singular variable and not flag these components as unfound variables.

Note that Robot Framework understands the compound correctly and the expected combination is evaluated properly.

Desktop

  • VS Code Version: 1.93.1
  • RobotCode Version: 0.93.1
  • OS: Windows 11 Enterprise
  • Python Version: 3.12.3
  • RobotFramework Version: 6.1.1
  • Robocop: 5.4.0
  • Robotidy: 4.14.0
@GLMeece GLMeece added the bug Something isn't working label Oct 9, 2024
@d-biehl d-biehl changed the title [BUG] Variables Which Are Compounds of Scalars and Environmental Variables Not Recognized [Enhancement] Variables Which Are Compounds of Scalars and Environmental Variables Not Recognized Oct 17, 2024
@d-biehl d-biehl added enhancement New feature or request and removed bug Something isn't working labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants