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

Undefined variable error shown for variable with another variable within its name #631

Closed
VilleSalonen opened this issue Mar 31, 2022 · 3 comments
Labels
bug Something isn't working robotframework-ls

Comments

@VilleSalonen
Copy link

Describe the bug
We are creating variables dynamically with names like ${SOME_VARIABLE_${i}}. These are reported by LSP as being undefined even though they work fine when run with Robot.

To Reproduce

*** Test Cases ***
Some Test Case
    [Setup]    Initialize Variables
    Log    ${SOME_VARIABLE_0}
    Log    ${SOME_VARIABLE_1}
    Log    ${SOME_VARIABLE_2}

*** Keywords ***
Initialize Variables
    FOR    ${index}    IN RANGE    3
        Set Test Variable    ${SOME_VARIABLE_${index}}    Value ${index}
    END

Expected behavior
I either expect that these would be properly detected as being valid variables OR being omitted from the analysis of undefined variables.

Screenshots
image

Versions:

  • OS: Windows 11
  • Robot Framework Version: 5.0
  • Robot Framework Language Server Version: 0.43.2
  • Client Version: 1.66

Logs
Logs can be recreated by running the sample code above.

@VilleSalonen VilleSalonen added bug Something isn't working robotframework-ls labels Mar 31, 2022
@fabioz fabioz closed this as completed in db33862 Apr 6, 2022
@fabioz
Copy link
Collaborator

fabioz commented Apr 6, 2022

This should be fixed in the 0.43.5 pre-release (please test it -- if everything is ok a new stable release should be done -- hopefully tomorrow).

@VilleSalonen
Copy link
Author

Thank you @fabioz. I will test this tomorrow at work.

@VilleSalonen
Copy link
Author

This worked great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working robotframework-ls
Projects
None yet
Development

No branches or pull requests

2 participants